Data migration method, electronic device and storage medium

During the process of data migration of electronic equipment, the new device detects and compares the content of the migrated data, and solves the problem that the storage space of the new device is occupied by the same content data, achieving savings in storage space and improving data migration efficiency.

CN116049095BActive Publication Date: 2025-03-21HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210482824.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2025-03-21
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

When the electronic device is replaced, after the data on the old device is migrated to the new device, the memory space of the new device is occupied by the data of the same content, resulting in wasted storage space.

Method used

During the data migration process, the new device detects whether there is data with the same name under the target storage path of the migrated data, and compares its contents, and if the same, only one of them will be stored to avoid duplicate storage.

Benefits of technology

Effectively reduce duplicate data storage on new devices, save storage space, and improve data migration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049095B_ABST
    Figure CN116049095B_ABST
Patent Text Reader

Abstract

The present application provides a data migration method, an electronic device and a storage medium, which relate to the field of electronic technology and can solve the problem that a first electronic device receives data migrated from a second electronic device and occupies the memory space of the first electronic device; the method comprises: after the first electronic device receives M migration data migrated from the second electronic device, if the target storage path of the first migration data in the M migration data includes target data, the first electronic device detects whether the content of the target data is the same as that of the first migration data; wherein the second data identifier of the target data is the same as the first data identifier of the first migration data; if the content of the target data is the same as that of the first migration data, the first electronic device stores one of the target data or the first migration data; if the content of the target data is different from that of the first migration data, the first electronic device stores the target data and the first migration data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a data migration method, an electronic device and a storage medium. Background Art

[0002] Nowadays, people replace electronic devices (such as computers) more and more frequently. However, after replacing electronic devices, the applications (APPs), important files, documents, and other important content used on the old devices are no longer available on the new devices. To solve this problem, data migration can be used to clone the data in the old device to the new device to achieve the purpose of changing the device. Summary of the invention

[0003] The embodiments of the present application provide a data migration method, an electronic device, and a storage medium, which can solve the problem that a first electronic device receives data migrated from a second electronic device and the memory space of the first electronic device is occupied.

[0004] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, a data migration method is provided, which is applied to a first electronic device, wherein the first electronic device is communicatively connected with a second electronic device; the method comprises: the first electronic device sends first migration information to the second electronic device; the first migration information comprises: a first data identifier of each migration data in M ​​migration data, and a target storage path of the migration data indicated by the first data identifier; the target storage path is used to indicate the storage path of the migration data on the first electronic device; M is a positive integer; the first electronic device receives M migration data sent from the second electronic device according to the first migration information; if the target storage path of the first migration data in the M migration data includes target data, the first electronic device detects whether the content of the target data is the same as that of the first migration data; wherein the second data identifier of the target data is the same as the first data identifier of the first migration data; if the content of the target data is the same as that of the first migration data, the first electronic device stores one of the target data or the first migration data; if the content of the target data is different from that of the first migration data, the first electronic device stores the target data and the first migration data.

[0006] Based on the first aspect, when the new device receives M migration data sent by the old device, in the case that the target data is included under the target storage path of the first migration data in the M migration data, since the second data identifier of the target data is the same as the first data identifier of the first migration data, the new device determines that the target storage path of the first migration data includes target data with the same first data name as the first migration data; on this basis, the new device will detect whether the contents of the target data are the same as those of the first migration data. If the contents of the target data are the same as those of the first migration data, the new device stores one of the target data or the first migration data, that is, when the contents of the target data are the same as those of the first migration data, the new device only stores one of them, thereby solving the problem in the related art that data with the same content is stored on the new device and occupies the storage space of the new device.

[0007] In a possible design of the first aspect, before the first electronic device detects whether the contents of the target data and the first migration data are the same, the method also includes: the first electronic device stores the first migration data under the target storage path of the first migration data, and updates the first data identifier of the first migration data to a third data identifier; wherein, if the contents of the target data and the first migration data are the same, the first electronic device stores one of the target data or the first migration data, including: if the contents of the target data and the first migration data are the same, the first electronic device deletes the first migration data corresponding to the third data identifier and retains the target data.

[0008] In this design, after the new device receives the M migration data sent by the old device, the new device first stores the first migration data in the target storage path corresponding to the first migration data, and then the new device detects whether the content of the target data is the same as that of the first migration data. In this way, the process of the new device detecting the content of the target data and the first migration data will not affect the storage speed of the first migration data, which is conducive to improving the effect of data migration.

[0009] In a possible design of the first aspect, the method also includes: if the target data is different from the content of the first migration data, the first electronic device issues a first prompt message; wherein the first prompt message is used to prompt the user to update the data identifier of the first migration data from the first data identifier to the third data identifier.

[0010] In this design method, when the target data is different from the content of the first migration data, the new device will issue a first prompt message. Since the first prompt message is used to prompt the user that the data identifier of the first migration data is updated from the first data identifier to the third data identifier, the new device can prompt the user which migration data has been renamed through a prompt message, thereby facilitating the user to find the migration data on the new device and improving the user experience.

[0011] In a possible design of the first aspect, if the target storage path of the first migration data includes target data, the method also includes: the first electronic device adds the second data identifier and the third data identifier as a group of messages to the queue of data to be migrated; wherein, the first electronic device detects whether the content of the target data is the same as that of the first migration data, including: the first electronic device detects, according to the first-in-first-out principle, whether the content of the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the queue of data to be migrated are the same.

