CN115080505B - Data migration method, terminal, storage medium, and program product - Google Patents

Data migration method, terminal, storage medium, and program product Download PDF

Info

Publication number
CN115080505B
CN115080505B CN202111048320.0A CN202111048320A CN115080505B CN 115080505 B CN115080505 B CN 115080505B CN 202111048320 A CN202111048320 A CN 202111048320A CN 115080505 B CN115080505 B CN 115080505B
Authority
CN
China
Prior art keywords
file
migrated
terminal
target path
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111048320.0A
Other languages
Chinese (zh)
Other versions
CN115080505A (en
Inventor
毛成琨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111048320.0A priority Critical patent/CN115080505B/en
Publication of CN115080505A publication Critical patent/CN115080505A/en
Application granted granted Critical
Publication of CN115080505B publication Critical patent/CN115080505B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a data migration method, a terminal, a storage medium and a program product, wherein the method comprises the following steps: receiving a target path sent by a second terminal, wherein the target path indicates a final storage position of a file to be migrated in the second terminal; generating a file path mapping relation according to the target path and the file information to be migrated, wherein the file path mapping relation comprises the corresponding relation between the target path and the file information to be migrated; and transmitting migration data to the second terminal, wherein the data structure of the migration data comprises a destination address field and a user data field, the user data field is used for bearing a file to be migrated, and the destination address field is used for bearing a target path corresponding to the file to be migrated. In the embodiment of the application, when the first terminal sends the migration data to the second terminal, the destination address of the migration data can be dynamically adjusted, so that the file to be migrated is directly stored in the corresponding destination address, secondary write operation in the second terminal is avoided, and system overhead is saved.

Description

Data migration method, terminal, storage medium, and program product
Technical Field
The present application relates to the field of computer technology, and in particular, to a data migration method, a terminal, a storage medium, and a program product.
Background
With the development of terminal technology, the terminal such as mobile phones and tablet computers is updated more and more rapidly. In the process of replacing the terminal, the user does not want all the data on the original old terminal to disappear along with the replacement of the terminal, and hopes that part or all of the data originally stored on the old terminal is continuously and normally used on the new terminal, so that a plurality of terminal suppliers and application markets provide related functions such as data backup, data migration and the like at present, namely, the user can copy the data, software, settings and the like on the old terminal to the new terminal in an intact manner, and convenience is provided for the user in the process of replacing the terminal.
One data migration scheme in the related art is to store the files to be migrated on the old terminal in a temporary folder on the new terminal, and then move the files to be migrated in the temporary folder to the corresponding target path.
However, the scheme needs to perform two writing operations on the file to be migrated, so that the speed of data migration is reduced, and the system overhead is increased.
Disclosure of Invention
In view of this, the present application provides a data migration method, a terminal, a storage medium, and a program product, so as to solve the problem in the prior art that two write operations need to be performed on a file to be migrated, and increase system overhead.
In a first aspect, an embodiment of the present application provides a data migration method, which is applied to a first terminal, where the method includes:
receiving a target path sent by a second terminal, wherein the target path indicates a final storage position of a file to be migrated in the second terminal;
generating a file path mapping relation according to the target path and file information to be migrated, wherein the file path mapping relation comprises a corresponding relation between the target path and the file information to be migrated, and the file information to be migrated corresponds to the file to be migrated;
and transmitting migration data to the second terminal, wherein the data structure of the migration data comprises a destination address field and a user data field, the user data field is used for bearing the file to be migrated, and the destination address field is used for bearing a target path corresponding to the file to be migrated.
Preferably, the receiving the target path sent by the second terminal includes: m target paths sent by a second terminal are received, wherein the M target paths are the final storage positions of N files to be migrated in the second terminal, M is more than or equal to 2, and N is more than or equal to 2;
the generating a file path mapping relation according to the target path and the file information to be migrated includes: generating a file path mapping relation according to the M target paths and the N file information to be migrated, wherein the file path mapping relation comprises the corresponding relation between the M target paths and the N file information to be migrated;
The sending migration data to the second terminal includes: and sending migration data corresponding to each file to be migrated to the second terminal.
Preferably, before the receiving the target path sent by the second terminal, the method further includes:
sending file description information to be migrated to the second terminal,
the file description information to be migrated comprises size information, type information and/or source path information of the file to be migrated.
Preferably, the target path is allocated according to size information, type information and/or source path information of the file to be migrated.
Preferably, the method further comprises:
packaging two or more files to be migrated, which are smaller than or equal to a preset size threshold, and generating file packages corresponding to the two or more files to be migrated;
the sending migration data to the second terminal includes: and transmitting migration data corresponding to the file package to the second terminal, wherein a user data field of the migration data is used for bearing the file package, and a destination address field of the migration data is used for bearing a temporary path corresponding to the file package.
Preferably, the file to be migrated includes application data corresponding to an application program file, and the target path includes a target path corresponding to the application data;
Before the receiving the target path sent by the second terminal, the method further includes:
and transmitting migration data corresponding to the application program file to the second terminal, wherein a user data field of the migration data is used for bearing the application program file, and a destination address field of the migration data is used for bearing a target path or a temporary path corresponding to the application program file.
In a second aspect, an embodiment of the present application provides a data migration method, which is applied to a second terminal, where the method includes:
sending a target path to a first terminal, wherein the target path is the final storage position of a file to be migrated in the second terminal;
receiving migration data sent by the first terminal, wherein a data structure of the migration data comprises a destination address field and a user data field, the user data field is used for bearing the file to be migrated, and the destination address field is used for bearing a target path corresponding to the file to be migrated;
and storing the file to be migrated in a target path corresponding to the file to be migrated.
Preferably, the sending the target path to the first terminal includes: m target paths are sent to a first terminal, wherein the M target paths are final storage paths of N files to be migrated in the second terminal, M is more than or equal to 2, and N is more than or equal to 2;
The receiving the migration data sent by the first terminal includes: receiving migration data corresponding to each file to be migrated, which is sent by the first terminal;
the storing the file to be migrated in the target path corresponding to the file to be migrated includes: and storing each file to be migrated in a target path corresponding to each file to be migrated.
Preferably, before the sending the target path to the first terminal, the method further includes:
receiving file description information to be migrated sent by the first terminal, wherein the file description information to be migrated comprises size information, type information and/or source path information of the file to be migrated;
and determining a target path corresponding to the file to be migrated according to the file description information to be migrated.
Preferably, the determining, according to the file description information to be migrated, a target path corresponding to the file to be migrated includes:
when the file description information to be migrated comprises size information of the file to be migrated, distributing a target path for the file to be migrated according to the size information, wherein a storage space corresponding to the target path is larger than or equal to the size of the file to be migrated;
When the file description information to be migrated comprises type information of the file to be migrated, distributing a target path matched with the type information for the file to be migrated;
when the file description information to be migrated comprises a source path of the file to be migrated, distributing a target path which is the same as the source path for the file to be migrated.
Preferably, the method further comprises:
receiving migration data corresponding to a file packet sent by the first terminal, wherein a user data field of the migration data is used for bearing the file packet, and a destination address field of the migration data is used for bearing a temporary path corresponding to the file packet;
storing the file package in a temporary path corresponding to the file package;
the file package comprises two or more files to be migrated, wherein the files are smaller than or equal to a preset size threshold.
Preferably, the file to be migrated includes application data corresponding to an application program file, and the target path includes a target path corresponding to the application data;
before the sending the target path to the first terminal, the method further comprises:
receiving migration data corresponding to the application program file sent by the second terminal, wherein a user data field of the migration data is used for bearing the application program file, and a destination address field of the migration data is used for bearing a target path or a temporary path corresponding to the application program file;
Installing the application program file;
and determining a target path corresponding to the application data according to the installation directory of the application program file.
In a third aspect, an embodiment of the present application provides a first terminal, including:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the first terminal, cause the first terminal to perform the method of any of the first aspects.
In a fourth aspect, an embodiment of the present application provides a second terminal, including:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the second terminal, cause the second terminal to perform the method of any of the second aspects.
In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where when the program runs, the program controls a device in which the computer readable storage medium is located to execute the method of any one of the first aspects.
In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where the program when executed controls a device in which the computer readable storage medium is located to perform the method of any one of the second aspects.
In a seventh aspect, embodiments of the present application provide a computer program product comprising executable instructions which, when executed on a computer, cause the computer to perform the method of any one of the first aspects.
In an eighth aspect, embodiments of the present application provide a computer program product comprising executable instructions which, when executed on a computer, cause the computer to perform the method of any one of the second aspects.
In the embodiment of the application, when the first terminal sends the migration data to the second terminal, the destination address of the migration data can be dynamically adjusted, so that the file to be migrated is directly stored in the corresponding destination address, secondary write operation in the second terminal is avoided, and system overhead is saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a data migration scheme in the related art;
fig. 3 is a schematic flow chart of a data migration method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a mapping relationship of file paths according to an embodiment of the present application;
FIG. 5 is a schematic diagram of another mapping relationship of file paths according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a data structure of migration data according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a data migration scenario provided in an embodiment of the present application;
FIG. 8 is a flowchart illustrating another data migration method according to an embodiment of the present disclosure;
FIG. 9 is a flowchart illustrating another data migration method according to an embodiment of the present disclosure;
FIG. 10 is a flowchart illustrating another data migration method according to an embodiment of the present disclosure;
fig. 11 is a software structural block diagram of an electronic device according to an embodiment of the present application;
FIG. 12 is a flowchart illustrating another data migration method according to an embodiment of the present disclosure;
FIG. 13 is a schematic diagram of a file selection and receiving interface according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
For a better understanding of the technical solutions of the present application, embodiments of the present application are described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one way of describing an association of associated objects, meaning that there may be three relationships, e.g., a and/or b, which may represent: the first and second cases exist separately, and the first and second cases exist separately. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Referring to fig. 1, a schematic application scenario is provided in an embodiment of the present application. In fig. 1 two terminal devices, a new handset and an old handset, are shown. The old mobile phone can be understood as a mobile phone used by a user in daily life, and the new mobile phone can be understood as a mobile phone purchased by the user newly. The old mobile phone stores more user data, and the user needs to transfer all or part of the user data in the old mobile phone to the new mobile phone so as to facilitate the use of the new mobile phone by the user, namely, the old mobile phone transfers the data to the new mobile phone.
It should be noted that, fig. 1 illustrates a mobile phone as an example, and should not be taken as a limitation of the protection scope of the present application. In addition to the mobile phone, the terminal may be a tablet computer, a personal computer (personal computer, PC), a personal digital assistant (personal digital assistant, PDA), a smart watch, a netbook, a wearable electronic device, an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, a vehicle-mounted device, a smart car, a smart sound, a robot, smart glasses, a smart television, or the like.
In addition, the old and new devices performing data migration may be the same type of terminal device, or may be different types of terminal devices, which is not specifically limited in the embodiment of the present application.
Referring to fig. 2, a schematic diagram of a data migration scheme in the related art is shown. In fig. 2, two terminal devices of a new mobile phone and an old mobile phone are shown, and a user needs to migrate a file to be migrated in the old mobile phone to the new mobile phone. Firstly, storing files to be migrated on an old mobile phone in a temporary folder on a new mobile phone, and then moving the files to be migrated in the temporary folder to a corresponding target path to realize data migration. The temporary folder is a temporary storage position of the file to be migrated in the new mobile phone, and the target path is a final storage position of the file to be migrated in the new mobile phone. Different files to be migrated may have different target paths, for example, the target paths corresponding to video files, document files, and picture files are different.
However, in the data migration scheme shown in fig. 2, two write operations are required for the file to be migrated. Specifically, a write operation is carried out in the process of storing the file to be migrated in the temporary folder; and performing write operation once in the process of moving the file to be migrated from the temporary folder to the target path. This process increases overhead, such as taking up more data processing resources, outputting storage resources, and extending data migration time.
Based on the problem, the embodiment of the application provides a data migration method, a terminal, a storage medium and a program product, which are beneficial to solving the problem that in the prior art, two write operations are needed to be performed on files to be migrated, and the system overhead is increased.
Referring to fig. 3, a flow chart of a data migration method according to an embodiment of the present application is provided. The method can be applied to the application scenario shown in fig. 1. The first terminal may be understood as an old mobile phone, i.e. a data migration end or a data export end, and the second terminal may be understood as a new mobile phone, i.e. a data migration end or a data import end. As shown in fig. 3, it mainly includes the following steps.
Step S301: the second terminal transmits the target path to the first terminal.
In this embodiment of the present application, after a communication connection is established between a first terminal serving as a data migration end and a second terminal serving as a data migration end, the second terminal sends a target path to the first terminal, that is, notifies the first terminal of a storage location of a file to be migrated. It can be understood that the target path is the final storage location of the file to be migrated in the second terminal. The target path may be allocated after the second terminal receives the file description information to be migrated of the first terminal, or may be a plurality of target paths pre-designated by the second terminal system.
The files to be migrated under different types, sizes or source paths may have different target paths, for example, different types of files, such as video files, document files, and picture files, corresponding to different target paths. The second terminal may also specify a target path according to the service logic, e.g. the same type of file in the data of different applications may have different target paths. In one possible implementation manner, the second terminal sends the target path to the first terminal, which specifically includes: the second terminal sends M target paths to the first terminal, wherein M is more than or equal to 2. That is, the second terminal transmits a plurality of target paths to the first terminal to correspond to the files to be migrated under a plurality of types or source paths of the first terminal; the sent information can also contain the corresponding relation between the description information of the files to be migrated and the target paths.
It should be noted that, the second terminal may send multiple target paths to the first terminal at the same time, or may send the multiple target paths to the first terminal sequentially, which is not specifically limited in the embodiment of the present application.
Step S302: and the first terminal generates a file path mapping relation according to the target path and the file information to be migrated.
Specifically, after receiving a target path sent by a second terminal, the first terminal generates a file path mapping relation according to the target path and corresponding file information to be migrated, wherein the file path mapping relation comprises a corresponding relation between the target path and the file information to be migrated. Specifically, the second terminal may allocate a corresponding target path to the file to be migrated according to the type, size or source path of the file to be migrated, that is, establish a mapping relationship between the file to be migrated and the target path. It can be understood that the file information to be migrated corresponds to the file to be migrated, and after the corresponding relationship between the target path and the file information to be migrated is determined, the corresponding relationship between the target path and the file to be migrated can be determined. The file information to be migrated may be identification information of the file to be migrated, for example, a name, a category, etc. of the file to be migrated, which is not particularly limited in the embodiment of the present application.
In one possible implementation, the number of target paths is M, the number of files to be migrated is N, M is greater than or equal to 2, and N is greater than or equal to 2. In the application scene, a file path mapping relation is required to be generated according to M target paths and N files to be migrated, wherein the file path mapping relation comprises corresponding relations of M target paths and N file information to be migrated, namely, the corresponding relation between each target path and the files to be migrated is established.
Referring to fig. 4, a schematic diagram of a mapping relationship of a file path is provided in an embodiment of the present application. In fig. 4, 3 target paths and 3 file information to be migrated (file information to be migrated is used to match corresponding files to be migrated) are shown. As shown in fig. 4, in the file path mapping relationship, the first target path corresponds to the second file information to be migrated, that is, the second file to be migrated corresponding to the second file information to be migrated needs to be stored in the storage area corresponding to the first target path; the second target path corresponds to the information of the third file to be migrated, namely the third file to be migrated corresponding to the information of the third file to be migrated needs to be stored in a storage area corresponding to the second target path; the third target path corresponds to the first file information to be migrated, that is, the first file to be migrated corresponding to the first file information to be migrated needs to be stored in the storage area corresponding to the third target path.
It should be noted that fig. 4 is only one possible implementation listed in this application, and should not be taken as limiting the scope of protection of this application. For example, in one possible implementation, the target path and the file information to be migrated may not be in a one-to-one correspondence.
Referring to fig. 5, another schematic diagram of mapping relationships between file paths is provided in an embodiment of the present application. In fig. 4, 3 target paths and 4 file information to be migrated are shown. The second target path corresponds to the third file information to be migrated and the fourth file information to be migrated, that is, the third file to be migrated corresponding to the third file information to be migrated and the fourth file to be migrated corresponding to the fourth file information to be migrated are stored in the storage area corresponding to the second target path.
Step S303: the first terminal sends migration data to the second terminal.
Referring to fig. 6, a schematic data structure of migration data is provided in an embodiment of the present application. As shown in fig. 6, the migration data includes a destination address field and a user data field, where the user data field is used to carry a file to be migrated, such as a video file, a picture file, and/or a document file. The destination address field is used for bearing a target path corresponding to the file to be migrated. It is noted that the destination address is used to characterize the storage location in the second terminal after the user data has been transferred to the second terminal.
In the embodiment of the application, when the migration data is transmitted, the destination address field is set as the target path corresponding to the file to be migrated, and after receiving the file to be migrated, the second terminal directly stores the file to be migrated in the corresponding target path. That is, the data migration is completed only by performing one write operation, and the system performance overhead is reduced.
Specifically, when two or more files to be migrated exist, migration data corresponding to each file to be migrated is sequentially sent to the second terminal. If the bandwidth is allowed, a plurality of files to be migrated and corresponding migration data can be simultaneously sent to the second terminal.
Step S304: and the second terminal stores the file to be migrated in a target path corresponding to the file to be migrated.
Referring to fig. 7, a schematic diagram of a data migration scenario is provided in an embodiment of the present application. The data migration scene corresponds to the file path mapping relationship shown in fig. 5, and as shown in fig. 7, the first terminal sequentially sends migration data corresponding to the first file to be migrated, the second file to be migrated and the third file to be migrated to the second terminal. Specifically, in migration data corresponding to the first file to be migrated, a destination address field is set as a third target path, the migration data is sent to the second terminal, and after the second terminal receives the migration data, the first file to be migrated is stored in a storage area corresponding to the third target path according to the third target path in the destination address field. Similarly, the second files to be migrated are sequentially stored in the storage area corresponding to the first target path, and the third files to be migrated are stored in the storage area corresponding to the second target path.
In the embodiment of the application, when the first terminal sends the migration data to the second terminal, the destination address of the migration data can be dynamically adjusted, corresponding destination addresses are provided for different files to be migrated, instead of all the files being placed under a unified destination path, so that the files to be migrated are directly stored in the corresponding destination addresses, secondary write operation in the second terminal is avoided, and system overhead is saved.
In some possible implementations, the target path sent by the second terminal to the first terminal may be a path preset by the second terminal according to different file types. For example, a storage location of a picture file is preset as a first target path, a storage location of a video file as a second target path, a storage location of a document file as a third target path, and so on.
In another possible implementation, the first terminal and the second terminal may determine the target path through data negotiation prior to data migration.
Referring to fig. 8, a flow chart of another data migration method according to an embodiment of the present application is provided. As shown in fig. 8, the method further includes the following steps, prior to S301, on the basis of the embodiment shown in fig. 3.
Step S801: and the first terminal sends the file description information to be migrated to the second terminal.
In this embodiment of the present application, after the first terminal and the second terminal establish communication connection, the first terminal first sends description information of a file to be migrated, for example, size information, type information and/or source path information of the file to be migrated, to the second terminal.
The size information refers to the size of the data volume of the file to be migrated, and may be, for example, 50m,1g, etc. It can be appreciated that the storage space of the target path corresponding to the file to be migrated should be greater than or equal to the data size, so as to prevent the storage of the file to be migrated from being unable to be completed. That is, the second terminal can conveniently allocate the target path meeting the storage space requirement for the file to be migrated through the size information.
The type information refers to the type of the file to be migrated, and the same or similar target paths can be allocated to the files to be migrated of the same type. In some possible implementations, the files to be migrated may be divided into picture files, video files, and document files. It should be noted that, in different application scenarios, the classification manners of the files to be migrated are different, and the embodiment of the present application does not limit the specific types of the files to be migrated.
The source path information refers to a storage path of the file to be migrated in the first terminal. According to the method and the device for determining the target path, the first terminal sends the source path information to the second terminal, and the second terminal preferentially determines the target path according to the source path information, so that after data migration is completed, the storage position of the file to be migrated accords with the original use habit of a user as much as possible.
Step S802: and the second terminal determines a target path according to the file description information to be migrated.
After receiving the description information of the file to be migrated, the second terminal can allocate a target path meeting the requirement for the file to be migrated according to the description information of the file to be migrated, and then can send the target path and the corresponding relation between the target path and the description information of the file to be migrated to the first terminal. Because the file to be migrated is matched with the file description information to be migrated, the corresponding relation between the target path and the file to be migrated, namely the mapping relation of the file path, can be determined according to the corresponding relation between the target path and the file description information to be migrated.
In practical application, the first terminal may keep the corresponding relation between the target path sent by the second terminal and the file description information to be migrated, or modify the corresponding relation, and generate the file path mapping relation according to the mapping rule of the second terminal.
For example, the target path meets one or a combination of the following conditions:
1. when the file description information to be migrated comprises size information of the file to be migrated, a target path is allocated to the file to be migrated according to the size information, and a storage space corresponding to the target path is larger than or equal to the size of the file to be migrated.
2. And when the file description information to be migrated comprises the type information of the file to be migrated, distributing a target path matched with the type of the file to be migrated. For example, if the file to be migrated is a picture file, in the second terminal, the picture file is stored in the first target path, and then the first target path is allocated to the file to be migrated.
3. When the file description information to be migrated includes a source path of the file to be migrated, it may be prioritized that the same target path as the source path is allocated to the file to be migrated. If the second terminal does not have the same target path as the source path, other target paths are allocated to the file to be migrated.
It should be noted that, the above description information of the files to be migrated is only one possible implementation manner listed in the embodiments of the present application, and those skilled in the art may set other description information of the files to be migrated according to actual needs, which is not particularly limited in the embodiments of the present application.
By adopting the technical scheme provided by the embodiment of the application, before data migration, the first terminal and the second terminal carry out data negotiation, so that a target path which is more in line with the actual application scene can be determined.
It can be understood that by adopting the above data migration scheme, for each file to be migrated, the second terminal needs to send a target path to the first terminal, then establish a file path mapping relationship according to the target path, and then send migration data corresponding to each file to be migrated to the second terminal in turn.
However, in practical applications, there may be some files to be migrated that are relatively small, for example, the size of the files to be migrated may be only a few KB or a few MB "small files", and using the above data processing method for each "small file" obviously increases the overhead. Based on this, the embodiment of the application also provides another data migration method.
Referring to fig. 9, a flowchart of another data migration method according to an embodiment of the present application is provided. The method further comprises the following steps on the basis of the embodiment shown in fig. 3.
Step S901: the method comprises the steps that a first terminal packages two or more files to be migrated, and a file package corresponding to the two or more files to be migrated is generated.
In a specific implementation, a threshold value of a file size may be preset, two or more files to be migrated, which are smaller than or equal to the threshold value of the size, are packaged, a corresponding file package is generated, and data migration is performed in the form of the file package, where the file package may be a compressed package.
It should be noted that, for files to be migrated smaller than or equal to the size threshold, it is not necessary to configure the target path in advance in the first terminal and the file path mapping relationship, so that overhead can be saved.
Step S902: and the first terminal sends migration data corresponding to the file package to the second terminal.
Because the file package contains a plurality of files to be migrated, the file package needs to be stored in a temporary folder of the second terminal first, and then the files to be migrated in the file package are respectively moved to corresponding target paths. Specifically, a user data field carrying file package of migration data is set, a destination address field carrying file package of the migration data is set to correspond to a temporary path, the destination address can be determined by the second terminal and then sent to the first terminal, and different temporary paths can be designated for file packages of different types of files to be migrated.
Step S903: and the second terminal stores the file packet in a temporary path corresponding to the file packet.
Because the destination address in the migration data is a temporary path corresponding to the file packet, the second terminal stores the file packet in the temporary path, that is, in a folder corresponding to the temporary path after receiving the file packet.
Step S904: and the second terminal moves the files to be migrated in the file package to a target path corresponding to the files to be migrated.
After the file package is stored in the temporary folder, the second terminal can respectively move the files to be migrated in the file package to the corresponding target paths. The target path may be a path allocated by the second terminal according to the type of the file to be migrated or other information; or, path information carried in the migration data may also be used. This is not particularly limited in the embodiments of the present application.
In a specific implementation, if the file package is a compressed package, the compressed package is decompressed, and then the decompressed file to be migrated is moved to a target path corresponding to the file to be migrated.
In the embodiment of the application, the files to be migrated with smaller data quantity are packaged, data migration is performed in a file package mode, the configuration of the mapping relationship between the target path and the file path is avoided for each small file, and the system overhead can be saved.
In one possible application scenario, the file to be migrated may include an application file, and application data corresponding to the application file. The application program file may be understood as an installation package corresponding to an application program of a case in the terminal, such as a mailbox; application data may be understood as specific data generated by a user when using an application, such as mail in a mailbox.
The application data may be migrated in the manner shown in fig. 3. However, the application data is generally stored under the installation directory of the application file, so before the application data is migrated in the manner shown in fig. 3, the application file needs to be migrated first, then the application is installed in the second terminal, and further, a target path corresponding to the application data is determined.
Referring to fig. 10, a flowchart of another data migration method according to an embodiment of the present application is provided. In this implementation, the file to be migrated includes application data corresponding to the application file, and the target path includes a target path corresponding to the application data, and before step S301 shown in fig. 3, the following steps are further included.
Step S1001: and the first terminal sends migration data corresponding to the application program file to the second terminal. Before application data migration, application files are first migrated. Because the application file needs to be installed, the application file may be stored in a temporary folder, that is, a destination address field of the migration data is set as a temporary path corresponding to the application file, and in addition, a user data field of the migration data is set as the application file. Of course, the application program file may also be stored in other locations of the second terminal, which is not specifically limited in the embodiment of the present application.
Step S1002: the second terminal installs the application file.
And the second terminal installs the application program after receiving the application program file. It will be appreciated that upon completion of the installation, a corresponding installation catalog is generated.
Step S1003: and the second terminal determines a target path corresponding to the application data according to the installation directory of the application program file.
Typically, application data needs to be stored under the installation directory of the application file, i.e. the corresponding location of the installation directory. Therefore, after the installation directory of the application program file is generated, the embodiment of the application program determines the target path corresponding to the application data according to the installation directory.
In a subsequent step, the migration of application data is implemented by using the method in the embodiment shown in fig. 3.
Referring to fig. 11, a software architecture block diagram of an electronic device is provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android (Android) system is divided into four layers, namely an application layer, a framework layer, a hardware abstraction layer and a kernel layer from top to bottom.
The Application layer (App) may include a series of Application packages. For example, the application package may include a data migration application. In particular, the application layer may be further divided into an application interface (UI) and application logic. The application interface of the data migration application comprises a file selection interface and a file receiving interface, wherein in the file selection interface, a user can select a file to be migrated and trigger the file transmission operation to be migrated; and the file receiving interface can display the files to be migrated and the storage positions of the files to be migrated, which are received by the terminal, so that a user can conveniently check the data migration state. The application logic of the data migration application comprises a sending module, a receiving module, a backup service module and a file path management module, wherein the sending module and the receiving module are respectively used for sending and receiving migration data or data related to the migration data; the backup service module is used for backup management of files to be migrated; the file path management module is used for managing the target path and the file path mapping relation of the file to be migrated.
The Framework layer (FWK) provides an application programming interface (application programming interface, API) and programming Framework for the application layer's applications, including some predefined functions.
A Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry, which aims at abstracting the hardware. The hardware interface details of a specific platform are hidden, a virtual hardware platform is provided for an operating system, so that the operating system has hardware independence, and can be transplanted on various platforms.
The kernel layer is a layer between hardware and software. For example, the kernel layer contains display drivers, camera drivers, audio drivers, sensor drivers, and the like.
Referring to fig. 12, a flowchart of another data migration method according to an embodiment of the present application is provided. The method shown in fig. 12 includes a first terminal and a second terminal, where the first terminal is a data migration device, i.e. an old terminal; the second terminal is a data migration device, i.e. a new terminal. Both the first terminal and the second terminal may adopt the software structure shown in fig. 11, as shown in fig. 12, which mainly includes the following steps.
Step S1201: and the user selects the file to be migrated from the file selection interface of the first terminal.
In the embodiment of the application, the first terminal is a data migration terminal, and the user can select the file to be migrated in the file selection interface of the first terminal, and trigger a file selection instruction to be migrated.
Referring to fig. 13, a schematic diagram of a file selection and receiving interface is provided in an embodiment of the present application. As shown in 13 (a) in fig. 13, a list of a plurality of files (file 1, file 2, file 3, file 4, file 5 and file 6) is stored in the first terminal, and may be selected according to a file type, a source path, a size, or a specific file, and the user may select a file to be migrated, that is, a file to be migrated to the second terminal, from among the files stored in the first terminal. For example, the user may select file 2 as the file to be migrated by triggering the region in which file 2 is located. Of course, the user may also select multiple files as files to be migrated, for example, all files under a certain path, which is not limited in the embodiment of the present application.
Step S1202: and sending a file selection instruction to be migrated to a file path management module of the first terminal.
After the user selects the file to be migrated through the file selection interface, the file selection instruction to be migrated is sent to the file path management module. The file to be migrated selection instruction may include selected file description information to be migrated, where the file description information to be migrated may be size information, type information and/or source path information of the file to be migrated.
For example, if the file 2 in 13 (a) is selected as the file to be migrated, the file description information to be migrated in the file to be migrated selection instruction may include size information, type information and/or source path information of the file 2.
Step S1203: the file path management module of the first terminal sends a target path request instruction to the sending module.
And after receiving the file selection instruction to be migrated, the file path management module of the first terminal sends a target path request instruction to the sending module so that the sending module sends the target path request instruction to the second terminal.
The target path request instruction comprises file description information to be migrated.
Step S1204: the sending module of the first terminal sends a target path request instruction to the receiving module of the second terminal.
And after receiving the target path request instruction, the sending module of the first terminal sends the target path request instruction to the receiving module of the second terminal.
Step S1205: the receiving module of the second terminal sends a target path request instruction to the file path management module of the second terminal.
And after receiving the target path request instruction, the receiving module of the second terminal sends the target path request instruction to the file path management module of the second terminal, so that the file path management module determines a target path according to the file description information to be migrated in the target path request instruction.
Step S1206: the file path management module of the second terminal determines a target path.
After receiving the target path request instruction, the file path management module of the second terminal can determine a target path according to the file description information to be migrated in the target path request instruction.
For example, when the file description information to be migrated includes size information of the file to be migrated, a target path is allocated to the file to be migrated according to the size information, and a storage space corresponding to the target path is greater than or equal to the size of the file to be migrated.
And when the file description information to be migrated comprises the type information of the file to be migrated, distributing a target path matched with the type of the file to be migrated. For example, if the file to be migrated is a picture file, in the second terminal, the picture file is stored in the first target path, and then the first target path is allocated to the file to be migrated.
When the file description information to be migrated includes a source path of the file to be migrated, it may be preferentially considered that a target path identical to the source path is allocated to the file to be migrated at the second terminal. If the second terminal does not have the same target path as the source path, other target paths are allocated to the file to be migrated.
Step S1207: the file path management module of the second terminal sends the target path to the sending module.
The file path management module of the second terminal may send the target path to the sending module after completing the allocation of the target path, so that the sending module sends the target path to the first terminal.
It should be noted that the target path may be one or more. The method and the device can determine a plurality of target paths corresponding to the plurality of files to be migrated at the same time, and the sending information comprises the target paths corresponding to the description information of the plurality of files to be migrated.
Step S1208: the transmitting module of the second terminal transmits the target path to the receiving module of the first terminal.
And after receiving the target paths, the sending module of the second terminal sends the target paths corresponding to the plurality of file description information to be migrated to the first terminal, and specifically, sends the target paths to the receiving module of the first terminal.
Step S1209: the receiving module of the first terminal sends the target path to the file path management module.
After receiving the target paths, the receiving module of the first terminal sends the target paths corresponding to the plurality of file description information to be migrated to the file path management module so that the file path management module generates corresponding file path mapping relations according to the target paths.
Step S1210: the file path management module of the first terminal generates a file path mapping relation.
And after receiving the target path, the file path management module of the first terminal generates a file path mapping relation according to the corresponding relation between the target path and the file description information to be migrated. The file path mapping relation comprises a corresponding relation between a target path and file information to be migrated, wherein the file description information to be migrated can be file size, file type or source path, and can also be file name, identification and the like.
Step S1211: and triggering a file transmission instruction to be migrated on the file selection interface by a user.
After the file path mapping relation is generated, file transmission to be migrated can be performed. Specifically, the user may trigger a file transfer instruction to be migrated at the file selection interface.
Step S1212: and sending a file transmission instruction to a backup service module of the first terminal.
After the file selection interface triggers the file transmission instruction to be migrated, the user can send the file transmission instruction to be migrated to the backup service module.
Step S1213: the file path management module of the first terminal sends the file path mapping relation to the backup service module.
When the file to be migrated is sent, the destination address corresponding to the file to be migrated needs to be determined according to the file path mapping relation, so that the file path mapping relation needs to be sent to the backup service module.
Of course, the backup service module may also query the file path management module for the target path corresponding to the file to be migrated according to the file to be migrated, which is not limited in particular in the embodiment of the present application.
Step S1214: and the backup service module of the first terminal determines a destination address corresponding to the file to be migrated according to the file path mapping relation.
The backup service module may determine a destination address corresponding to the file to be migrated according to the file path mapping relationship, or may query the file path management module for a destination path corresponding to the file to be migrated, which is not specifically limited in the embodiment of the present application.
The destination address is a target path corresponding to the file to be migrated. For example, in the file path mapping relationship shown in fig. 4, the first target path corresponds to the second file to be migrated, and the destination address corresponding to the second file to be migrated is the first target path.
Step S1215: the transmitting module of the first terminal transmits the migration data to the receiving module of the second terminal.
In this embodiment of the present application, the data structure of the migration data includes a destination address field and a user data field, the user data field of the migration data is set as a file to be migrated, and the destination address field of the migration data is set as a target path corresponding to the file to be migrated.
Step S1216: and the receiving module of the second terminal stores the file to be migrated to a target path corresponding to the destination address.
That is, after receiving the file to be migrated, the second terminal directly stores the file to be migrated in the corresponding target path, and completes data migration only by performing write operation once, thereby reducing system performance overhead.
Step S1217: and the receiving module of the second terminal sends migration information of the file to be migrated to the file receiving interface.
In a specific implementation, after receiving the file to be migrated, the receiving module may send migration information of the file to be migrated to the receiving interface, so that a user knows a data migration state. The migration information may be information such as a file name, a file thumbnail, or a file migration progress, which have been migrated, and the embodiment of the present application is not specifically limited.
Referring to 13 (b) in fig. 13, the file receiving interface corresponds to the file selecting interface shown in 13 (a), the user selects the file 2 and the file 4 as files to be migrated in the file selecting interface shown in 13 (a), and after the migration of the file is completed, icons of the file 2 and the file 4 are displayed in the file receiving interface of the second terminal shown in 13 (b), so as to inform the user of the completed data migration state, and improve user experience.
In the embodiment of the application, when the first terminal sends the migration data to the second terminal, the destination address of the migration data can be dynamically adjusted, so that the file to be migrated is directly stored in the corresponding destination address, secondary write operation in the second terminal is avoided, and system overhead is saved.
Corresponding to the above method embodiment, the present application further provides a first terminal, where the first terminal includes one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the first terminal, cause the first terminal to perform part or all of the steps on the first terminal side in the above method embodiments.
Corresponding to the above method embodiments, the present application further provides a second terminal, which includes one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the second terminal, cause the second terminal to perform part or all of the steps on the second terminal side in the above method embodiments.
Referring to fig. 14, a schematic structural diagram of a terminal according to an embodiment of the present application is provided. The terminal may be the first terminal and/or the second terminal in the above embodiments, as shown in fig. 14, the terminal 1500 may include a processor 1510, an external memory interface 1520, an internal memory 1521, a universal serial bus (universal serial bus, USB) interface 1530, a charge management module 1540, a power management module 1541, a battery 1542, an antenna 1, an antenna 2, a mobile communication module 1550, a wireless communication module 1560, an audio module 1570, a speaker 1570A, a receiver 1570B, a microphone 1570C, an earphone interface 1570D, a sensor module 1580, keys 1590, a motor 1591, an indicator 1592, a camera 1593, a display 1594, a subscriber identity module (subscriber identification module, SIM) card interface 1595, and the like. The sensor module 1580 may include a pressure sensor 1580A, a gyroscope sensor 1580B, an air pressure sensor 1580C, a magnetic sensor 1580D, an acceleration sensor 1580E, a distance sensor 1580F, a proximity light sensor 1580G, a fingerprint sensor 1580H, a temperature sensor 1580J, a touch sensor 1580K, an ambient light sensor 1580L, a bone conduction sensor 1580M, and the like.
It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal 1500. In other embodiments of the present application, terminal 1500 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 1510 may include one or more processing units, such as: the processor 1510 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 1510 for storing instructions and data. In some embodiments, the memory in the processor 1510 is a cache memory. The memory may hold instructions or data that the processor 1510 has just used or recycled. If the processor 1510 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided, reducing the latency of the processor 1510 and thus improving the efficiency of the system.
In some embodiments, the processor 1510 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 1510 may comprise multiple sets of I2C buses. The processor 1510 may be coupled to the touch sensor 1580K, charger, flash, camera 1593, etc., respectively, through different I2C bus interfaces.
The I2S interface may be used for audio communication. In some embodiments, the processor 1510 may comprise multiple sets of I2S buses. Processor 1510 may be coupled to audio module 1570 via an I2S bus to enable communication between processor 1510 and audio module 1570.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, audio module 1570 and wireless communication module 1560 may be coupled through a PCM bus interface.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 1510 with the wireless communication module 1560.
The MIPI interface may be used to connect processor 1510 to peripheral devices such as display screen 1594, camera 1593, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 1510 and camera 1593 communicate via CSI interface to implement the photographing function of terminal 1500. The processor 1510 and the display 1594 communicate via the DSI interface to implement the display functions of the terminal 1500.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect processor 1510 with camera 1593, display 1594, wireless communication module 1560, audio module 1570, sensor module 1580, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 1530 is an interface conforming to the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 1530 may be used to connect a charger to charge the terminal 1500, or may be used to transfer data between the terminal 1500 and a peripheral device.
It should be understood that the connection between the modules illustrated in the embodiments of the present invention is merely illustrative, and does not limit the structure of the terminal 1500. In other embodiments of the present application, the terminal 1500 may also use different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 1540 is for receiving charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 1540 may receive charging inputs from a wired charger through the USB interface 1530. In some wireless charging embodiments, the charge management module 1540 may receive wireless charging input through a wireless charging coil of the terminal 1500. The charging management module 1540 may also supply power to the terminal through the power management module 1541 while charging the battery 1542.
The power management module 1541 is configured to connect the battery 1542, the charge management module 1540, and the processor 1510. The power management module 1541 receives input from the battery 1542 and/or the charge management module 1540 and provides power to the processor 1510, the internal memory 1521, the display 1594, the camera 1593, the wireless communication module 1560, and the like. The power management module 1541 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance), and other parameters.
The wireless communication function of the terminal 1500 can be implemented by an antenna 1, an antenna 2, a mobile communication module 1550, a wireless communication module 1560, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in terminal 1500 can be configured to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 1550 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal 1500. The mobile communication module 1550 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 1550 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 1550 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves to radiate through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 1550 may be provided in the processor 1510. In some embodiments, at least some of the functional modules of the mobile communication module 1550 may be provided in the same device as at least some of the modules of the processor 1510.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to speakers 1570A, receivers 1570B, etc.) or displays images or video through a display screen 1594.
The wireless communication module 1560 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to the terminal 1500. The wireless communication module 1560 may be one or more devices that integrate at least one communication processing module. The wireless communication module 1560 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 1510. The wireless communication module 1560 may also receive signals to be transmitted from the processor 1510, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation through the antenna 2.
In some embodiments, antenna 1 of terminal 1500 is coupled to mobile communication module 1550 and antenna 2 is coupled to wireless communication module 1560 so that terminal 1500 can communicate with a network and other devices through wireless communication technology. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The terminal 1500 implements display functions via a GPU, a display screen 1594, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 1594 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 1510 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 1594 is used to display images, videos, and the like. The display 1594 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, terminal 1500 may include 1 or N displays 1594, N being a positive integer greater than 1.
The terminal 1500 may implement photographing functions through an ISP, a camera 1593, a video codec, a GPU, a display screen 1594, an application processor, and the like.
The ISP is used to process the data fed back by the camera 1593. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. I
The camera 1593 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. In some embodiments, terminal 1500 may include 1 or N cameras 1593, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the terminal 1500 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The terminal 1500 may support one or more video codecs. Thus, the terminal 1500 may play or record video in multiple encoding formats, for example: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Intelligent cognition and other applications of the terminal 1500 can be achieved through the NPU,
the external memory interface 1520 may be used to connect an external memory card, such as a Micro SD card, to realize the memory capability of the extension terminal 1500. The external memory card communicates with the processor 1510 via an external memory interface 1520 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 1521 may be used to store computer-executable program code, including instructions. The internal memory 1521 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (e.g., audio data, phonebook, etc.) created during use of the terminal 1500, and the like. In addition, the internal memory 1521 may include a high-speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), or the like. The processor 1510 performs various functional applications of the terminal 1500 and data processing by executing instructions stored in the internal memory 1521 and/or instructions stored in a memory provided in the processor.
Terminal 1500 can implement audio functionality via audio module 1570, speaker 1570A, receiver 1570B, microphone 1570C, headphone interface 1570D, and application processor, among others. Such as music playing, recording, etc.
The audio module 1570 is operative to convert digital audio information into an analog audio signal output and also operative to convert an analog audio input into a digital audio signal. The audio module 1570 may also be used to encode and decode audio signals.
Speaker 1570A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. Terminal 1500 can listen to music, or to hands-free conversations, through speaker 1570A.
A receiver 1570B, also referred to as a "earpiece", is used to convert audio electrical signals into sound signals. When the terminal 1500 receives a call or voice message, the user can receive voice by placing the receiver 1570B close to the user's ear.
Microphone 1570C, also referred to as a "microphone" or "microphone", is used to convert acoustic signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 1570C through the mouth, inputting a sound signal to the microphone 1570C. Terminal 1500 can be provided with at least one microphone 1570C.
The earpiece interface 1570D is used to connect wired headphones. The earpiece interface 1570D may be a USB interface 1530 or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 1580A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 1580A may be provided in the display screen 1594. The pressure sensor 1580A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. When a force is applied to the pressure sensor 1580A, the capacitance between the electrodes changes. Terminal 1500 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 1594, the terminal 1500 detects the intensity of the touch operation according to the pressure sensor 1580A. The terminal 1500 may also calculate the location of the touch based on the detection signal of the pressure sensor 1580A.
The gyro sensor 1580B may be used to determine a motion gesture of the terminal 1500. In some embodiments, the angular velocity of the terminal 1500 about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 1580B. The gyro sensor 1580B may be used for photographing anti-shake.
The air pressure sensor 1580C is used for measuring air pressure. In some embodiments, the terminal 1500 calculates altitude, aids in positioning and navigation, from barometric pressure values measured by the barometric pressure sensor 1580C.
The magnetic sensor 1580D includes a hall sensor. The terminal 1500 may detect the opening and closing of the flip holster using the magnetic sensor 1580D.
The acceleration sensor 1580E can detect the magnitude of acceleration of the terminal 1500 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the terminal 1500 is stationary. The method can also be used for identifying the gesture of the terminal, and is applied to the applications such as horizontal and vertical screen switching, pedometers and the like.
A distance sensor 1580F for measuring distance. The terminal 1500 may measure the distance by infrared or laser. In some embodiments, the terminal 1500 may range using the distance sensor 1580F to achieve fast focus.
The proximity light sensor 1580G can include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal 1500 emits infrared light outward through the light emitting diode. The terminal 1500 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the terminal 1500.
The ambient light sensor 1580L is used to sense ambient light. The terminal 1500 may adaptively adjust the brightness of the display 1594 based on the perceived ambient light level.
The fingerprint sensor 1580H is used for capturing a fingerprint. The terminal 1500 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 1580J detects a temperature. In some embodiments, the terminal 1500 performs a temperature processing strategy using the temperature detected by the temperature sensor 1580J.
The touch sensor 1580K is also referred to as a "touch device". The touch sensor 1580K may be disposed on the display screen 1594, and the touch sensor 1580K and the display screen 1594 form a touch screen, which is also referred to as a "touch screen". The touch sensor 1580K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display 1594. In other embodiments, the touch sensor 1580K may also be disposed on a surface of the terminal 1500 at a location different from that of the display screen 1594.
The bone conduction sensor 1580M may acquire a vibration signal. In some embodiments, bone conduction sensor 1580M may acquire a vibration signal of a human vocal tract vibrating bone mass. The bone conduction sensor 1580M may also contact the pulse of the human body and receive the blood pressure pulsation signal.
Key 1590 includes a power on key, a volume key, etc. Key 1590 may be a mechanical key. Or may be a touch key. The terminal 1500 may receive key inputs, generate key signal inputs related to user settings and function control of the terminal 1500.
The motor 1591 may generate a vibration alert. The motor 1591 may be used for incoming call vibration alerting as well as for touch vibration feedback.
The indicator 1592 may be an indicator light, which may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 1595 is used to connect to a SIM card. The SIM card may be contacted and separated from the terminal 1500 by insertion into the SIM card interface 1595 or removal from the SIM card interface 1595. Terminal 1500 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 1595 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 1595 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The terminal 1500 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the terminal 1500 employs esims, i.e.: an embedded SIM card.
In a specific implementation, the application further provides a computer storage medium, where the computer storage medium may store a program, where when the program runs, the program controls a device where the computer readable storage medium is located to execute some or all of the steps in the foregoing embodiments. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (random access memory, RAM), or the like.
In a specific implementation, the embodiment of the application further provides a computer program product, where the computer program product contains executable instructions, and when the executable instructions are executed on a computer, the executable instructions cause the computer to perform some or all of the steps in the above method embodiments.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided by the present invention, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely exemplary embodiments of the present invention, and any person skilled in the art may easily conceive of changes or substitutions within the technical scope of the present invention, which should be covered by the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A data migration method, applied to a first terminal, the method comprising:
transmitting file description information to be migrated to a second terminal, wherein the file description information to be migrated comprises size information, type information and/or source path information of the file to be migrated;
receiving a target path sent by the second terminal, wherein the target path indicates a final storage position of a file to be migrated in the second terminal; the target path is distributed according to the size information, the type information and/or the source path information of the file to be migrated;
generating a file path mapping relation according to the target path and file information to be migrated, wherein the file path mapping relation comprises a corresponding relation between the target path and the file information to be migrated, and the file information to be migrated corresponds to the file to be migrated;
Transmitting migration data to the second terminal, wherein a data structure of the migration data comprises a destination address field and a user data field, the user data field is used for bearing the file to be migrated, and the destination address field is used for bearing a target path corresponding to the file to be migrated;
the receiving the target path sent by the second terminal includes: m target paths sent by a second terminal are received, wherein the M target paths are the final storage positions of N files to be migrated in the second terminal, M is more than or equal to 2, and N is more than or equal to 2;
the generating a file path mapping relation according to the target path and the file information to be migrated includes: generating a file path mapping relation according to the M target paths and the N file information to be migrated, wherein the file path mapping relation comprises the corresponding relation between the M target paths and the N file information to be migrated;
the sending migration data to the second terminal includes: transmitting migration data corresponding to each file to be migrated to the second terminal;
wherein, the liquid crystal display device comprises a liquid crystal display device,
the file to be migrated comprises application data corresponding to an application program file, and the target path comprises a target path corresponding to the application data;
Before the receiving the target path sent by the second terminal, the method further includes:
transmitting migration data corresponding to the application program file to the second terminal, wherein a user data field of the migration data is used for bearing the application program file, and a destination address field of the migration data is used for bearing a target path or a temporary path corresponding to the application program file;
wherein, the liquid crystal display device comprises a liquid crystal display device,
the target path corresponding to the application data is a target path determined according to an installation catalog of the application file after the second terminal receives migration data corresponding to the application file and installs the application file.
2. The method as recited in claim 1, further comprising:
packaging two or more files to be migrated, which are smaller than or equal to a preset size threshold, and generating file packages corresponding to the two or more files to be migrated;
the sending migration data to the second terminal includes: and transmitting migration data corresponding to the file package to the second terminal, wherein a user data field of the migration data is used for bearing the file package, and a destination address field of the migration data is used for bearing a temporary path corresponding to the file package.
3. A data migration method, applied to a second terminal, the method comprising:
receiving file description information to be migrated, which is sent by a first terminal, wherein the file description information to be migrated comprises size information, type information and/or source path information of a file to be migrated;
determining a target path corresponding to the file to be migrated according to the file description information to be migrated; the target path is distributed according to the size information, the type information and/or the source path information of the file to be migrated;
sending a target path to the first terminal, wherein the target path is the final storage position of the file to be migrated in the second terminal; the target path sent to the first terminal is used for enabling the first terminal to generate a file path mapping relation according to the target path and file information to be migrated, the file path mapping relation comprises a corresponding relation between the target path and the file information to be migrated, and the file information to be migrated corresponds to the file to be migrated;
receiving migration data sent by the first terminal, wherein a data structure of the migration data comprises a destination address field and a user data field, the user data field is used for bearing the file to be migrated, and the destination address field is used for bearing a target path corresponding to the file to be migrated;
Storing the file to be migrated in a target path corresponding to the file to be migrated;
the sending the target path to the first terminal includes: m target paths are sent to a first terminal, wherein the M target paths are final storage paths of N files to be migrated in the second terminal, M is more than or equal to 2, and N is more than or equal to 2;
the receiving the migration data sent by the first terminal includes: receiving migration data corresponding to each file to be migrated, which is sent by the first terminal;
the storing the file to be migrated in the target path corresponding to the file to be migrated includes: storing each file to be migrated in a target path corresponding to each file to be migrated;
wherein, the liquid crystal display device comprises a liquid crystal display device,
the file to be migrated comprises application data corresponding to an application program file, and the target path comprises a target path corresponding to the application data;
before the sending the target path to the first terminal, the method further includes:
receiving migration data corresponding to the application program file sent by the first terminal, wherein a user data field of the migration data is used for bearing the application program file, and a destination address field of the migration data is used for bearing a target path or a temporary path corresponding to the application program file;
Installing the application program file;
and determining a target path corresponding to the application data according to the installation directory of the application program file.
4. The method according to claim 3, wherein determining a target path corresponding to the file to be migrated according to the file description information to be migrated includes:
when the file description information to be migrated comprises size information of the file to be migrated, distributing a target path for the file to be migrated according to the size information, wherein a storage space corresponding to the target path is larger than or equal to the size of the file to be migrated;
when the file description information to be migrated comprises type information of the file to be migrated, distributing a target path matched with the type information for the file to be migrated;
when the file description information to be migrated comprises a source path of the file to be migrated, distributing a target path which is the same as the source path for the file to be migrated.
5. A method according to claim 3, further comprising:
receiving migration data corresponding to a file packet sent by the first terminal, wherein a user data field of the migration data is used for bearing the file packet, and a destination address field of the migration data is used for bearing a temporary path corresponding to the file packet;
Storing the file package in a temporary path corresponding to the file package;
the file package comprises two or more files to be migrated, wherein the files are smaller than or equal to a preset size threshold.
6. A first terminal, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the first terminal, cause the first terminal to perform the method of any of claims 1-2.
7. A second terminal, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the second terminal, cause the second terminal to perform the method of any of claims 3-5.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program, when run, controls a device in which the computer readable storage medium is located to perform the method according to any one of claims 1-2.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program, when run, controls a device in which the computer readable storage medium is located to perform the method according to any one of claims 3-5.
CN202111048320.0A 2021-09-08 2021-09-08 Data migration method, terminal, storage medium, and program product Active CN115080505B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111048320.0A CN115080505B (en) 2021-09-08 2021-09-08 Data migration method, terminal, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111048320.0A CN115080505B (en) 2021-09-08 2021-09-08 Data migration method, terminal, storage medium, and program product

