Data migration method, terminal equipment and storage medium
By determining and classifying the data migration module on the mobile phone and backing up and transmitting it in alternating order, the problem of data migration processing time in the prior art is solved, and efficient data migration and fast transmission rate are achieved.
Patent Information
- Application Number
- CN202311767281.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2043-12-20
AI Technical Summary
Existing mobile phones fail to fully utilize the parallel processing capabilities of processor resources when migrating data, resulting in too long processing time for data migration, affecting the transmission rate and reducing user experience.
By determining the modules that support data migration, a list of modules to be backed up is generated, and classified and sorted according to the module type, and backup and transmit in alternating order, ensuring that the multimedia files are processed at the later location, realizing parallel processing of module backup and data transmission.
It realizes efficient processing of data migration, shortens data migration time, improves transmission speed, and improves user's replacement experience.
Smart Images

Figure CN120224166A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminal devices, and particularly to a data migration method, a terminal device, and a storage medium. Background Art
[0002] The replacement speed of terminal devices (such as mobile phones) is getting faster and faster, and the frequency of users changing mobile phones is also increasing. Data migration (i.e., data cloning) between new and old mobile phones is the primary problem that users need to face when changing mobile phones. However, when existing mobile phones perform data migration, they do not utilize the parallel processing capabilities of the processor resources of the mobile phones, resulting in too long processing time for data migration, affecting the transmission rate of data migration, and reducing the user experience. Summary of the Invention
[0003] In view of the above, it is necessary to provide a data migration method, a terminal device, and a storage medium to make full use of the parallel processing capabilities of processor resources and solve the technical problem of low transmission rate of data migration.
[0004] In a first aspect, an embodiment of this application provides a data migration method, which is applied to a first terminal. The method includes: determining modules that support data migration and obtaining data corresponding to each determined module, and generating a list of modules to be backed up based on all the determined modules; classifying all the modules in the list of modules to be backed up into third-party applications, system applications, and multimedia files according to the module type; sorting the system applications and third-party applications in the list of modules to be backed up in an alternating order, and sorting all the multimedia files in the list of backup modules in the subsequent positions of the list of modules to be backed up in sequence; backing up the data of each module in the list of modules to be backed up one by one according to the sorting order, and transmitting the backup file obtained after a module is backed up to a second terminal. In the above technical solution, all the modules in the list of modules to be backed up are sorted in the alternating order of system applications and third-party applications, and all the multimedia files are sequentially placed in the subsequent positions of the modules that have been sorted in the list of modules to be backed up, and the data of each module in the list of modules to be backed up is backed up one by one according to the sorting order, and after the data of a module is backed up, the data of the backed-up module is transmitted to the second terminal. In this way, parallel processing of module backup and data transmission of the first terminal can be achieved, and parallel recovery of module data can be ensured on the second terminal, so as to achieve efficient data migration.
[0005] In one embodiment of the present application, the data of each module in the list of modules to be backed up is backed up one by one in the sorting order, including: if the module is a system application and the data corresponding to the module is a picture, the picture is packaged into a compressed file, and the compressed file of the picture is used as the backup file of the module; if the type of the module is a system application and the data corresponding to the module is a contact, a contact database including the contacts is generated, and the contact database is used as the backup file of the module. In the above technical solution, the backup of the pictures of the system application can be realized by packaging the pictures into a compressed file, or the backup of the contacts of the system application can be realized by generating a contact database including the contacts.
[0006] In one embodiment of the present application, the data of each module in the list of modules to be backed up is backed up one by one in the sorting order, including: if the module is a third-party application, obtain the path of the installation package of the third-party application; obtain the application data of the third-party application, compress the application data to obtain a compressed package of the application data, and use the path of the installation package and the compressed package of the application data as the backup file of the module. In the above technical solution, the backup of the third-party application is realized by compressing the application data to obtain a compressed package of the application data, and using the path of the installation package and the compressed package of the application data as the backup file of the third-party application.
[0007] In one embodiment of the present application, the data of each module in the list of modules to be backed up is backed up one by one in the sorting order, including: if the module is a multimedia file, obtain the data of the multimedia file, set the specified storage location of the data of the multimedia file on the second terminal, and use the data of the multimedia file and the specified storage location as the backup file of the module. In the above technical solution, by using the data of the multimedia file and the specified storage location as the backup file of the multimedia file, the multimedia file can realize data migration without backup compression and subsequent unpacking and recovery processes, thus avoiding the occupation of the transmission channel for data migration by the multimedia file, giving priority to ensuring the priority transmission and recovery of data such as system applications and third-party applications, and reducing the time required for subsequent overall data recovery.
[0008] In one embodiment of the present application, the data of each module in the list of modules to be backed up is backed up one by one in the sorting order, including: if the data backup of a module is completed, the backup file of the module is input into the transmission queue, and the module is deleted from the list of modules to be backed up to update the list of modules to be backed up; if there are remaining modules in the list of modules to be backed up that have not been backed up, the data backup management module of the first terminal backs up the data of the remaining modules in the list of modules to be backed up one by one in the sorting order; if the data of all modules in the list of modules to be backed up has been backed up, it is determined that the backup task is completed. In the above technical solution, after the data backup of each module is completed, the corresponding backup file of the module is input into the transmission queue, and the module is deleted from the list of modules to be backed up to update the list of modules to be backed up. In this way, by detecting whether there are remaining modules in the list of modules to be backed up, it can be determined whether the backup task is completed.
[0009] In one embodiment of the present application, the backup file obtained after a module is backed up is transmitted to the second terminal, including: generating a list of backup files to be uploaded according to the backup files of the modules in the transmission queue, and transmitting the backup files in the transmission queue to the second terminal in sequence; if the transmission of the backup file of a module is completed, the uploaded backup file that has been completed is deleted from the list of backup files to be uploaded to update the list of backup files to be uploaded; if there are remaining backup files in the list of backup files to be uploaded that have not been transmitted, the remaining backup files in the list of backup files to be uploaded are transmitted; if the transmission of all backup files in the list of backup files to be uploaded is completed, it is determined that the transmission task of the backup files is completed. In the above technical solution, after the transmission of the backup file of a module is completed, the uploaded backup file that has been completed is deleted from the list of backup files to be uploaded to update the list of backup files to be uploaded. In this way, by detecting whether there are remaining backup files of modules in the list of backup files to be uploaded, it can be determined whether the transmission task of the backup files is completed.
[0010] In one embodiment of the present application, generating a list of modules to be backed up based on the determined all modules includes: if a module is in the preset blacklist, the module is deleted from the list of modules to be backed up. The above technical solution can delete the modules in the blacklist from the list of modules to be backed up, so as to filter the modules in the blacklist during data migration and ensure the security of data migration.
[0011] Second aspect, an embodiment of the present application provides a data migration method, which is applied to a second terminal. The method includes: receiving backup files of each module sent by a first terminal; determining a recovery thread corresponding to each module according to the module type of each module, and performing parallel recovery on the backup files of the corresponding module through the recovery thread. In the above technical solution, the second terminal performs parallel data recovery on different types of modules by using the corresponding recovery threads, so as to maximize the use of the CPU system resources of the second terminal and achieve efficient migration of data from the first terminal to the second terminal.
[0012] In an embodiment of the present application, performing parallel recovery on the backup files of the corresponding module through the recovery thread includes: if the module is a system application, using the recovery thread of the system application to sequentially recover the backup files of each system application; if the module is a third-party application, using the recovery thread of the third-party application to sequentially recover the backup files of the third-party application; if the module is a multimedia file, using the recovery thread of the multimedia file to sequentially recover the backup files of the multimedia file. The above technical solution can use the corresponding recovery thread to recover the backup files of the module according to the type of the module, so as to achieve parallel data recovery of the backup files of different modules.
[0013] In an embodiment of the present application, using the recovery thread of the system application to sequentially recover the backup files of the system application includes: if the backup file of the system application is a compressed file of a picture, decompressing the compressed file of the picture to the target storage directory through the recovery thread of the system application, and the target storage directory is the storage address where the first terminal stores the pictures of the system application. The above technical solution can sequentially recover the compressed files of the pictures of each system application through the recovery thread of the system application.
[0014] In an embodiment of the present application, using the recovery thread of the third-party application to sequentially recover the backup files of the third-party application includes: sequentially installing the installation packages of each third-party application through the first recovery thread of the third-party application, and performing parallel recovery on the application data of each third-party application through the second recovery thread of the third-party application. The above technical solution can install the installation packages of the third-party application through the first recovery thread of the third-party application and perform parallel recovery on the application data of the third-party application through the second recovery thread, so as to achieve parallel recovery of the third-party application and reduce the time consumed for the third-party application to be recovered.
[0015] In an embodiment of the present application, the application data of each third-party application is restored in parallel through a second restoration thread of the third-party application, including: the second restoration thread calls the backup management service function of the second terminal to restore the data of each third-party application in parallel, and stores the data of each third-party application under the corresponding storage path. The above technical solution can restore the data of each third-party application by calling the backup management service function of the second restoration thread.
[0016] In an embodiment of the present application, a restoration thread of a multimedia file is used to sequentially restore the backup files of the multimedia file, including: sequentially obtaining the data and the specified storage location of each multimedia file through the thread of the multimedia file, and storing the data of each multimedia file at the corresponding specified storage location in the second terminal. The above technical solution sequentially obtains the data and the specified storage location of each multimedia file through the thread of the multimedia file, and stores the data of each multimedia file at the corresponding specified storage location in the second terminal, so that data migration can be realized without unpacking and restoring the backup files of the multimedia file, thus avoiding the transmission channel for data migration being occupied by the multimedia file, giving priority to ensuring the priority transmission and restoration of data such as system applications and third-party applications, and reducing the time required for overall data restoration.
[0017] In an embodiment of the present application, the method further includes: after all multimedia files are restored, notifying the system multimedia of the second terminal to perform a multimedia scan; by performing the multimedia scan, adding the pictures of all multimedia files to the album application of the second terminal, so that the applications of the second terminal can access the pictures of all multimedia files. The above technical solution, after all multimedia files are restored, only needs to perform a multimedia scan once to enable other applications of the second terminal to access the picture content of all multimedia files. Compared with the existing solution of performing a multimedia scan once after the restoration of one multimedia file, the multimedia scan power consumption can be reduced.
[0018] In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory and a processor: the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the above data migration method.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program instructions. When the program instructions run on a terminal device, the terminal device executes the above data migration method.
[0020] In addition, the technical effects brought by the third aspect to the fourth aspect can be seen in the descriptions related to the methods of each design in the above method part, and will not be elaborated here. Brief Description of the Drawings
[0021] To more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings in the embodiments will be briefly introduced below. It should be understood that the following accompanying drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related accompanying drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1A Schematic diagram of the sending interface for data migration of an existing old mobile phone.
[0023] Figure 1B Schematic diagram of the receiving interface for data migration of an existing new mobile phone.
[0024] Figure 1C Schematic diagram of the prompt interface after data migration of the old mobile phone is completed.
[0025] Figure 2 Software structure block diagram of the terminal device provided by an embodiment of the present application.
[0026] Figure 3 Framework diagram of the data migration system provided by an embodiment of the present application.
[0027] Figure 4 Flowchart of the data migration method provided by an embodiment of the present application.
[0028] Figure 5 Schematic diagram of sorting, transmitting, and restoring the modules provided by an embodiment of the present application.
[0029] Figure 6 Flowchart of the data migration method provided by an embodiment of the present application.
[0030] Figure 7 Flowchart of the data migration method provided by an embodiment of the present application.
[0031] Figure 8 Schematic diagram of parallel processing of transmission and restoration by a third-party application provided by an embodiment of the present application.
[0032] Figure 9 Flowchart of the data migration method provided by an embodiment of the present application.
[0033] Figure 10 Flowchart of the method for data migration of multimedia files provided by an embodiment of the present application.
[0034] Figure 11 Schematic diagram of the terminal device provided by an embodiment of the present application. Detailed Embodiments
[0035] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that unless otherwise specified in this application, " / " means "or". For example, A / B may mean A or B. The "and / or" in this application is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, these three situations. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b, or c may represent: a, b, c, a and b, a and c, b and c, a, b, and c, these seven situations.
[0037] Mobile phones have become an indispensable part of people's daily lives. However, the pace of mobile phone replacement is getting faster and faster, and the frequency of people changing mobile phones is also increasing. Data migration (i.e., data cloning) between new and old mobile phones is the primary problem that users need to face when changing mobile phones. For example, when a user changes mobile phones, the user needs to transfer the system settings, multimedia files, system applications (such as text messages, contact applications), and data of third-party applications in the old mobile phone to the new mobile phone, so as to avoid the cumbersome and time-consuming data backup operation on the new mobile phone. However, when existing mobile phones perform data migration, they do not fully utilize the parallel processing ability of the mobile phone's processor resources, resulting in too long a processing time for data migration and affecting the transmission rate of data migration.
[0038] For example, referring to Figure 1A as shown, it is a schematic diagram of the sending interface for data migration of an old mobile phone. As Figure 1A , the old mobile phone is used to send data, and the sending rate is 159 MB / s. It is expected that it will take 17 minutes to complete the sending task of all data migration. Referring to Figure 1B as shown, it is a schematic diagram of the receiving interface for data migration of a new mobile phone. As Figure 1BThe new phone is used to receive data at a rate of 159MB / s. It is estimated that it will take 17 minutes to complete the receiving task of all data migration. Figure 1C As shown in the figure, it is a schematic diagram of the prompt interface after the old mobile phone completes the data migration. Figure 1C , the old phone completed the migration of 73G data, and the actual total time consumed was 24 minutes. Because the parallel processing capability of the mobile phone's processor resources was not fully utilized, the mobile phone took too long to process data migration, affecting the user's experience of changing phones.
[0039] In order to solve the above problems, the present application provides a data migration method. The method is applied in a terminal device. The terminal device includes an application processor, and the application processor is used to run an operating system. The operating system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the terminal device.
[0040] Figure 2 A software structure diagram of a terminal device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the kernel layer, and the hardware layer. The application layer may include a series of application packages.
[0041] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0042] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a display engine, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The application framework layer may provide display function-related APIs for the display applications of the application layer, and provide display services for the display applications to implement the display dimming function.
[0043] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0044] The content provider is used to store and retrieve data, and make this data accessible to applications. The data may include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.
[0045] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
[0046] The phone manager is used to provide the communication functions of the terminal device. For example, the management of call states (including answering, hanging up, etc.).
[0047] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.
[0048] The notification manager enables applications to display notification information in the status bar. It can be used to convey informative messages, which can disappear automatically after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background running application, or a notification that appears in the form of a dialog window on the screen. For example, it prompts text information in the status bar, emits a prompt tone, the electronic device vibrates, the indicator light flashes, etc.
[0049] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0050] The core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.
[0051] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0052] The system libraries can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing libraries (such as: OpenGL ES), 2D graphics engines (such as: SGL), etc.
[0053] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0054] The media library supports the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0055] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0056] The 2D graphics engine is the drawing engine for 2D drawing.
[0057] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0058] The hardware layer at least includes a touch sensor and a display screen. The touch sensor is used to sense the touch operation of the user on the display screen.
[0059] Figure 3 It is a framework diagram of the data migration system provided by an embodiment of the present application. The data migration system 10 includes a first terminal 11 and a second terminal 12. The first terminal 11 is used to back up the data of system settings, multimedia files, system applications, and third-party applications in the first terminal 11, and transmit the backed-up data to the second terminal 12. The second terminal 12 receives the data sent by the first terminal and restores the data, so as to realize the function of migrating the data from the first terminal 11 to the second terminal 12.
[0060] In an embodiment of the present application, the first terminal 11 includes a first user interface (UI) process and a first data service process. The first UI process includes a first connection management module, a first session management module, a transmission client module, and a data backup management module. The second terminal 12 includes a second UI process and a second data service process. The second UI process includes a second connection management module, a second session management module, a transmission server, and a data import management module. The first connection management module interacts with the second connection management module to establish a communication connection between the first terminal 11 and the second terminal 12. In an embodiment of the present application, the second connection management module is used to control the second terminal 12 to display a QR code and establish a hotspot. After detecting that the first terminal scans the QR code displayed by the second terminal 12, the second connection management module sends a password to the first terminal 11. The first connection management module connects to the second terminal 12 according to the password sent by the second terminal 12, so as to realize the communication connection between the first terminal 11 and the second terminal 12.
[0061] The first session management module interacts with the second session management module to establish and manage a session between the first terminal 11 and the second terminal 12.
[0062] The data backup management module is used to call the data service process to back up the system settings, multimedia files, system applications, and data of third-party applications of the first terminal 11.
[0063] The transmission client module and the transmission server module perform data interaction to transmit data between the first terminal 11 and the second terminal 12. For example, the backed-up data is sent to the second terminal 12 through the transmission client module. The transmission server module in the second terminal 12 receives the backed-up data sent by the first terminal 11.
[0064] The data import management module is used to restore the backed-up data sent by the first terminal 11. For example, the data import management module restores the backed-up data of system settings, multimedia files, system applications, and third-party applications in the second terminal 12, so that the backed-up data of system settings, multimedia files, system applications, and third-party applications is applied to the second terminal 12, realizing the migration of data from the first terminal 11 to the second terminal 12. In an embodiment of the present application, the first UI process and the first data service process can be set in any layer of the application layer, application framework layer, Android runtime, system library, kernel layer, and hardware layer of the first terminal 11 according to needs; the second UI process and the second data service process can be set in any layer of the application layer, application framework layer, Android runtime, system library, kernel layer, and hardware layer of the second terminal 12 according to needs.
[0065] As follows, the data migration method of the embodiments of the present application will be specifically introduced in combination with Figure 4 Specifically, the flowchart of the data migration method provided by an embodiment of the present application is shown in the reference Figure 4 As shown, it is the flowchart of the data migration method provided by an embodiment of the present application. The data migration method is applied in the first terminal (such as Figure 3 the first terminal 11 shown). Figure 4 The exemplary method includes one or more steps, but does not constitute a limitation to the present application. In addition, the order of the steps of the method is only an example, and the order of the steps can be changed. Additional steps can be added or steps can be reduced without departing from the content disclosed in the present application. The method specifically includes the following steps.
[0066] Step S401, determine the modules that support data migration and obtain the data corresponding to each determined module, and generate a list of modules to be backed up based on all the determined modules.
[0067] In an embodiment of the present application, the data backup management module of the first terminal determines all modules that support data migration, obtains the data of each module, and generates a list of modules to be backed up including all modules according to the determined modules. In an embodiment of the present application, the modules can be at least divided into system applications, third-party applications, and multimedia files according to the module type. Among them, system applications include but are not limited to: text messages, call records, contacts, notes, recordings, schedules, system settings. Third-party applications include but are not limited to: social media applications (such as WeChat TM , Weibo TM ), game applications (such as Honor of Kings TM , PlayerUnknown's Battlegrounds TM ), map navigation applications (such as Baidu Map TM , Google Maps TM , AutoNavi Map TM ), etc. Multimedia files include files such as music, images, and videos.
[0068] In an embodiment of the present application, before generating the list of modules to be backed up including all modules, it is determined whether the obtained module is in a preset blacklist; if the obtained module is in the blacklist, the module is deleted from the list of modules to be backed up. The above embodiment can delete the modules belonging to the blacklist in the list of modules to be backed up, so as to filter the modules in the blacklist during data migration, ensuring the security of data migration. The blacklist can be set in advance, or it can be confirmed and set for the modules in the list of modules to be backed up before data migration. For example, modules that do not meet the requirements of data security are added to the blacklist to avoid data risks for the second terminal due to migrating the modules in the blacklist and the corresponding data.
[0069] Step S402: Classify all modules in the list of modules to be backed up into third-party applications, system applications, and multimedia files according to the module type.
[0070] In an embodiment of the present application, the data backup management module classifies all modules in the list of modules to be backed up into third-party applications, system applications, and multimedia files according to the module type. For example, if the modules in the list of modules to be backed up include text messages, call records, social media applications, game applications, contacts, notes, recordings, map navigation applications, schedules, music files, and video files, then the data backup management module classifies text messages, call records, contacts, notes, recordings, and schedules into system applications according to the module type; classifies social media applications, game applications, and map navigation applications as third-party applications; and classifies music files and video files as multimedia files.
[0071] Step S403: Sort the system applications and third-party applications in the module list to be backed up in an alternating order, and sequentially sort all the multimedia files in the backup module list to a position behind the module list to be backed up.
[0072] In an embodiment of the present application, the data backup management module sorts all the system applications and third-party applications in the module list to be backed up in an alternating order of system applications and third-party applications. After all the system applications and all the third-party applications are sorted, all the multimedia files are sequentially placed behind the sorted modules in the module list to be backed up.
[0073] The present application embodiment does not specifically limit the alternating order of system applications and third-party applications. For example, the alternating order can be a one-to-one alternating sort of one system application and one third-party application, which can be set according to actual applications and is not limited in this embodiment. During the alternating sorting process, according to the importance level of the modules, the modules with a higher importance level can be sorted in the front to prioritize the backup and transmission of data; or they can be sorted according to the size of the data volume corresponding to the modules, and the modules corresponding to a smaller data volume can be sorted in the front. Refer to Figure 5 As shown, it is a schematic diagram of sorting, backing up, transmitting, and restoring modules in an embodiment of the present application. As Figure 5 shown, system applications such as text messages, call records, contacts, notes, recordings, schedules, etc. are sorted alternately with multiple third-party applications, and then all the multimedia files are sequentially placed behind the sorted modules in the module list to be backed up, and each module is backed up according to the sorting order. For example, Figure 5 the alternating order of the example shown is: system application (text message), third-party application, system application (call record), third-party application, system application (contact), third-party application, system application (note), third-party application, system application (recording), third-party application, system application (schedule), third-party application, etc. Figure 5 The examples are only for illustration, and the actual application is not limited thereto.
[0074] Step S404: Back up the data of each module in the module list to be backed up one by one according to the sorting order, and after the data backup of each module is completed, transmit the backup file obtained after the backup of each module to the second terminal.
[0075] Refer to Figure 5 In an embodiment of the present application, the data backup management module calls the first service process, which is used to back up the data of each module in the module list to be backed up one by one according to the sorting order, and after the data backup of any module is completed, obtain the corresponding backup file and transmit the backup file to the second terminal, so that the backup of the module and the transmission of the module can be processed in parallel.
[0076] In one embodiment of the present application, backing up the data of each module in the module list to be backed up one by one in the sorting order to obtain a backup file includes: if the type of the module is a system application and the data of the system application is a picture, packing the picture into a compressed file and using the compressed file as the backup file; if the type of the module is a system application and the data of the system application is contacts, generating a contacts database including the contacts and using the contacts database as the backup file.
[0077] In one embodiment of the present application, backing up the data of each module in the module list to be backed up one by one in the sorting order includes: if the type of the module is a third-party application, obtaining the path of the installation package (for example, apk file) of the third-party application; obtaining the application data of the third-party application, compressing the application data to obtain a compressed package of the application data, and using the path information of the installation package and the compressed package of the application data as the backup file.
[0078] In one embodiment of the present application, backing up the data of each module in the module list to be backed up one by one in the sorting order includes: if the type of the module is a multimedia file, obtaining the data of the multimedia file, setting a specified storage location of the data of the multimedia file on the second terminal, and using the data of the multimedia file and the specified storage location as the backup file.
[0079] In the above embodiments, all the modules in the module list to be backed up are sorted in the alternating order of system applications and third-party applications, and all the multimedia files are sequentially placed behind the sorted modules in the module list to be backed up. Then, the data of each module in the module list to be backed up is backed up one by one in the sorting order. After the data backup of a module is completed, the data of the backed-up module is transmitted to the second terminal. In this way, the parallel processing of module backup and transmission is realized, and it is ensured that the subsequent recovery operations of modules such as system applications and third-party applications can be parallelly recovered with other operations as early as possible. At the same time, the first terminal obtains the data of the multimedia file, sets the storage location of the data of the multimedia file on the second terminal, and sends the data of the multimedia file and the storage location of the data of the multimedia file on the second terminal to the second terminal, realizing the direct transmission of the data of the multimedia file between the first terminal and the second terminal. In this way, the data migration of the multimedia file can be realized without the need for backup compression and unpacking recovery processes, so as to avoid the transmission channel of data migration being occupied by the multimedia file, giving priority to ensuring the priority transmission and recovery of data such as system applications and third-party applications, and reducing the time required for the overall data to be recovered.
[0080] Taking the first terminal as an old mobile phone and the second terminal as a new mobile phone as an example, the specific implementation steps of the above data migration method are specifically described as follows. Refer to Figure 6As shown, the data backup management module of the old mobile phone determines the modules that support data migration and obtains the data of each module. The data backup management module generates a list of modules to be backed up that includes all modules based on the determined modules. Then, the data backup management module divides the modules in the list of modules to be backed up into a third-party application list, a system application list, and a multimedia file list according to the module type. The modules in the third-party application list include third-party applications, the modules in the system application list include system applications, and the modules in the multimedia file list include multimedia files. Refer to Figure 5 , the data backup management module alternately sorts one module in the system application list and one module in the third-party application list in sequence until the sorting of the modules in the system application list and the third-party application list is completed. The data backup management module places all multimedia files in the subsequent positions of the sorted modules in the list of modules to be backed up in sequence. The data backup management module backs up the data of each module in the list of modules to be backed up one by one according to the sorting order. If the data backup of a module is completed, the data backup management module inputs the backup file of the module into the transmission queue and deletes the module with the completed data backup from the list of modules to be backed up to update the list of modules to be backed up. The data backup management module determines whether all the modules in the list of modules to be backed up have been backed up. If all the modules in the list of modules to be backed up have been backed up, it is determined that the backup task of the modules is completed; if there are remaining modules in the list of modules to be backed up that have not been backed up, the data backup management module backs up the data of the remaining modules in the list of modules to be backed up one by one according to the sorting order.
[0081] The data backup management module generates a list of backup files to be uploaded based on the backup files of the modules in the transmission queue and transmits the backup files of the modules in the transmission queue to the new mobile phone one by one. After generating the list of backup files to be uploaded, the data backup management module also updates the backup files in the list of backup files to be uploaded based on the backup files of the modules input into the transmission queue. If the transmission of the backup file of a module is completed, the data backup management module deletes the backup file that has been completed from the list of backup files to be uploaded to update the list of backup files to be uploaded. The data backup management module determines whether all the backup files in the list of backup files to be uploaded have been transmitted.
[0082] If there are remaining backup files in the list of backup files to be uploaded that have not been transmitted, the data backup management module continues to transmit the remaining backup files in the list of backup files to be uploaded; if all the backup files in the list of backup files to be uploaded have been transmitted, it is determined that the transmission task of the backup files of the modules is completed.
[0083] In the above embodiments, the old mobile phone differentiates all modules that support data migration into three types: third-party applications, system applications, and multimedia files. Then, the modules of the two types of third-party applications and system applications are sorted alternately. In this way, it is ensured that the third-party applications and system applications are alternately backed up, and the backup files of the third-party applications and system applications are alternately transmitted. At the same time, the old mobile phone places the backup files of the modules of the multimedia file type at the last position of the backup file list to be uploaded, and directly stores them in the new mobile phone through direct transmission. In this way, it gives priority to ensuring the priority transmission and recovery of data such as system applications and third-party applications, and reduces the recovery time when the overall data is migrated.
[0084] Reference Figure 7 As shown, it is a flowchart of a data migration method provided by an embodiment of the present application. The data migration method is applied in a second terminal (such as Figure 3 the second terminal 12 shown). Figure 4 In the exemplary method, one or more steps are executed, but it does not constitute a limitation to the present application. In addition, the order of the steps of the method is only an example, and the order of the steps can be changed. Without departing from the content disclosed in the present application, additional steps can be added or steps can be reduced. The method specifically includes the following steps.
[0085] Step S701, receive the backup file of each module sent by the first terminal.
[0086] In an embodiment of the present application, the data import management module of the second terminal receives the backup file of each module sent by the first terminal, and adds the received backup file to the file list to be received.
[0087] Step S702, determine the recovery thread corresponding to each module according to the module type of each module, and perform parallel recovery on the backup file of the corresponding module through the recovery thread.
[0088] In an embodiment of the present application, if the module type of the module is a system application, determine the recovery thread of the module as the recovery thread of the system application; if the module type of the module is a third-party application, determine the recovery thread of the module as the recovery thread of the third-party application; if the module type of the module is a multimedia file, determine the recovery thread of the module as the recovery thread of the multimedia file. In an embodiment of the present application, the recovery thread of the system application, the recovery thread of the third-party application, and the process of the multimedia file can be pre-established threads, or can be newly created threads according to the module type after receiving the backup file of the corresponding module type.
[0089] In an embodiment of the present application, the parallel restoration of the backup files of the corresponding modules by the restoration threads includes: if the module is a system application, using the restoration thread of the system application to sequentially restore the backup files of the system application; if the module is a third-party application, using the restoration thread of the third-party application to sequentially restore the backup files of the third-party application; if the module is a multimedia file, using the restoration thread of the multimedia file to sequentially restore the backup files of the multimedia file.
[0090] In an embodiment of the present application, using the restoration thread of the system application to sequentially restore the backup files of the system application includes: if the backup file of the system application is a compressed file of a picture, the data import management module decompresses the compressed file of the picture to the target storage directory through the restoration thread of the system application, where the target storage directory is the storage address of the pictures of the system application stored in the first terminal. In another embodiment of the present application, if the backup file of the system application is a contact database, the data import management module of the second terminal calls the local interface to insert the contact information of the contact database into the local database.
[0091] In an embodiment of the present application, the restoration thread of the third-party application may include a first restoration thread and a second restoration thread. In an embodiment of the present application, using the restoration thread of the third-party application to sequentially restore the backup files of the third-party application includes: sequentially installing the installation packages of each third-party application through the first restoration thread, and after the installation of each third-party application installation package is completed, parallelly restoring the application data of each third-party application through the second restoration thread. In an embodiment of the present application, restoring the application data of the third-party application through the second restoration thread includes: parallelly decompressing the application data of each third-party application through the second restoration thread. The second restoration thread calls the Backup Management Service (BMS) function to restore the application data of each third-party application and stores the application data of each third-party application in the storage path corresponding to the third-party application. In an embodiment of the present application, the first restoration thread of the third-party application is a single thread, and the second restoration thread of the third-party application is a multi-thread. In an embodiment of the present application, the number of the second restoration threads of the third-party application may be four.
[0092] In the above technical solution, the second terminal uses the corresponding restoration threads for parallel data restoration of different types of modules, so that the CPU system resources of the second terminal can be maximally utilized, and the efficient migration of data from the first terminal to the second terminal can be realized.
[0093] Reference Figure 8As shown in the figure, it is a schematic diagram of parallel processing for the transmission and recovery of third-party applications in an embodiment of the present application. In an embodiment of the present application, after the installation packages and application data of all third-party applications are transmitted, the data import management module processes the installation of the installation packages of third-party applications and the recovery of application data through the first recovery thread in the recovery thread of the third-party applications. In this way, as long as the installation package of a third-party application is transmitted, it can be installed through the first recovery thread. After the installation package of the third-party application is installed, if the application data of the third-party application has also been transmitted, the application data of the third-party application can be recovered in parallel through the second recovery thread; while the application data of the third-party application is being recovered, the installation package of the next third-party application after this third-party application can be installed in parallel through the first recovery thread. For example, after the installation package of third-party application A is transmitted, the installation of the installation package of third-party application A can be carried out. After the installation package of third-party application A is installed, if the application data of third-party application A has also been transmitted, the application data of third-party application A can be recovered in parallel through the second recovery thread. While the application data of third-party application A is being recovered, the installation package of the next third-party application B after third-party application A can be installed in parallel through the first recovery thread. After the installation package of third-party application B is installed and the application data of third-party application B has also been transmitted, the application data of third-party application B can be recovered in parallel through the second recovery thread. While the application data of third-party application B is being recovered, the installation package of the next third-party application C after third-party application B can be installed in parallel through the first recovery thread.
[0094] In an embodiment of the present application, using the recovery thread of the multimedia file to sequentially recover the backup files of the multimedia file includes: sequentially obtaining the data and the specified storage location of each multimedia file through the thread of the multimedia file, and storing the data of each multimedia file in the specified storage location of the corresponding multimedia file in the second terminal.
[0095] In the above embodiment, since the data of the multimedia file has no compression process during the transmission process, there is no need to decompress the data of the multimedia file when recovering the multimedia file. Therefore, the backup and transmission tasks of the multimedia file are all executed after the backup and transmission tasks of the system application and the third-party application, which can give priority to ensuring the priority transmission and recovery of the data of the system application and the third-party application.
[0096] In an embodiment of the present application, the method further includes: after all multimedia files are restored, notifying the system multimedia of the second terminal to perform a multimedia scan. Through the multimedia scan, the pictures of all multimedia files are added to the album application of the second terminal, so that other applications of the second terminal can normally access the pictures of all multimedia files. In the above embodiment, after all multimedia files are restored, only one multimedia scan is required to enable other applications of the second terminal to access the picture content of all multimedia files. Compared with the existing solution of performing a multimedia scan after the restoration of one multimedia file, the power consumption of the multimedia scan can be reduced.
[0097] In the above embodiment, in the restoration stage of data migration, the restoration of third-party applications is performed through the established restoration threads, and the restoration of system applications and multimedia files is processed in parallel. In this way, the efficiency of data migration is improved. In order to ensure the degree of parallelism during the data restoration of third-party applications, system applications, and multimedia files, in the first terminal, alternating backups are performed according to different module types during data backup, so as to ensure that the restoration threads of each different module type on the second terminal side can perform parallel restoration work at full load.
[0098] The following combines Figure 9 , and specifically describes the specific implementation steps of the above data migration method. Refer to Figure 9 , the data import management module of the second terminal receives the module supporting data migration sent by the first terminal. The data import management module generates a list of files to be received including all modules, and generates a list of modules to be restored. The initial value of the list of modules to be restored is empty. The data import management module receives the backup file of one module sent by the first terminal. When the reception of the backup file of this module is completed, the backup file of this module is added to the list of modules to be restored, and this module is deleted from the list of files to be received to update the list of files to be received. The data import management module determines whether all modules in the list of files to be received have been completed. If completed, it is determined that the reception task of the backup files of all modules is completed; if not completed, it continues to receive the backup file of the next module sent by the first terminal.
[0099] The data import management module adds the backup files of the modules to the corresponding threads or thread pools according to the module type, and restores the backup files through the threads or thread pools. Specifically, the data import management module pre-establishes the recovery threads and recovery queues for third-party applications, system applications, and multimedia files according to the module type, adds the backup files of the modules in the module list to be restored to the recovery queue corresponding to the module type in sequence, and restores the backup files in the corresponding recovery queue through the recovery thread corresponding to the module type. For example, if the module type of the backup file in the module list to be restored is a third-party application, the backup file in the module list to be restored is added to the recovery queue of the third-party application, and the backup file in the recovery queue of the third-party application is restored through the recovery thread of the third-party application; if the module type of the backup file in the module list to be restored is a system application, the backup file in the module list to be restored is added to the recovery queue of the system application, and the backup file in the recovery queue of the system application is restored through the recovery thread of the system application; if the module type of the backup file in the module list to be restored is a multimedia file, the backup file in the module list to be restored is added to the recovery queue of the multimedia file, and the backup file in the recovery queue of the multimedia file is restored through the recovery thread of the multimedia file.
[0100] In an embodiment of the present application, if it is determined that the backup file belongs to a system application, the backup file is restored through the recovery thread of the system application. When restoring the backup file of the system application through the recovery thread of the system application, it is judged whether there are other backup files of the system application being restored. If there are other backup files of the system application being restored, wait for the completion of the task of restoring the other backup files of the system application. If there are no other backup files of the system application being restored, the recovery thread of the system application restores the backup file of the system application. For example, the system application restores the backup file of the system application by decoupling the functions and interfaces of the module. After the recovery thread of the system application completes the restoration of the backup file of the system application, the system application is deleted from the module list to be restored. In an embodiment of the present application, the recovery thread of the system application is a single thread.
[0101] In an embodiment of the present application, when it is determined that the backup file belongs to a third-party application, the backup file is restored through the restoration thread of the third-party application. The restoration thread of the third-party application includes a first restoration thread and a second restoration thread, where the first restoration thread is a single thread and the second restoration thread is a multi-threaded process. When restoring the backup file of the third-party application through the restoration thread of the third-party application, it is determined whether there is an installation package of another third-party application being installed. If there is an installation package of another third-party application being installed, wait for the installation package of the other third-party application to be completed. If there is no installation package of another third-party application being installed, install the installation package of the third-party application through the first restoration thread. After the installation package of the third-party application is completed and the application data transmission of the third-party application is completed, the application data of the third-party application is restored in parallel through one of the multiple second restoration threads. For example, the application data of the third-party application is decompressed through one of the multiple second restoration threads, the BMS function is called to restore the application data of the third-party application, and the application data of the third-party application is stored in the storage path of the third-party application. After the restoration thread of the third-party application completes the restoration of the backup file of the third-party application, the third-party application is deleted from the list of modules to be restored.
[0102] In an embodiment of the present application, when it is determined that the backup file belongs to a multimedia file, the backup file is restored through the restoration thread of the multimedia file. The restoration thread of the multimedia file is a single thread. When restoring the backup file of the multimedia file through the restoration thread of the multimedia file, it is determined whether there is a backup file of another multimedia file being restored. If there is a backup file of another multimedia file being restored, wait for the completion of the restoration task of the backup file of the other multimedia file. If there is no backup file of another multimedia file being restored, the data of the multimedia file is directly stored in the specified storage location of the second terminal through the restoration thread of the multimedia file. After the restoration thread of the multimedia file completes the restoration of the backup file of the multimedia file, the multimedia file is deleted from the list of modules to be restored.
[0103] The data import management module determines whether the value of the list of modules to be restored is empty. If the value is not empty, the next backup file in the list of modules to be restored is added to the restoration queue corresponding to the module type according to the module type, and the backup file in the restoration queue corresponding to the module type is restored through the restoration thread corresponding to the module type. If the value is empty, it is determined that the restoration task of the backup file is completed. In an embodiment of the present application, after it is determined that the restoration task of the backup file is completed, the report page is automatically entered to display the detailed information of this data migration. The detailed information may include the data size of all migrated modules, the time taken for data migration, and the successful or failed modules for data migration.
[0104] In the data migration method in the above embodiments, by classifying different modules on the first terminal side, reasonably adjusting the backup, transmission order, and transmission method of data of different modules, and performing parallel data recovery on different types of modules using recovery threads on the second terminal side, the system resources such as the CPU are maximally utilized, and efficient migration of data from the first terminal to the second terminal is achieved.
[0105] Reference Figure 10 As shown, it is a flowchart of a method for migrating data of a multimedia file in an embodiment of the present application. The method includes the following steps.
[0106] Step S1001, the first UI process of the first terminal sends a first initialization instruction to the file transfer protocol (FTP) client. Step S1002, the FTP client performs communication initialization according to the first initialization instruction.
[0107] The first terminal after communication initialization is used to establish a communication connection with the second terminal.
[0108] Step S1003, the second UI process of the second terminal sends a second initialization instruction to the file transfer protocol (FTP) server.
[0109] Step S1004, the FTP server performs communication initialization according to the second initialization instruction.
[0110] The second terminal after communication initialization is used to establish a communication connection with the first terminal.
[0111] Step S1005, the FTP client after communication initialization establishes a communication connection with the FTP server.
[0112] In an embodiment of the present application, the FTP client after communication initialization establishing a communication connection with the FTP server includes: the FTP client after communication initialization establishing a Wi-Fi communication connection with the FTP server.
[0113] Step S1006, the first UI process obtains the remaining storage space of the second terminal and the remaining storage space of the first terminal.
[0114] Step S1007, if the remaining storage space of the first terminal and the remaining storage space of the second terminal meet the storage space required for data migration, the first UI process sends a query request to the first system media library (Media Provider, MP) of the first terminal.
[0115] Step S1008, the first system media library responds to the query request, and returns the multimedia file and the specified storage path of the multimedia file to the first UI process.
[0116] Step S1009, the first UI process sets the multimedia list of the multimedia files of the second terminal, and the storage path of each multimedia file in the multimedia list.
[0117] Step S1010, the first UI process directly sends each multimedia file in the multimedia list and the storage path of each multimedia file to the transport protocol client by calling an interface.
[0118] Step S1011, the transport protocol client forwards each multimedia file in the multimedia list and the storage path of each multimedia file to the transport protocol server.
[0119] Step S1012, the transport protocol client notifies the first UI process of the sending result.
[0120] Step S1013, the transport protocol server stores each multimedia file in the corresponding storage path according to the storage path of each multimedia file.
[0121] Step S1014, the transport protocol server sends the notification of receiving the multimedia file to the second UI process.
[0122] Step S1015, the first UI process sends the notification that all multimedia files have been sent to the second UI process.
[0123] Step S1016, the second UI process notifies the second system media library of the second terminal to perform a multimedia scan.
[0124] In an embodiment of the present application, after the system multimedia of the second terminal performs a multimedia scan, the pictures of the multimedia files can be added to the album application of the second terminal, so that other applications of the second terminal can normally access the pictures of the multimedia files.
[0125] Next, the terminal device 100 involved in the embodiment of the present application will be introduced.
[0126] Refer to Figure 11 As shown, it is a schematic diagram of the hardware structure of the terminal device 100 provided by an embodiment of the present application. The terminal device 100 may include a processor 110, an internal memory 130, an external memory interface 120, a display screen 140, and a sensor module 150. The sensor module 150 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0127] It can be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal device 100. In some other embodiments of the present application, the terminal device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0128] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0129] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0130] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0131] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0132] It can be understood that the interface connection relationships among the modules illustrated in the embodiments of the present invention are only illustrative descriptions and do not constitute a structural limitation on the terminal device 100. In some other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0133] The terminal device 100 implements the display function through the GPU, the display screen 140, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0134] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include one or N display screens 140, where N is a positive integer greater than 1.
[0135] The internal memory 130 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally referred to as DDR5 SDRAM), etc. The non-volatile memory may include disk storage devices, flash memory. Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle, and can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the number of potential levels of the storage unit, and can be divided into universal flash storage (UFS), embedded multi media Card (eMMC), etc. according to the storage specification.
[0136] The random access memory can be directly read and written by the processor 110, and can be used to store the operating system or executable programs (such as machine instructions) of other running programs, and can also be used to store user and application data, etc.
[0137] The non-volatile memory can also store executable programs and store user and application data, etc., and can be pre-loaded into the random access memory for direct reading and writing by the processor 110.
[0138] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external non-volatile memory.
[0139] The internal memory 130 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include a plurality of instructions. When the plurality of instructions are executed by the processor 110, the data migration method executed on the terminal device 100 in the above embodiments can be implemented to realize the data migration function of the terminal device 100.
[0140] This embodiment also provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the above related steps to implement the data migration method in the above embodiments.
[0141] In addition, some embodiments of the present application also provide a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory so that the chip executes the data migration method in each of the above method embodiments.
[0142] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0143] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0144] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0145] The unit described as a separate component may or may not be physically separated. The component shown as a unit may be a single physical unit or multiple physical units, that is, it may be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0146] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solutions of some embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0147] The above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the above preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A data migration method, applied to a first terminal, characterized in that, The method includes: Determine the modules that support data migration and obtain the data corresponding to each determined module, and generate a list of modules to be backed up based on all the determined modules; Classify all the modules in the list of modules to be backed up into third-party applications, system applications, and multimedia files according to the module type; Sort the system applications and the third-party applications in the list of modules to be backed up in an alternating order, and sort all the multimedia files in the list of backup modules in the subsequent positions in the list of modules to be backed up; Back up the data of each module in the list of modules to be backed up in the sorting order, and transfer the backup file obtained after a module is backed up to a second terminal.
2. The data migration method according to claim 1, wherein The backing up the data of each module in the list of modules to be backed up in the sorting order includes: If the module is a system application and the data corresponding to the module is a picture, pack the picture into a compressed file, and use the compressed file of the picture as the backup file of the module; If the type of the module is a system application and the data corresponding to the module is contacts, generate a contacts database including the contacts, and use the contacts database as the backup file of the module.
3. The data migration method according to claim 1, wherein The backing up the data of each module in the list of modules to be backed up in the sorting order includes: If the module is a third-party application, obtain the path of the installation package of the third-party application; Obtain the application data of the third-party application, compress the application data to obtain a compressed package of the application data, and use the path of the installation package and the compressed package of the application data as the backup file of the module.
4. The data migration method according to claim 1, wherein The backing up the data of each module in the list of modules to be backed up in the sorting order includes: If the module is a multimedia file, obtain the data of the multimedia file, set a specified storage location of the data of the multimedia file on the second terminal, and use the data of the multimedia file and the specified storage location as the backup file of the module.
5. The data migration method according to claim 1, wherein The backing up the data of each module in the list of modules to be backed up in the sorting order includes: If the data backup of the module is completed, input the backup file of the module into the transmission queue, and update the list of modules to be backed up by deleting the module from the list of modules to be backed up; If there are remaining modules in the list of modules to be backed up that have not been backed up, the data backup management module of the first terminal backs up the data of the remaining modules in the list of modules to be backed up in the sorting order; If all the modules in the list of modules to be backed up have been backed up, determine that the backup task is completed.
6. The data migration method according to claim 5, wherein The transferring the backup file obtained after a module is backed up to a second terminal includes: Generate a list of backup files to be uploaded according to the backup files of the modules in the transmission queue, and sequentially transfer the backup files in the transmission queue to the second terminal; If the backup file transmission of a module is completed, update the list of backup files to be uploaded by deleting the backup files that have completed transmission from the list of backup files to be uploaded; If there are remaining backup files in the list of backup files to be uploaded that have not been transmitted, transmit the remaining backup files in the list of backup files to be uploaded; If all the backup files in the list of backup files to be uploaded have been transmitted, determine that the transmission task of the backup files is completed.
7. The data migration method according to claim 1, wherein Based on all the determined modules, generate a list of modules to be backed up, including: If the module is in the preset blacklist, delete the module from the list of modules to be backed up.
8. A data migration method, applied to a second terminal, characterized in that, The method includes: Receiving the backup files of each module sent by the first terminal; Determining the recovery thread corresponding to each module according to the module type of each module, and performing parallel recovery on the backup files of the corresponding module through the recovery thread.
9. The data migration method according to claim 8, wherein The performing parallel recovery on the backup files of the corresponding module through the recovery thread includes: If the module is a system application, use the recovery thread of the system application to sequentially recover the backup files of the system application; If the module is a third-party application, use the recovery thread of the third-party application to sequentially recover the backup files of the third-party application; If the module is a multimedia file, use the recovery thread of the multimedia file to sequentially recover the backup files of the multimedia file.
10. The data migration method according to claim 9, characterized in that The using the recovery thread of the system application to sequentially recover the backup files of the system application includes: If the backup file of the system application is a compressed file of a picture, unzip the compressed file of the picture to the target storage directory through the recovery thread of the system application, and the target storage directory is the storage address where the first terminal stores the pictures of the system application.
11. The data migration method according to claim 9, wherein The using the recovery thread of the third-party application to sequentially recover the backup files of the third-party application includes: Sequentially install the installation packages of each third-party application through the first recovery thread of the third-party application. After the installation of each third-party application installation package is completed, perform parallel recovery on the application data of each third-party application through the second recovery thread of the third-party application.
12. The data migration method according to claim 11, wherein The performing parallel recovery on the application data of each third-party application through the second recovery thread of the third-party application includes: The second recovery thread calls the backup management service function of the second terminal to parallelly recover the data of each third-party application, and stores the data of each third-party application in the corresponding storage path.
13. The data migration method according to claim 9, wherein The using the recovery thread of the multimedia file to sequentially recover the backup files of the multimedia file includes: Sequentially obtain the data and specified storage location of each multimedia file through the thread of the multimedia file, and store the data of each multimedia file in the corresponding specified storage location in the second terminal.
14. The data migration method according to claim 13, wherein The method further includes: After all the multimedia files are recovered, notify the system multimedia of the second terminal to perform multimedia scanning; By performing a multimedia scan, the pictures of all multimedia files are added to the album application of the second terminal, enabling the applications of the second terminal to access the pictures of all multimedia files.
15. A terminal device, characterized in that, The terminal device includes a memory and a processor: The memory is used for storing program instructions; The processor is used for reading and executing the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the data migration method according to any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions. When the program instructions run on a terminal device, the terminal device executes the data migration method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Data migration method and terminal equipment
CN106658753A
Data migration method and electronic equipment
CN116089358A
Data migration method and related devices
WO2018049901A1