[0012] In this design, when the target data is included in the target storage path of the first migration data, since the new device adds the second data identifier and the third data identifier as a group of messages to the queue of data to be migrated, and the queue of data to be migrated has a first-in-first-out principle, that is, the second data identifier and the third data identifier that enter the queue first, the new device will first detect whether the target data corresponding to the second identifier is the same as the content of the first migration data corresponding to the third data identifier, which will not affect the storage speed of the first migration data, and further improve the data migration efficiency.

[0013] In a possible design of the first aspect, detecting whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the first migration data corresponding to the third data identifier, including: the first electronic device inputs the second data identifier in a group of messages into a preset algorithm model, and outputs a first message identifier; the first electronic device inputs the third data identifier in a group of messages into a preset algorithm model, and outputs a second message identifier; when the first message identifier and the second message identifier are the same, the first electronic device determines that the contents of the target data and the first migration data are the same; when the first message identifier and the second message identifier are different, the first electronic device determines that the contents of the target data and the first migration data are different.

[0014] In a possible design of the first aspect, detecting whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the content of the first migration data corresponding to the third data identifier, including: the first electronic device runs multiple threads, and the multiple threads detect in parallel and separately whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the content of the first migration data corresponding to the third data identifier.

[0015] In this design method, the new device runs multiple threads in parallel to detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the first migration data corresponding to the third data identifier, thereby reducing the time it takes for the new device to detect the target data and the first migration data and reducing device power consumption.

[0016] In a possible design of the first aspect, the method further includes: if the target storage path of the first migration data among the multiple migration data does not include the target data, the first electronic device stores the first migration data in the target storage path of the first migration data.

[0017] In a possible design of the first aspect, before the first electronic device sends the first migration information to the second electronic device, the method also includes: the first electronic device receives the second migration information from the second electronic device; the second migration information includes a first data identifier of each migration data in N migration data, and a storage path of each migration data on the second electronic device; N is a positive integer, N≥M; the first electronic device determines the target storage path of each migration data in the M migration data according to the second migration information and a preset storage rule; the preset storage rule is used to indicate the corresponding relationship between the storage path of the migration data on the second electronic device and the storage path where the corresponding migration data will be stored on the first electronic device.

[0018] In a second aspect, an electronic device is provided, which may be a first electronic device or a second electronic device; the electronic device has the function of implementing the method described in the first aspect. The function may be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0019] In a third aspect, an electronic device is provided, which is a first electronic device; the first electronic device includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the first electronic device performs the following steps: the first electronic device sends first migration information to the second electronic device; the first migration information includes: a first data identifier of each migration data in M ​​migration data, and a target storage path of the migration data indicated by the first data identifier; the target storage path is used to indicate the path where the migration data will be stored on the first electronic device; M is a positive integer; the first electronic device receives M migration data sent from the second electronic device according to the first migration information; if the target storage path of the first migration data in the M migration data includes target data, the first electronic device detects whether the content of the target data is the same as that of the first migration data; wherein the second data identifier of the target data is the same as the first data identifier of the first migration data; if the content of the target data is the same as that of the first migration data, the first electronic device stores one of the target data or the first migration data; if the content of the target data is different from that of the first migration data, the first electronic device stores the target data and the first migration data.

[0020] In a possible design of the third aspect, before the first electronic device detects whether the target data is identical to the first migration data in content, when the computer instruction is executed by the processor, the first electronic device further performs the following steps: the first electronic device stores the first migration data under the target storage path of the first migration data, and updates the first data identifier of the first migration data to a third data identifier; wherein, if the target data is identical to the first migration data in content, the first electronic device stores one of the target data or the first migration data, including: if the target data is identical to the first migration data in content, the first electronic device deletes the first migration data corresponding to the third data identifier and retains the target data.

[0021] In a possible design of the third aspect, when the computer instructions are executed by the processor, the first electronic device also performs the following steps: if the target data is different from the content of the first migration data, the first electronic device issues a first prompt message; wherein the first prompt message is used to prompt the user to update the data identifier of the first migration data from the first data identifier to the third data identifier.

[0022] In a possible design of the third aspect, if the target storage path of the first migration data includes target data, when the computer instruction is executed by the processor, the first electronic device also performs the following steps: the first electronic device adds the second data identifier and the third data identifier as a group of messages to the queue of data to be migrated; wherein, the first electronic device detects whether the content of the target data is the same as the first migration data, including: the first electronic device detects, according to the first-in-first-out principle, whether the content of the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the queue of data to be migrated are the same.

[0023] In a possible design of the third aspect, when the computer instructions are executed by the processor, the first electronic device specifically performs the following steps: the first electronic device inputs the second data identifier in a group of messages into a preset algorithm model, and outputs a first message identifier; the first electronic device inputs the third data identifier in a group of messages into a preset algorithm model, and outputs a second message identifier; when the first message identifier and the second message identifier are the same, the first electronic device determines that the contents of the target data and the first migration data are the same; when the first message identifier and the second message identifier are different, the first electronic device determines that the contents of the target data and the first migration data are different.

[0024] In a possible design of the third aspect, when the computer instructions are executed by the processor, the first electronic device specifically performs the following steps: the first electronic device runs multiple threads, and the multiple threads parallely detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the content of the first migration data corresponding to the third data identifier.

[0025] In a possible design of the third aspect, when the computer instruction is executed by the processor, the first electronic device also performs the following steps: if the target storage path of the first migration data among multiple migration data does not include the target data, the first electronic device stores the first migration data under the target storage path of the first migration data.

[0026] In a possible design of the third aspect, before the first electronic device sends the first migration information to the second electronic device, when the computer instruction is executed by the processor, the first electronic device further performs the following steps: the first electronic device receives the second migration information from the second electronic device; the second migration information includes a first data identifier of each migration data in N migration data, and a storage path of each migration data on the second electronic device; N is a positive integer, N≥M; the first electronic device determines the target storage path of each migration data in the M migration data according to the second migration information and a preset storage rule; the preset storage rule is used to indicate the corresponding relationship between the storage path of the migration data on the second electronic device and the storage path where the corresponding migration data will be stored on the first electronic device.

[0027] In a fourth aspect, a computer-readable storage medium is provided, wherein computer instructions are stored in the computer-readable storage medium. When the computer instructions are executed on a computer, the computer can execute any of the methods described in the first aspect.

[0028] In a fifth aspect, a computer program product comprising instructions is provided, and when the instructions are executed on a computer, the computer can execute any of the methods described in the first aspect.

[0029] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the structure of a communication system provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 1 ;

[0033] Figure 4 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 2 ;

[0034] Figure 5 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 3 ;

[0035] Figure 6 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 4 ;

[0036] Figure 7 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 1 ;

[0037] Figure 8 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 5 ;

[0038] Fig. 9 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 6 ;

[0039] Fig.10 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 7 ;

[0040] Fig.11 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 2 ;

[0041] Fig.12 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 3 ;

[0042] Fig.13 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 4 ;

[0043] Fig.14 A schematic diagram of a data migration method provided in an embodiment of the present application Figure 8 ;

[0044] Fig.15 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the solutions of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work should fall within the scope of protection of this application.

[0046] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0047] Message queue: a communication method between processes or between different threads of the same process. Message queue can be used as a container to store messages during transmission. A process with write permission to the message queue can add new messages to the message queue; a process with read permission to the message queue can read messages from the message queue. Among them, the message queue has the principle of first-in-first-out, that is, the message that enters the message queue first is read (or sent) first.

[0048] Process: It is an application's running activity on a certain data set. It is the basic unit for resource allocation and scheduling in the operating system (such as the Android system). Each process occupies an address space. The application runs on the operating system in the form of one or more processes to achieve corresponding functions.

[0049] Thread: It is an entity of a process. It is a basic unit that is smaller than a process and can run independently. A thread can share all resources owned by the process with other threads belonging to the same process. A thread can create and cancel another thread, and multiple threads in the same process can execute concurrently.

[0050] Figure 1 A schematic diagram of the structure of a communication system provided in an embodiment of the present application. Figure 1 As shown, the scenario includes a first electronic device and a second electronic device; wherein the first electronic device may be, for example, a new device, and the second electronic device may be, for example, an old device. The old device and the new device may be connected to each other wirelessly or by wire. Exemplarily, the wired communication connection may be, for example, a universal serial bus (USB) connection; the wireless connection may be, for example, a wireless fidelity (Wi-Fi) connection, a Bluetooth connection, a Bluetooth mesh connection, and a peer-to-peer (P2P) connection, etc. Figure 1 For illustration, take the first electronic device and the second electronic device as notebook computers as an example.

[0051] Usually, in order to improve the user experience, the electronic device can choose to migrate all or part of the data stored on the old device to the new device in response to the user's operation, so that the user can continue to use important daily applications, files, etc. on the new device. Among them, the data stored on the old device may include, for example: videos, pictures, documents, APPs, and other device configuration data. In the related technology, when data with the same name is stored on both the new device and the old device, after the old device migrates the data to the new device, the new device will store the data and update the name of the data to the copy name. However, if the content of the data with the same name stored on the new device and the old device is also the same, then when the old device migrates the data to the new device, data with the same content will be stored on the new device, thereby occupying the storage space of the new device.

[0052] For example, data named xxx.t.txt is stored on the new device, and data named xxx.t.txt is also stored on the old device; it can be seen that the data stored on the new device has the same name as the data stored on the old device. Then, when the old device migrates the data named xxx.t.txt to the new device, the new device stores the data and updates the name of the data to xxx.t.txt(1). In this way, data named xxx.t.txt and data named xxx.t.txt(1) are stored on the new device; however, if the data named xxx.t.txt and the data named xxx.t.txt(1) have the same content, data with the same content will be stored on the new device, thereby occupying the storage space of the new device.

[0053] The embodiment of the present application provides a data migration method, which can solve the problem that data with the same content is stored on a new device and occupies the storage space of the new device. Specifically, after the old device sends multiple migration data to the new device, the new device can detect whether the data on the new device with the same name is the same as the content of the migration data; if so, the new device stores one of the two data with the same name, which is conducive to reducing the storage space of the new device.

[0054] The data migration method provided in the embodiment of the present application can be applied to Figure 1In the communication system. The first electronic device and the second electronic device shown in the communication system can be, for example, a mobile phone, a laptop computer, a tablet computer, a large-screen display device, a desktop, a laptop, a handheld computer, a vehicle-mounted device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, etc. The embodiment of the present application does not impose any special restrictions on the specific form of the electronic device.

[0055] like Figure 2 , which is a schematic diagram of the structure of an electronic device 100, and the electronic device 100 may be, for example, the first electronic device and the second electronic device described in the above embodiment. The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0056] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0057] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0058] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0059] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0060] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0061] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0062] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of an electronic device. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0063] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0064] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0065] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0066] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-OLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc.

[0067] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0068] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0069] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0070] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0071] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. In this way, the electronic device can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0072] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0073] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0074] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0075] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0076] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, audio, video and other files are stored in the external memory card.

[0077] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

[0078] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0079] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.

[0080] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of hardware and software.

[0081] The specific implementation process of the data migration method provided in the embodiment of the present application is described below in conjunction with the drawings in the specification.

[0082] In the embodiment of the present application, the old device and the new device can perform data migration through a data migration application or an application with a data migration function. It should be understood that before the old device and the new device perform data migration, the old device and the new device must first establish a communication connection, and then the old device and the new device start the data migration function to achieve data migration.

[0083] Taking the data migration application installed on the old device and the new device as an example, in some embodiments, when the old device and the new device are turned on, the old device and the new device automatically start the data migration application to start the data migration function. In other embodiments, the homepage of the computer manager application of the old device and the new device includes a data migration setting item, and the old device and the new device can start the data migration function in response to the user's operation on the data migration setting item. In some other embodiments, a data migration application is installed on the desktop of the old device and the new device, and the old device and the new device can start the data migration function in response to the user's operation on the data migration application.

[0084] Taking the homepage of the computer manager application of the old device and the new device including the data migration setting item as an example, the old device and the new device display the following information in response to the user's operation on the data migration setting item: Figure 3 The interface 201 shown in (1) includes a start control. The start control may be, for example, "migrate immediately". Then, the old device and the new device respond to the user's operation on the start control and display the following information: Figure 3 The interface 202 shown in (2) includes a first prompt message, which is used to prompt the user of the data migration user agreement. For example, the first prompt message may be: This service requires WLAN and Bluetooth to be turned on, and the WLAN channel will be occupied during the migration process, resulting in temporary inability to access the Internet. It will automatically resume after the migration is completed. Clicking "Agree" means agreeing to the above content and the data migration user agreement.

[0085] Still Figure 3 The interface 202 shown in (2) in some embodiments further includes an approval control and a cancel control. The old device and the new device start the data migration function in response to the user's operation on the approval control; the old device and the new device exit the data migration in response to the user's operation on the cancel control.

[0086] When the old device and the new device respond to the user's operation on the consent control, the old device and the new device display the following Figure 3The interface 203 shown in (3) includes a first icon and a second icon; wherein the first icon is used to indicate a new device, and the second icon is used to indicate an old device. Exemplarily, the old device selects the device as the old device as the data sender in response to the user's operation on the second icon; the new device selects the device as the new device as the data receiver in response to the user's operation on the first icon.

[0087] Still Figure 3 In the interface 203 shown in (3), in some embodiments, the interface 203 also includes a second prompt information, and the second prompt information is used to prompt the user of the installation path of the data migration application. Exemplarily, the second prompt information can be, for example: Please go to the official website: http: / / www.xxx.com to download and install the data migration application. In some embodiments, the interface 203 also includes an exit control, and the old device and the new device exit the data migration function in response to the user's operation of the exit control.

[0088] In some embodiments, the old device displays the following information in response to the user's operation on the second icon: Figure 4 Interface 204 shown in (1); the interface 204 is an interface where the old device is waiting to be discovered. Exemplarily, the old device sends a broadcast to the new device, and displays a prompt message in interface 204 that the "old device" is waiting to be discovered. In some embodiments, interface 204 also includes a third prompt message, and the third prompt message is used to prompt the user to start the data migration application on the new device. Exemplarily, the third prompt message can be, for example: start the data migration application on the new device and select "This is a new device". If the new device does not have the data migration application installed, please go to the official website: http: / / www.xxx.com to download and install the data migration application. In some embodiments, interface 204 also includes a prompt message that "the WLAN channel is occupied during the migration process and the device cannot use the network." In other embodiments, interface 204 also includes a "Cancel" control; on this basis, the old device responds to the user's operation on the "Cancel" control and the old device exits the data migration.

[0089] In some other embodiments, the new device displays the following in response to the user's operation on the first icon: Figure 4Interface 205 shown in (2); the interface 205 is an interface in which the new device is searching for the old device. Exemplarily, the new device receives the broadcast sent by the old device and displays the prompt information "Searching for device..." in interface 205. In some embodiments, interface 205 also includes a fourth prompt information, and the fourth prompt information is used to prompt the user to start the data migration application on the old device. Exemplarily, the fourth prompt information can be, for example: start the data migration application on the old device and select "This is an old device". If the old device does not have the data migration application installed, please go to the official website: http: / / www.xxx.com to download and install the data migration application. In some embodiments, interface 205 also includes a "Continue" control and a "Cancel" control. It should be noted that when the new device does not find the old device, the "Continue" control is not clickable. Among them, if the user clicks the "Cancel" control, the new device responds to the user's operation on the "Cancel" control, and the new device exits the data migration.

[0090] In some embodiments, after the new device finds the old device, the new device responds to the user's operation of the "Continue" control in the interface 205, and the old device and the new device display a connection authentication interface. If the connection authentication is successful, the old device and the new device establish a communication connection. On this basis, the old device and the new device can perform data migration.

[0091] Exemplarily, the old device and the new device can perform connection authentication by verifying the connection code. For example, the new device responds to the operation of the "Continue" control in the user interface 205, and the new device displays the following Figure 5 The interface 206 shown in (1) includes a connection verification code. Exemplarily, the connection verification code may be, for example, "078913". In some embodiments, the interface 206 also includes a prompt message such as "Please check whether the following connection code is displayed on the old device". In other embodiments, the interface 206 also includes a "Cancel" control. For example, the new device exits data migration in response to the user's operation on the "Cancel" control.

[0092] Accordingly, the old device displays as Figure 5 The interface 207 shown in (2) includes a connection verification code. Exemplarily, the connection verification code may be, for example, "078913". In some embodiments, the interface 207 also includes a prompt message such as "A new device is found to be requesting to connect to this machine, please confirm whether the following connections are consistent". In other embodiments, the interface 207 also includes a "Continue" control and a "Cancel" control; when the connection verification code on the old device is consistent with the connection verification code on the new device, if the old device responds to the user's operation on the "Continue" control, the old device establishes a communication connection with the new device; if the old device responds to the user's operation on the "Cancel" control, the old device exits data migration.

[0093] Exemplarily, the old device responds to the user's operation on the "Continue" control, and the old device and the new device display as follows: Figure 6 The interface 208 shown is an interface where the old device and the new device are connected. Figure 6 As shown, the interface 208 may include a prompt message of "Connecting" and a "Cancel" control. In some embodiments, the old device or the new device exits the data migration in response to the user's operation on the "Cancel" control.

[0094] Combining the above embodiments and Figure 3-Figure 6 In the interface shown in FIG. 1 , after the old device and the new device establish a communication connection, data migration can begin between the old device and the new device. Exemplarily, the process of data migration between the old device and the new device can be combined with Figure 7 The process diagram shown in the figure and the method described in the following embodiments are implemented. Figure 7 As shown, the process of the data migration method may include S301-S306.

[0095] S301. The old device sends migration information 1 to the new device.

[0096] The migration information 1 includes the first data identifier of each migration data in the N migration data, and the storage path of each migration data on the old device; N is a positive integer. In the embodiment of the present application, the migration information 1 may also be referred to as the second migration information. In addition, the storage path of the migration data on the old device may also be referred to as the source path.

[0097] It should be noted that the first data identifier refers to a unique identification code that can characterize the migration data. Exemplarily, the first data identifier can be, for example, a file name of the migration data.

[0098] Taking the file name of the migration data as an example, illustratively, assuming that N migration data include data a, data b and data c, the migration information sent by the old device to the new device may be as shown in the following Table 1.

[0099] Migrate data Data Identification Source Path Dataa xxx-a D\\AAA\t.txt Data b xxx-b E:\\BBB\t.txt Datac xxx-c C:\\AAA\t.txt

[0100] Table 1

[0101] In some embodiments, during the process of the old device sending the migration information to the new device, the old device displays the following information: Figure 8 The interface 209 shown includes a progress bar for the old device to send migration information 1 to the new device, and a "cancel" control. At the same time, the display screen of the new device displays a prompt interface indicating successful connection. The progress bar is used to prompt the user of the progress of the old device sending migration information 1 to the new device.

[0102] In some embodiments, the old device exits the data migration in response to the user operating a "Cancel" control.

[0103] S302: The new device determines a target storage path for each of the M migration data according to the migration information 1 and a preset storage rule.

[0104] The preset storage rule is used to indicate the corresponding relationship between the storage path of the migrated data on the old device and the storage path where the corresponding migrated data will be stored on the new device. M is a positive integer, M≤N.

[0105] In some embodiments, after the new device receives the migration information sent by the old device, the new device displays a first interface, wherein the first interface is used to select one or more migration data from N migration data to obtain M migration data; then, the new device determines the target storage path of each migration data in the M migration data according to a preset storage rule.

[0106] For example, Fig. 9 As shown, after the new device receives the migration information sent by the old device, the new device displays an interface 210 (i.e., a first interface); the interface 210 includes the name of the storage partition of the old device, and the first data identifier (such as the file name) of the N migration data stored in the storage partition of the old device. In some embodiments, the interface 210 also includes prompt information of the storage space size of the new device, prompt information of the file size of the selected migration data, prompt information of the number of selected migration data, and prompt information of the estimated migration duration, etc. In some embodiments, the interface 210 also includes a "start migration" control and a "cancel" control.

[0107] For example, Fig. 9 As shown, the interface 210 includes a selection item "Local Disk C" and a selection item "Local Disk D"; wherein the selection item "Local Disk D" includes sub-selections "My Files" and "My Drive"; and the sub-selection item "My Files" includes "index" and "image" files. For example, in response to the user's selection operation on the selection item "Local Disk C" in the interface 210, all migration data stored in the "Local Disk C" are selected. Accordingly, the new device can also select M migration data from N migration data in response to the user's selection operation on other selection items in the interface 210.

[0108] It should be noted that when the new device responds to the user's selection operation on all selection items in the interface 210, the M migration data selected by the new device is all the data on the old device, that is, N = M. When the new device responds to the user's selection operation on some selection items in the interface 210, the M migration data selected by the new device is part of the data on the old device, that is, M < N.

[0109] In some embodiments, assuming that the M migration data include data a, data b, and data c, the preset saving rule may be as shown in Table 2 below, for example.

[0110] Migrate data Data Identification Source Path Target storage path Dataa xxx-a D\\AAA\t.txt C:\\AAA\t.txt Data b xxx-b E:\\BBB\t.txt E:\\BBB\t.txt Datac xxx-c C:\\AAA\t.txt D:\\AAA\t.txt

[0111] Table 2

[0112] Exemplarily, as shown in Table 2, the new device searches for the target storage path of the corresponding migration data in the preset save rules according to the first data identifier and source path of each migration data in the M migration data. For example, the data identifier of data a is xxx-a, and the source path is D\\AAA\t.txt. Then, the new device determines that the target storage path of data a is C:\\AAA\t.txt according to the preset save rules. Correspondingly, the new device can also search for the target storage path of other data in the preset save rules, which will not be repeated here.

[0113] S303: The new device sends migration information 2 to the old device.

[0114] The migration information 2 includes: a first data identifier of each migration data in the M migration data, and a target storage path of the migration data indicated by the first data identifier. In the embodiment of the present application, the migration information 2 may also be referred to as the first migration information.

[0115] Exemplarily, the migration information 2 sent by the new device to the old device may be as shown in Table 3 below.

[0116] Migrate data Data Identification Target storage path Dataa xxx-a C:\\AAA\t.txt Data b xxx-b E:\\BBB\t.txt Datac xxx-c D:\\AAA\t.txt

[0117] Table 3

[0118] S304: The old device sends M migration data to the new device according to the migration information 2.

[0119] Correspondingly, the new device receives the M migration data sent by the old device according to the second migration information.

[0120] For example, during the process of sending M migration data from the old device to the new device, the old device and the new device display as follows: Fig.10The interface 211 shown includes prompt information for prompting the user of the data migration progress. For example, the interface 211 includes the migration progress (such as %), the size of the migrated data, the migration rate, and the remaining time.

[0121] S305: The new device determines whether the target storage path of the first migration data among the M migration data includes the target data.

[0122] The second data identifier of the target data is the same as the first data identifier of the first migration data. That is, after receiving the M migration data, the new device determines whether the target storage path of the first migration data includes data with the same first data identifier as the first migration data.

[0123] In some embodiments, if the target storage path of the first migration data includes the target data, the new device executes S306; if the target storage path of the first migration data does not include the target data, the new device stores the first migration data in the target storage path of the first migration data.

[0124] It should be understood that the first migration data is any one of the M migration data. In the embodiment of the present application, for each migration data in the M migration data, the new device determines whether the target storage path of each migration data includes the target data; if so, the new device executes S306.

[0125] S306: The new device determines whether the target data and the first migration data have the same content.

[0126] In some embodiments, if the target data has the same content as the first migration data, the new device stores one of the target data or the first migration data. Exemplarily, the new device stores the first migration data in the target storage path of the first migration data and deletes the target data; or, the new device does not store the first migration data in the target storage path of the first migration data and retains the target data.

[0127] In other embodiments, if the target data is different from the first migration data in content, the new device stores the first migration data in the target storage path of the first migration data and retains the target data.

[0128] Exemplarily, the new device may determine whether the contents of the target data are identical to those of the first migration data by comparing the sha256 (ie, hash value) of the target data with the sha256 of the first migration data.

[0129] It should be noted that sha256 is an algorithm subdivided from sha-2 (secure hash algorithm 2). Among them, sha-2 is a cryptographic hash function algorithm. In some embodiments, the input of sha256 is a message of any length, and the output of sha256 is a 256-bit hash value.

[0130] To summarize, in an embodiment of the present application, when the new device receives M migration data sent by the old device, in the case where the target data is included under the target storage path of the first migration data in the M migration data, since the second data identifier of the target data is the same as the first data identifier of the first migration data, the new device determines that the target storage path of the first migration data includes target data with the same first data name as the first migration data; on this basis, the new device detects whether the contents of the target data are the same as those of the first migration data. If the contents of the target data are the same as those of the first migration data, the new device stores one of the target data or the first migration data, that is, when the contents of the target data are the same as those of the first migration data, the new device only stores one of them, thereby solving the problem in the related art that data with the same content is stored on the new device and occupies the storage space of the new device.

[0131] Considering that it takes time for the new device to calculate the sha256 of the target data and the sha256 of the first migration data, based on this, after receiving the M migration data sent by the old device, the new device first stores the first migration data in the target storage path corresponding to the first migration data, and then the new device determines whether the content of the target data is the same as that of the first migration data. In this way, the calculation of the sha256 of the target data and the sha256 of the first migration data by the new device will not affect the storage speed of the first migration data, which is conducive to improving the efficiency of data migration.

[0132] In some embodiments, Fig.11 As shown, before the new device detects whether the target data is identical to the first migration data, the method further includes:

[0133] S3051: The new device stores the first migration data in a target storage path of the first migration data, and updates the first data identifier of the first migration data to a third data identifier.

[0134] Taking the first data identifier as a file name as an example, illustratively, after the new device saves the first migration data, the file name of the first migration data is modified to the copy name. For example, the first data identifier of the first migration data is xxx-a, then the third data identifier of the first migration data can be, for example, xxx-a(1).

[0135] On this basis, if the new device detects that the target data has the same content as the first migration data, the new device may delete the first migration data corresponding to the third data identifier, that is, the new device deletes the newly saved first migration data and retains the target data.

[0136] Combination Fig.11 As shown, in some embodiments, when the target data is included under the target storage path of the first migration data, the new device can add the second data identifier and the third data identifier as a group of messages to the queue of data to be migrated; on this basis, the new device detects whether the target data corresponding to the second identifier and the first migration data corresponding to the third identifier in a group of messages in the queue of data to be migrated are the same in accordance with the first-in-first-out principle.

[0137] It should be noted that, for the explanation of the queue of data to be migrated, reference may be made to the explanation of the message queue in the above embodiment, which will not be repeated here.

[0138] For example, assume that among the M migrated data, the target storage path of data a includes target data a1, the target storage path of data b includes target data b1, and the target storage path of data c includes target data c1. On this basis, Fig.12 As shown, the new device adds the second data identifier corresponding to the target data a1 and the third data identifier corresponding to the data a as a group of data to the data queue to be migrated; adds the second data identifier corresponding to the target data b1 and the third data identifier corresponding to the data b as a group of data to the data queue to be migrated; and adds the second data identifier corresponding to the target data c1 and the third data identifier corresponding to the data c as a group of data to the data queue to be migrated.

[0139] Thus, the queue of data to be migrated includes three groups of messages, each group of messages corresponding to a second data identifier and a third data identifier. It should be understood that the new device will add a group of messages to the queue of data to be migrated each time it determines that a target storage path of migration data includes target data.

[0140] It should be noted that the queue of data to be migrated follows the principle of first-in-first-out, that is, the data that enters the queue first is out first. In the embodiment of the present application, the second data identifier and the third data identifier that enter the queue of data to be migrated first, the new device will first detect whether the target data corresponding to the second identifier is the same as the first migration data corresponding to the third data identifier.

[0141] In this embodiment, when the target data is included in the target storage path of the first migration data, since the new device adds the second data identifier and the third data identifier as a group of messages to the queue of data to be migrated, and the queue of data to be migrated has a first-in-first-out principle, that is, the second data identifier and the third data identifier that enter the queue first, the new device will first detect whether the target data corresponding to the second identifier is the same as the content of the first migration data corresponding to the third data identifier, which will not affect the storage speed of the first migration data, and further improve the data migration efficiency.

[0142] In some embodiments, in combination Fig.12 As shown, the new device detects in turn whether the target data corresponding to each group of messages in the queue of data to be migrated is the same as the content of the first migration data. Exemplarily, for each group of messages in the queue of data to be migrated, the new device inputs the second data identifier in a group of messages into a preset algorithm model and outputs a first message identifier; inputs the third data identifier in a group of messages into a preset algorithm model and outputs a second message identifier; when the first message identifier and the second message identifier are the same, the new device determines that the content of the target data and the first migration data are the same; when the first message identifier and the second message identifier are different, the new device determines that the content of the target data and the first migration data are different.

[0143] The first message identifier and the second message identifier may be, for example, a 256-bit hash value.

[0144] It should be noted that, when the first message identifier and the second message identifier are the same, the new device deletes the newly saved first migration data, that is, the new device deletes the first migration data corresponding to the third data identifier and retains the target data. When the first message identifier and the second message identifier are different, the new device reselects a group of messages from the queue of data to be migrated, and detects whether the target data of the second data identifier corresponding to the group of messages and the content of the first migration data of the third data identifier are the same.

[0145] In some embodiments, in combination Fig.12 The new device may run multiple threads, and the multiple threads may detect in parallel whether the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the queue of data to be migrated are the same.

[0146] For example, Fig.13As shown, the new device runs thread A, thread B and thread C; wherein, the new device runs thread A to detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated and the content of the first migration data corresponding to the third data identifier are the same; at the same time, the new device runs thread B to detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated and the content of the first migration data corresponding to the third data identifier are the same; at the same time, the new device runs thread C to detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated and the content of the first migration data corresponding to the third data identifier are the same.

[0147] In this way, the new device runs multiple threads in parallel to detect whether the target data corresponding to the second data identifier in a group of messages in the data queue to be migrated is the same as the first migration data corresponding to the third data identifier, thereby reducing the time it takes for the new device to detect the target data and the first migration data and reducing device power consumption.

[0148] In some embodiments, when the old device sends M migration data to the new device, if the new device detects that the target data is different from the content of the first migration data, the new device sends a first prompt message; wherein the first prompt message is used to prompt the user to update the data identifier of the first migration data from the first data identifier to the third data identifier.

[0149] Taking the first data identifier of the first migration data as xxx-a and the third data identifier of the first migration data as xxx-a(1) as an example, illustratively, the first prompt information may be voice prompt information or text prompt information.