Publications (2)

Publication Number Publication Date
CN115080505A CN115080505A (en) 2022-09-20
CN115080505B true CN115080505B (en) 2023-07-14

Family

ID=83245597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111048320.0A Active CN115080505B (en) 2021-09-08 2021-09-08 Data migration method, terminal, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN115080505B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116009960B (en) * 2023-02-14 2024-01-23 花瓣云科技有限公司 Target micro-service migration method, system and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201789A (en) * 2016-07-27 2016-12-07 北京金山安全软件有限公司 Data backup method and device and terminal
CN106445663A (en) * 2016-09-14 2017-02-22 广东欧珀移动通信有限公司 Application data migration method and device
CN107018189A (en) * 2017-03-31 2017-08-04 青岛海信移动通信技术股份有限公司 Migrate application data and receive the method and device of application data

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1866754A1 (en) * 2005-03-01 2007-12-19 France Telecom System and method for migrating a platform, user data, and applications from at least one server to at least one computer
US7523122B2 (en) * 2006-09-25 2009-04-21 Microsoft Corporation Automatic discovery of application settings' storage locations
US20090210871A1 (en) * 2008-02-20 2009-08-20 Zak Dechovich System and method for software application migration
US20110167039A1 (en) * 2010-01-05 2011-07-07 Microsoft Corporation Distributed throttling for mailbox data replication
WO2013044794A1 (en) * 2011-09-30 2013-04-04 北京奇虎科技有限公司 Terminal backup and recovery method
CN105491113B (en) * 2015-11-25 2019-03-12 小米科技有限责任公司 Moving method, device and terminal
CN106527979B (en) * 2016-10-19 2019-06-07 广东欧珀移动通信有限公司 Data migration method and device
CN106547486A (en) * 2016-10-20 2017-03-29 广东欧珀移动通信有限公司 A kind of data migration method and device
CN106953893A (en) * 2017-02-15 2017-07-14 北京百度网讯科技有限公司 Data Migration between cloud storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201789A (en) * 2016-07-27 2016-12-07 北京金山安全软件有限公司 Data backup method and device and terminal
CN106445663A (en) * 2016-09-14 2017-02-22 广东欧珀移动通信有限公司 Application data migration method and device
CN107018189A (en) * 2017-03-31 2017-08-04 青岛海信移动通信技术股份有限公司 Migrate application data and receive the method and device of application data