[0150] When the first prompt information is a voice prompt information, the new device can play a voice message through a speaker to prompt the user that the data identifier of the first migration data is updated from the first data identifier to the third data identifier. Exemplarily, the voice prompt message can be, for example, "The name of the first migration data is updated from xxx-a to xxx-a(1)".

[0151] When the first prompt information is a text prompt information, such as Fig.14 As shown, the new device displays an interface 212, and the interface 212 includes text prompt information. Exemplarily, the text prompt information may be, for example, "The name of the first migration data is updated from xxx-a to xxx-a(1)".

[0152] In this embodiment, when the target data is different from the content of the first migration data, the new device will issue a first prompt message. Since the first prompt message is used to prompt the user that the data identifier of the first migration data is updated from the first data identifier to the third data identifier, the new device can prompt the user which migration data has been renamed through a prompt message, thereby facilitating the user to find the migration data on the new device and improving the user experience.

[0153] The present application embodiment provides an electronic device, which can be a first electronic device or a second electronic device. The electronic device may include a display screen, a memory, and one or more processors; the memory stores a computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device can perform the functions or steps performed by the old device and the new device in the above embodiment. The structure of the electronic device can refer to Figure 2 The structure of the electronic device 100 is shown.

[0154] The present application also provides a chip system, such as Fig.15 As shown, the chip system 1800 includes at least one processor 1801 and at least one interface circuit 1802. The processor 1801 may be Figure 2 The interface circuit 1802 may be, for example, an interface circuit between the processor 110 and the external memory 120 ; or an interface circuit between the processor 110 and the internal memory 121 .

[0155] The processor 1801 and the interface circuit 1802 can be interconnected via lines. For example, the interface circuit 1802 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1802 can be used to send signals to other devices (such as the processor 1801). Exemplarily, the interface circuit 1802 can read instructions stored in the memory and send the instructions to the processor 1801. When the instructions are executed by the processor 1801, the electronic device can execute the various steps performed by the mobile phone 180 in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0156] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each function or step executed by the mobile phone in the above method embodiment.

[0157] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.

[0158] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0160] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0163] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A data migration method, characterized in that: Applied in a first electronic device, the first electronic device is communicatively connected with a second electronic device; the method includes: The first electronic device receives second migration information from the second electronic device; the second migration information includes a first data identifier of each migration data in N migration data, and a storage path of each migration data on the second electronic device; N is a positive integer; The first electronic device determines, according to the second migration information and in accordance with a preset storage rule, a target storage path for each of the M migration data; the preset storage rule is used to indicate a corresponding relationship between a storage path of the migration data on the second electronic device and a storage path where the corresponding migration data will be stored on the first electronic device; The first electronic device sends first migration information to the second electronic device; the first migration information includes: a first data identifier of each migration data in the M migration data, and a target storage path of the migration data indicated by the first data identifier; the target storage path is used to indicate a storage path of the migration data on the first electronic device; M is a positive integer, N≥M; The first electronic device receives M migration data sent by the second electronic device according to the first migration information; If the target storage path of the first migration data among the M migration data includes the target data, the first electronic device stores the first migration data in the target storage path of the first migration data, and updates the first data identifier of the first migration data to a third data identifier; wherein the second data identifier of the target data is the same as the first data identifier of the first migration data; The first electronic device adds the second data identifier and the third data identifier as a group of messages to a queue of data to be migrated, and after the first electronic device stores the first migrated data in a target storage path of the first migrated data, the first electronic device detects, according to a first-in-first-out principle, whether the target data corresponding to the second data identifier and the first migrated data corresponding to the third data identifier in a group of messages in the queue of data to be migrated are the same in content; If the target data has the same content as the first migration data, the first electronic device deletes the first migration data corresponding to the third data identifier and retains the target data; If the target data and the first migration data have different contents, the first electronic device retains the target data and the first migration data.

2. The method according to claim 1, characterized in that The method further comprises: If the target data and the first migration data have different contents, the first electronic device issues a first prompt message; The first prompt information is used to prompt the user to update the data identifier of the first migration data from the first data identifier to the third data identifier.

3. The method according to claim 1, characterized in that The detecting whether the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the to-be-migrated data queue have the same content includes: The first electronic device inputs the second data identifier in the group of messages into a preset algorithm model and outputs a first message identifier; The first electronic device inputs the third data identifier in the group of messages into the preset algorithm model and outputs a second message identifier; When the first message identifier and the second message identifier are the same, the first electronic device determines that the target data and the first migration data have the same content; When the first message identifier and the second message identifier are different, the first electronic device determines that the contents of the target data and the first migration data are different.

4. The method according to claim 1 or 3, characterized in that: The detecting whether the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the to-be-migrated data queue have the same content includes: The first electronic device runs multiple threads, and the multiple threads respectively detect in parallel whether the target data corresponding to the second data identifier and the first migration data corresponding to the third data identifier in a group of messages in the queue of data to be migrated are the same.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If the target storage path of the first migration data among the plurality of migration data does not include target data, the first electronic device stores the first migration data in the target storage path of the first migration data.

6. An electronic device, characterized in that: include: A display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that: The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data migration method and terminal

    CN106412033A

  • Data migration method and device

    CN106446114A