Also Published As

Publication number Publication date
CN115080505A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN111095723B (en) Wireless charging method and electronic equipment
CN113254409B (en) File sharing method, system and related equipment
WO2022095744A1 (en) Vr display control method, electronic device, and computer readable storage medium
CN112969089B (en) HTTP request transmission method and equipment
CN112684969B (en) Always displaying method and mobile device
CN112087649A (en) Equipment searching method and electronic equipment
CN113596919B (en) Data downloading method and device and terminal equipment
CN115080505B (en) Data migration method, terminal, storage medium, and program product
CN114691248B (en) Method, device, equipment and readable storage medium for displaying virtual reality interface
CN114828098B (en) Data transmission method and electronic equipment
CN114329595B (en) Application program detection method, device, storage medium and program product
CN116346982B (en) Method for processing audio, electronic device and readable storage medium
CN116048831B (en) Target signal processing method and electronic equipment
CN116048236B (en) Communication method and related device
CN116708317B (en) Data packet MTU adjustment method and device and terminal equipment
CN116684036B (en) Data processing method and related device
CN116048769B (en) Memory recycling method and device and terminal equipment
CN116095512B (en) Photographing method of terminal equipment and related device
CN114205318B (en) Head portrait display method and electronic equipment
CN116935869A (en) Audio data distribution method, electronic device and storage medium
CN117917632A (en) Display method, electronic equipment and system
CN117692693A (en) Multi-screen display method and related equipment
CN116708317A (en) Data packet MTU adjustment method and device and terminal equipment
CN116700578A (en) Layer synthesis method, electronic device and storage medium
CN116094861A (en) Method, device and system for remotely controlling electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant