Data migration method and device, equipment and medium
By migrating data on the blockchain network and leveraging its decentralized and immutable characteristics, the problem of poor security in cloud storage data migration is solved, and higher data security and integrity are achieved.
Patent Information
- Application Number
- CN202510151722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, when data migration is carried out through cloud storage, there are problems of data leakage and poor security.
Data migration is carried out using blockchain networks, and data migration is sent by receiving data migration requests from electronic devices, and the decentralized and immutable characteristics of blockchain are used when storing and transmitting data.
Improves the security of data migration, prevents data from being tampered with or leaked, and ensures the integrity and reliability of data during the migration process.
Smart Images

Figure CN120067211A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of blockchain technology, and particularly relates to a data migration method, apparatus, device, and medium. Background Art
[0002] With the continuous development of technology, the demand for users to migrate data between different devices is increasing. For example, migrating data from an old mobile phone to a new mobile phone, or migrating data from a mobile phone to a tablet computer.
[0003] In related technologies, when performing data migration, data migration is mainly carried out through cloud storage. However, migrating data through cloud storage may lead to data leakage, and the security of data migration is poor. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a data migration method, apparatus, device, and medium, which can solve the problem of poor security of data migration.
[0005] In a first aspect, an embodiment of this application provides a data migration method applied to a blockchain network, including:
[0006] Receiving a data migration request sent by a first electronic device, where the data migration request at least includes identification information of a second electronic device;
[0007] In response to the data migration request, sending data migration permission information to the first electronic device;
[0008] Receiving first data sent by the first electronic device, where the first data includes second data that the first electronic device needs to migrate to the second electronic device, and the first data is sent after the first electronic device receives the data migration permission information;
[0009] Storing the first data at a first position on the blockchain network;
[0010] According to the identification information, sending the first data stored at the first position to the second electronic device.
[0011] In a second aspect, an embodiment of this application provides a data migration method applied to a first electronic device, including:
[0012] Sending a data migration request to the blockchain network, where the data migration request at least includes identification information of a second electronic device;
[0013] Receiving data migration permission information sent by the blockchain network in response to the data migration request;
[0014] After receiving the data migration permission information, send the first data to the blockchain network to migrate the second data to the second electronic device through the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device.
[0015] In a third aspect, an embodiment of the present application provides a data migration device applied to a blockchain network, including:
[0016] A first receiving module, configured to receive a data migration request sent by a first electronic device, where the data migration request at least includes identification information of a second electronic device;
[0017] A first sending module, configured to send data migration permission information to the first electronic device in response to the data migration request;
[0018] A second receiving module, configured to receive the first data sent by the first electronic device, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device, and the first data is sent after the first electronic device receives the data migration permission information;
[0019] A storage module, configured to store the first data at a first location on the blockchain network;
[0020] A second sending module, configured to send the first data stored at the first location to the second electronic device according to the identification information.
[0021] In a fourth aspect, an embodiment of the present application provides a data migration device applied to a first electronic device, including:
[0022] A third sending module, configured to send a data migration request to the blockchain network, where the data migration request at least includes identification information of a second electronic device;
[0023] A third receiving module, configured to receive data migration permission information sent by the blockchain network in response to the data migration request;
[0024] A fourth sending module, configured to, after receiving the data migration permission information, send the first data to the blockchain network to migrate the second data to the second electronic device through the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device.
[0025] In a fifth aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the data migration method applied to the first electronic device provided by the embodiment of the present application are implemented.
[0026] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the data migration method applied to the first electronic device provided by the embodiment of the present application are implemented.
[0027] In a seventh aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instructions to implement the steps of the data migration method applied to the first electronic device provided by the embodiment of the present application.
[0028] In an eighth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the data migration method applied to the first electronic device provided by the embodiment of the present application.
[0029] In the embodiment of the present application, the first electronic device sends a data migration request to the blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends first data to the blockchain network, where the first data includes second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at a first position on the blockchain network, and then sends the first data stored at the first position to the second electronic device, realizing the migration of the second data from the first electronic device to the second electronic device through the blockchain. Utilizing the decentralization and immutability of the blockchain can ensure the security of data during the migration process and prevent data from being tampered with or leaked. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a schematic flowchart of a data migration method applied to a blockchain network provided by an embodiment of the present application;
[0031] Figure 2 is a schematic flowchart of a data migration method applied to a first electronic device provided by an embodiment of the present application;
[0032] Figure 3 is a schematic structural diagram of a data migration device applied to a blockchain network provided by an embodiment of the present application;
[0033] Figure 4 is a schematic structural diagram of a data migration device applied to a first electronic device provided by an embodiment of the present application;
[0034] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0035] Figure 6 It is a schematic diagram of the hardware structure of the electronic device implementing the embodiments of the present application. Specific Embodiments
[0036] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0037] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.
[0038] Next, in conjunction with the accompanying drawings, the data migration methods, devices, equipment, and media provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0039] Figure 1 It is a schematic flowchart of the data migration method applied to the blockchain network provided by the embodiments of the present application. The data migration method applied to the blockchain network may include:
[0040] Step 101: Receive a data migration request sent by a first electronic device, where the data migration request at least includes the identification information of a second electronic device;
[0041] In some possible implementations of the embodiments of the present application, the data migration request in the embodiments of the present application is used to request the blockchain network to migrate the data in the first electronic device to the second electronic device. The identification information of the second electronic device in the embodiments of the present application is used to instruct the blockchain network to transfer data to the second electronic device, where the identification information of the second electronic device may be the device serial number of the second electronic device, the address of the second electronic device, etc.
[0042] It should be noted that before data migration, the first electronic device and the second electronic device need to register with the blockchain network. Only the electronic devices registered with the blockchain network can transfer data to each other.
[0043] Step 102: In response to a data migration request, send data migration permission information to the first electronic device;
[0044] In some possible implementations of the embodiments of the present application, when the blockchain network permits the first electronic device to migrate data to the second electronic device, data migration permission information is sent to the first electronic device; otherwise, data migration rejection information is sent to the first electronic device. When the first electronic device receives the data migration permission information, it sends the migrated data to the blockchain network; when the first electronic device receives the data migration rejection information, it does not send the migrated data to the blockchain network.
[0045] In some possible implementations of the embodiments of the present application, before step 102, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: authenticating the identities of the first electronic device and the second electronic device; correspondingly, step 102 may include: when the first electronic device and the second electronic device pass the identity authentication, sending data migration permission information to the first electronic device.
[0046] The embodiments of the present application do not limit the manner of authenticating the identities of the first electronic device and the second electronic device, and any available manner can be applied to the embodiments of the present application. For example, the identification information of the first electronic device and the identification information of the second electronic device are matched with the identification information of the electronic devices registered in the blockchain network; when the identification information of the electronic devices registered in the blockchain network includes the identification information of the first electronic device, the first electronic device passes the identity authentication; when the identification information of the electronic devices registered in the blockchain network does not include the identification information of the first electronic device, the first electronic device fails the identity authentication; when the identification information of the electronic devices registered in the blockchain network includes the identification information of the second electronic device, the second electronic device passes the identity authentication; when the identification information of the electronic devices registered in the blockchain network does not include the identification information of the second electronic device, the second electronic device fails the identity authentication.
[0047] In the embodiments of the present application, by authenticating the identities of the first electronic device and the second electronic device, when both the first electronic device and the second electronic device pass the identity authentication, the blockchain network sends data migration permission information to the first electronic device, and the first electronic device can perform data migration only after receiving the data migration permission information; otherwise, it cannot perform data migration, which can avoid illegal data migration.
[0048] In some possible implementations of the embodiments of the present application, before step 102, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: generating a data migration identifier according to the first identity authentication result, the second identity authentication result, and the time when the first electronic device sends a data migration request, where the first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device, and the data migration identifier is used for the first electronic device to generate a key for encrypting the second data that needs to be migrated to the second electronic device.
[0049] In some possible implementations of the embodiments of the present application, when generating a data migration identifier according to the first identity authentication result, the second identity authentication result, and the time when the first electronic device sends a data migration request, a logical operation may be performed on the first identity authentication result, the second identity authentication result, and the time when the first electronic device sends a data migration request to obtain a logical operation value, and then the hash value of the logical operation value is calculated, and the hash value is used as the data migration identifier. Among them, the logical operations in the embodiments of the present application include but are not limited to logical AND operation, logical OR operation, logical XOR operation, etc.
[0050] Exemplarily, taking the logical OR operation as an example, the data migration identifier may be generated through the following formula (1):
[0051] MID = H(Is||Ir||T)(1)
[0052] Wherein, in formula (1), MID is the data migration identifier, H is the hash function, Is is the identity authentication result of the first electronic device, Ir is the identity authentication result of the second electronic device, T is the time when the first electronic device sends a data migration request, and || is the logical OR operator. The initial values of Is and Ir are 0. When the first electronic device passes the identity authentication, Is is 1. When the second electronic device passes the identity authentication, Ir is 1.
[0053] In some possible implementations of the embodiments of the present application, step 102 may include: sending data migration permission information to the first electronic device when the data migration control values of both the first electronic device and the second electronic device are greater than or equal to the first threshold, and the data migration control value is used to determine whether to allow the first electronic device to migrate data to the second electronic device.
[0054] In some possible implementations of the embodiments of the present application, the first threshold in the embodiments of the present application may be set according to actual needs. When the data migration control value of a certain electronic device is low, that is, less than the first threshold, this electronic device is not allowed to migrate data to other electronic devices, nor are other electronic devices allowed to migrate data to this electronic device.
[0055] In the embodiment of the present application, when the data migration control values of both the first electronic device and the second electronic device are greater than or equal to the first threshold, the blockchain network sends data migration permission information to the first electronic device. The first electronic device can perform data migration only after receiving the data migration permission information; otherwise, it cannot perform data migration.
[0056] Step 103: Receive the first data sent by the first electronic device, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device, and the first data is sent after the first electronic device receives the data migration permission information;
[0057] After receiving the data migration permission information sent by the blockchain network, the first electronic device sends the first data to the blockchain network. The first data includes the second data that the first electronic device needs to migrate to the second electronic device; the blockchain network receives the first data sent by the first electronic device.
[0058] In some possible implementations of the embodiment of the present application, when the first electronic device receives the data migration permission information including the data migration identifier sent by the blockchain network, it may generate a key for encrypting the second data according to the data migration identifier; use the key to encrypt the second data to obtain the third data, and send the first data including the third data to the blockchain network.
[0059] In some possible implementations of the embodiment of the present application, when the first electronic device generates a key according to the data migration identifier, it may use a key derivation function (KDF) to calculate the function value corresponding to the data migration identifier; use the function value as the key.
[0060] The key derivation function in the embodiment of the present application may be a key derivation function based on a hash-based message authentication code (HMAC) related to the key.
[0061] The process of generating a key using the KDF based on HMAC related to the key is shown in the following formula (2):
[0062] K||IV=HKDF(S,MID,pks||pkr,L) (2)
[0063] Among them, in formula (2), K is the key for data encryption and decryption, IV is the initialization vector (Initialization Vector, IV) participating in encryption and decryption, HKDF is the HMAC-based KDF, S is the key seed shared by the first electronic device and the second electronic device, MID is the data migration identifier, pks is the public key of the first electronic device, pkr is the public key of the second electronic device, and L is the key length.
[0064] In some possible implementations of the embodiments of the present application, the first electronic device and the second electronic device may pre-store large prime numbers p and a generator g in a known finite field in advance, or receive p and g published by the blockchain network in a secure manner. The first electronic device generates a random number a, calculates g a mod p, and sends the calculated value of A to the second electronic device. The second electronic device generates a random number b, calculates A b mod p, and obtains S; the second electronic device calculates g b mod p, and sends the calculated value of B to the first electronic device. The first electronic device calculates B a mod p, and also obtains S. This S is the key seed shared by the first electronic device and the second electronic device.
[0065] After the first electronic device generates the key K, it encrypts the second data with the key K to obtain the third data C2. Then, it sends the first data including the third data C2 to the blockchain network, where C2 = E K (M), and E K () is the encryption algorithm for data encryption using the key K and the initialization vector IV, and M is the second data.
[0066] In the embodiments of the present application, by encrypting the migrated data, the security of data migration can be improved.
[0067] Step 104: Store the first data at the first position on the blockchain network;
[0068] In some possible implementations of the embodiments of the present application, the first position in the embodiments of the present application is the position for storing the transferred data, which can be set according to actual needs.
[0069] In some possible implementations of the embodiments of the present application, before step 104, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: determining a first location according to a first blockchain address corresponding to a first electronic device, a second blockchain address corresponding to a second electronic device, and a data migration identifier, where the data migration identifier is generated according to a first identity authentication result, a second identity authentication result, and the time when the first electronic device sends a data migration request, the first identity authentication result is an identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is an identity authentication result obtained by authenticating the second electronic device.
[0070] In some possible implementations of the embodiments of the present application, determining the first location according to the first blockchain address corresponding to the first electronic device, the second blockchain address corresponding to the second electronic device, and the data migration identifier may include: performing a first logical operation on the first blockchain address, the second blockchain address, and the data migration identifier to obtain a first logical operation value; calculating a hash value of the first logical operation value to obtain the first location.
[0071] In some possible implementations of the embodiments of the present application, the first logical operation in the embodiments of the present application includes, but is not limited to, logical AND operation, logical OR operation, logical XOR operation, and the like.
[0072] Exemplarily, taking the logical OR operation as an example, the first location can be determined by the following formula (3):
[0073] address=H(MID||data_sender_address||data_receiver_address)(3)
[0074] Where, in formula (3), address is the first location, H is a hash function, MID is the data migration identifier, data_sender_address is the blockchain address corresponding to the first electronic device, data_receiver_address is the blockchain address corresponding to the second electronic device, and || is a logical OR operator.
[0075] It can be understood that the data migration identifier in the embodiments of the present application can be used both for the first electronic device to generate a key for encrypting the data to be migrated and for determining the first location.
[0076] In the embodiments of the present application, generating a location for storing the migrated data through the data migration identifier, the blockchain address corresponding to the first electronic device, and the blockchain address corresponding to the second electronic device can ensure that the storage location of the migrated data is associated with the data migration transaction, and can avoid the situation that the migrated data is stored in the location of other data, resulting in the loss of other data.
[0077] Step 105: Send the first data stored at the first location to the second electronic device according to the identification information.
[0078] In the embodiments of the present application, the first electronic device sends a data migration request to the blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends the first data to the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at the first location on the blockchain network, and then sends the first data stored at the first location to the second electronic device, realizing the migration of the second data from the first electronic device to the second electronic device through the blockchain. Utilizing the decentralization and immutability of the blockchain can ensure the security of data during the migration process and prevent the data from being tampered with or leaked.
[0079] In some possible implementations of the embodiments of the present application, after encrypting the second data with a key to obtain the third data, the first electronic device may further calculate the hash value of the third data; generate a data verification value according to the hash value of the third data, where the data verification value is used for the second electronic device to perform integrity verification on the received data.
[0080] In some possible implementations of the embodiments of the present application, when generating the data verification value according to the hash value of the third data, a logical operation may be performed on the hash value of the third data and a value related to the elliptic curve to obtain the data verification value. The logical operations in the embodiments of the present application include, but are not limited to, logical AND operation, logical OR operation, logical XOR operation, etc.
[0081] Exemplarily, taking the logical XOR operation as an example, the data verification value can be determined by the following formula (4):
[0082]
[0083] Wherein, in formula (4), C3 is the data verification value, H is the hash function, C2 is the third data, is the logical XOR operator, C1 is the value related to the elliptic curve, C1 = kG, k is a random number related to the elliptic curve, and G is the base point of the elliptic curve.
[0084] After the second electronic device obtains the encrypted data and the data verification value from the blockchain network, it calculates the hash value of the encrypted data, performs an exclusive OR operation on the hash value and C1, and compares the value obtained from the exclusive OR operation with the data verification value. If the value obtained from the exclusive OR operation is equal to the data verification value, it indicates that the data is complete and not damaged. If the value obtained from the exclusive OR operation is not equal to the data verification value, it indicates that the data is incomplete and may have been tampered with during transmission.
[0085] When the value obtained from the exclusive OR operation is equal to the data verification value, the second electronic device decrypts the encrypted data to obtain the migrated data.
[0086] In the embodiments of the present application, through data integrity verification, abnormal situations during the data migration process can be detected in a timely manner, ensuring the quality and reliability of the data.
[0087] In some possible implementations of the embodiments of the present application, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: in the case of successful data migration, according to the actual data volume sent by the first electronic device, the actual data volume received by the second electronic device, the expected data volume to be sent by the first electronic device, and the expected data volume to be received by the second electronic device, increase the data migration control value of the first electronic device and the data migration control value of the second electronic device.
[0088] In some possible implementations of the embodiments of the present application, increasing the data migration control value of the first electronic device and the data migration control value of the second electronic device may include: determining the first data migration control value according to the data migration control value of the first electronic device before data migration, the actual data volume sent by the first electronic device, the expected data volume to be sent by the first electronic device, and the control value increase coefficient; increasing the data migration control value of the first electronic device to the first data migration control value; determining the second data migration control value according to the data migration control value of the second electronic device before data migration, the actual data volume received by the second electronic device, the expected data volume to be received by the second electronic device, and the control value increase coefficient; increasing the data migration control value of the second electronic device to the second data migration control value.
[0089] In some possible implementations of the embodiments of the present application, after the data migration is successful, the data migration control value of the first electronic device and the data migration control value of the second electronic device can be increased through the following formula (5):
[0090]
[0091] Wherein, in formula (5), RS i+1 is the first data migration control value, RS i is the data migration control value of the first electronic device before migrating the second data, NS iis the actual data volume sent by the first electronic device, ES i is the expected data volume to be sent by the first electronic device, RR i+1 is the second data migration control value, RR i is the data migration control value of the second electronic device before migrating the second data, NR i is the actual data volume received by the second electronic device, ER i is the expected data volume to be received by the second electronic device, a is the control value increase coefficient, 0 < a < 1, and the control value increase coefficient a can be set according to actual needs.
[0092] In some possible implementations of the embodiments of the present application, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: in the case of abnormal data migration, according to the actual data volume sent by the first electronic device, the actual data volume received by the second electronic device, the expected data volume to be sent by the first electronic device, and the expected data volume to be received by the second electronic device, reducing the data migration control value of the first electronic device and the data migration control value of the second electronic device.
[0093] The embodiments of the present application do not limit the manner of detecting whether data migration is abnormal, and any available manner can be applied to the embodiments of the present application. For example, it is detected through the above manner that incomplete data is tampered with during data migration.
[0094] In some possible implementations of the embodiments of the present application, reducing the data migration control value of the first electronic device and the data migration control value of the second electronic device may include: determining a third data migration control value according to the data migration control value of the first electronic device before data migration, the actual data volume sent by the first electronic device, the expected data volume to be sent by the first electronic device, and the control value reduction coefficient; reducing the data migration control value of the first electronic device to the third data migration control value; determining a fourth data migration control value according to the data migration control value of the second electronic device before data migration, the actual data volume received by the second electronic device, the expected data volume to be received by the second electronic device, and the control value reduction coefficient; reducing the data migration control value of the second electronic device to the fourth data migration control value.
[0095] In some possible implementations of the embodiments of the present application, after data migration is abnormal, the data migration control value of the first electronic device and the data migration control value of the second electronic device can be reduced through the following formula (6):
[0096]
[0097] Among them, in formula (6), RS i+1 is the third data migration control value, RS iFor migrating the data migration control value of the first electronic device before migrating the second data, NS i For the actual data volume sent by the first electronic device, ES i For the expected data volume to be sent by the first electronic device, RR i+1 For the fourth data migration control value, RR i For the data migration control value of the second electronic device before migrating the second data, NR i For the actual data volume received by the second electronic device, ER i For the expected data volume to be received by the second electronic device, β is the control value reduction coefficient, β > a.
[0098] In some possible implementations of the embodiments of the present application, the initial data migration control value of the electronic device can be determined by the device control value of the electronic device and the manufacturer control value of the manufacturer corresponding to the electronic device. It can be understood that the initial data migration control value of the electronic device is used to adjust the data migration control value of the electronic device after the first data migration.
[0099] In some possible implementations of the embodiments of the present application, when determining the initial data migration control value of the electronic device by the device control value of the electronic device and the manufacturer control value of the manufacturer corresponding to the electronic device, the average value of the device control value of the electronic device and the manufacturer control value of the manufacturer corresponding to the electronic device can be used as the initial data migration control value of the electronic device. Optionally, the initial data migration control value of the electronic device can be determined by the following formula (6):
[0100] R0 = avg(T device , T oce ) (6)
[0101] Wherein, in formula (6), R0 is the initial data migration control value of the electronic device, avg is the average function, T device is the device control value of the electronic device, T oce is the manufacturer control value of the manufacturer corresponding to the electronic device. T oce = δ * P + ε * D + ξ * Sl, R is the device reputation value, S is the device security assessment score, C is the device compliance rate, P is the manufacturer product quality score, D is the manufacturer data security measure score, Sl is the manufacturer service level score, μ, v, δ, ε and ξ are weight coefficients, δ + ε + ξ = 1.
[0102] In the embodiments of the present application, since data migration of the electronic device is allowed only when the data migration control value of the electronic device is greater than or equal to the first threshold, after each data migration is completed, by adjusting the data migration control value of the electronic device, it is possible to encourage the electronic device to make the actually sent data volume as close as possible to the expected sent data volume during each data migration, or to make the actually received data volume as close as possible to the expected received data volume during each data migration, that is, to send as much data as possible or receive as much data as possible during each data migration, so as to be able to perform data migration when data migration is needed in the future.
[0103] In some possible implementations of the embodiments of the present application, before step 105, the data migration method applied to the blockchain network provided by the embodiments of the present application may further include: receiving a data access request sent by a second electronic device, where the data access request includes the address information of the second electronic device; correspondingly, step 105 may include: when the address information of the second electronic device is the same as the address information of the electronic device corresponding to the identification information and the second electronic device passes the authentication, sending the first data stored at the first location to the second electronic device.
[0104] After the blockchain network receives the data access request sent by the second electronic device, it compares the address information of the second electronic device with the address information of the electronic device corresponding to the identification information included in the data migration request, and authenticates the second electronic device. When the address information of the second electronic device is the same as the address information of the electronic device corresponding to the identification information included in the data migration request and the second electronic device passes the authentication, the blockchain network sends the first data to the second electronic device.
[0105] In some possible implementations of the embodiments of the present application, after the blockchain network receives the first data, it may directly send the first data to the second electronic device.
[0106] In some possible implementations of the embodiments of the present application, when the data migration conditions are met, the first electronic device may automatically trigger a data migration operation, and the data migration conditions include but are not limited to that both the first electronic device and the second electronic device pass the authentication, and the data migration control values of both the first electronic device and the second electronic device are greater than or equal to the first threshold.
[0107] In some possible implementations of the embodiments of the present application, the first electronic device may convert the format of the second data to obtain the fourth data in the first format, and send the first data including the fourth data to the blockchain network. Correspondingly, step 103 may include: receiving the fourth data sent by the first electronic device, where the fourth data is the data in the first format obtained by converting the format of the second data.
[0108] In some possible implementations of the embodiments of the present application, the first electronic device may convert the second data into a data in a general intermediate format, migrate the data, and transmit the data in the general intermediate format to the second electronic device through the blockchain network. The second electronic device converts the data in the general intermediate format into a local format according to its own data format requirements for storage, completing the data migration.
[0109] In the embodiments of the present application, through format conversion, the problems of data format and communication protocol differences between devices of different manufacturers can be effectively solved, realizing data migration between devices of different manufacturers.
[0110] Exemplarily, it is assumed that the user wants to migrate the photos in his mobile phone to his tablet computer.
[0111] The user launches a data migration application on the mobile phone, selects the photos to be migrated, and selects their tablet computer as the recipient of the data migration. The mobile phone sends a data migration request to the blockchain network, and the data migration request includes the device identifier of the mobile phone and the device identifier of the tablet computer. The blockchain network authenticates the mobile phone and the tablet computer based on the device identifier of the mobile phone and the device identifier of the tablet computer. When the mobile phone and the tablet computer pass the authentication, it is determined whether the data migration control values of the mobile phone and the tablet computer are both greater than or equal to the first threshold. When the data migration control values of the mobile phone and the tablet computer are both greater than or equal to the first threshold, a data migration identifier MID is generated according to the above formula (1), and the data migration identifier MID and the public key of the tablet computer are sent to the mobile phone; the mobile phone determines the key K for encryption and decryption according to the above formula (2), converts the photos to be migrated into data in a common intermediate format, encrypts the converted data with the key K to obtain ciphertext, then determines the data verification value according to the above formula (4), sends the data migration identifier MID, the ciphertext and the data verification value to the blockchain network, and sends the data migration identifier MID to the tablet computer; after receiving the data migration identifier MID, the ciphertext and the data verification value, the blockchain network determines the storage location through the above formula (3), stores the received ciphertext and the data verification value at the determined storage location, and records the corresponding relationship between the data migration identifier MID and the storage location. The tablet computer sends a data access request to the blockchain network, and the data access request includes the device identifier of the tablet computer and the data migration identifier; the blockchain network authenticates the tablet computer based on the device identifier of the tablet computer. When the tablet computer passes the authentication, the ciphertext and the data verification value stored at the storage location corresponding to the data migration identifier included in the data access request are sent to the tablet computer. The tablet computer determines the data verification value through the above formula (4), compares the determined data verification value with the received data verification value. When the determined data verification value is equal to the received data verification value, the received ciphertext is decrypted with the key K, and then the decrypted data is converted into a data format supported by the tablet computer to complete the migration of the photos in the mobile phone to the tablet computer.
[0112] After the migration of the photos in the mobile phone to the tablet computer is successful, the data migration control values of the mobile phone and the tablet computer are increased according to the above formula (5); when there is an abnormality in the migration of the photos in the mobile phone to the tablet computer, the data migration control values of the mobile phone and the tablet computer are decreased according to the above formula (6).
[0113] The embodiment of the present application also provides a data migration method applied to a first electronic device, as Figure 2 shown, Figure 2 is a schematic flowchart of the data migration method applied to the first electronic device provided by the embodiment of the present application. The data migration method applied to the first electronic device may include:
[0114] Step 201: Send a data migration request to the blockchain network, where the data migration request at least includes the identification information of the second electronic device;
[0115] Step 202: Receive the data migration permission information sent by the blockchain network in response to the data migration request;
[0116] Step 203: After receiving the data migration permission information, send the first data to the blockchain network to migrate the second data to the second electronic device through the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device.
[0117] In the embodiment of the present application, the first electronic device sends a data migration request to the blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends the first data to the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at the first position on the blockchain network, and then sends the first data stored at the first position to the second electronic device, realizing the migration of the second data from the first electronic device to the second electronic device through the blockchain. Utilizing the decentralization and immutability of the blockchain can ensure the security of data during the migration process and prevent data from being tampered with or leaked.
[0118] In some possible implementations of the embodiment of the present application, the data migration permission information includes a data migration identifier, and the data migration identifier is generated by the blockchain network according to the first identity authentication result, the second identity authentication result, and the time corresponding to the data migration request sent by the first electronic device. The first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device; before step 203, the data migration method applied to the first electronic device provided in the embodiment of the present application further includes:
[0119] Generate a key according to the data migration identifier;
[0120] Encrypt the second data with the key to obtain the third data;
[0121] Correspondingly, the first data includes the third data.
[0122] In some possible implementations of the embodiment of the present application, generating a key according to the data migration identifier includes:
[0123] Use a key derivation function to calculate the function value corresponding to the data migration identifier; use the function value as the key.
[0124] In some possible implementations of the embodiments of the present application, before step 203, the data migration method applied to the first electronic device provided by the embodiments of the present application further includes:
[0125] Calculate the hash value of the third data;
[0126] Generate a data verification value according to the hash value of the third data, where the data verification value is used for the second electronic device to perform integrity verification on the received data;
[0127] Correspondingly, the first data further includes a data verification value.
[0128] In some possible implementations of the embodiments of the present application, generating a data verification value according to the hash value of the third data may include:
[0129] Perform a logical operation on the hash value of the third data and a value related to the elliptic curve to obtain a data verification value.
[0130] In some possible implementations of the embodiments of the present application, before step 203, the data migration method applied to the first electronic device provided by the embodiments of the present application further includes:
[0131] Convert the second data into a fourth data in the first format;
[0132] Correspondingly, the first data includes the fourth data.
[0133] For the specific implementation processes of the steps in the data migration method applied to the first electronic device provided by the embodiments of the present application, reference may be made to the descriptions in the data migration method applied to the blockchain network provided by the embodiments of the present application, and the embodiments of the present application will not elaborate on them here.
[0134] For the data migration method provided by the embodiments of the present application, the execution subject may be a data migration device. In the embodiments of the present application, taking the data migration device as an example to execute the data migration method, the data migration device provided by the embodiments of the present application is described.
[0135] Figure 3 It is a schematic structural diagram of a data migration device applied to a blockchain network. The data migration device 300 applied to a blockchain network may include:
[0136] A first receiving module 301, configured to receive a data migration request sent by the first electronic device, where the data migration request at least includes the identification information of the second electronic device;
[0137] A first sending module 302, configured to send data migration permission information to the first electronic device in response to the data migration request;
[0138] A second receiving module 303, configured to receive first data sent by a first electronic device, where the first data includes second data that the first electronic device needs to migrate to a second electronic device, and the first data is sent by the first electronic device after receiving data migration permission information;
[0139] A storage module 304, configured to store the first data at a first location on a blockchain network;
[0140] A second sending module 305, configured to send the first data stored at the first location to the second electronic device according to identification information.
[0141] In an embodiment of the present application, the first electronic device sends a data migration request to the blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends the first data to the blockchain network, where the first data includes second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at a first location on the blockchain network, and then sends the first data stored at the first location to the second electronic device, so as to implement the migration of the second data from the first electronic device to the second electronic device through the blockchain. By using the decentralization and immutability of the blockchain, the security of the data during the migration process can be ensured, and the data can be prevented from being tampered with or leaked.
[0142] In some possible implementations of the embodiment of the present application, the data migration device 300 applied to the blockchain network provided in the embodiment of the present application further includes:
[0143] An authentication module, configured to perform identity authentication on the first electronic device and the second electronic device;
[0144] Correspondingly, the first sending module 302 is specifically configured to:
[0145] Send data migration permission information to the first electronic device when the first electronic device and the second electronic device pass the identity authentication.
[0146] In the embodiment of the present application, by performing identity authentication on the first electronic device and the second electronic device, when both the first electronic device and the second electronic device pass the identity authentication, the blockchain network sends data migration permission information to the first electronic device. The first electronic device can perform data migration only after receiving the data migration permission information, otherwise it cannot perform data migration, which can avoid illegal migration of data.
[0147] In some possible implementations of the embodiments of the present application, the data migration permission information includes a data migration identifier, which is used by the first electronic device to generate a key for encrypting the second data, and the second data is encrypted with the key to obtain the third data; the first data includes the third data; the data migration device 300 applied to the blockchain network provided by the embodiments of the present application further includes:
[0148] A first generation module, configured to generate a data migration identifier according to the first identity authentication result, the second identity authentication result, and the time corresponding to the data migration request sent by the first electronic device, where the first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device.
[0149] In some possible implementations of the embodiments of the present application, the first data further includes: a data verification value, where the data verification value is generated by the first electronic device according to the hash value corresponding to the third data, and the data verification value is used by the second electronic device to perform integrity verification on the received data.
[0150] In the embodiments of the present application, through data integrity verification, abnormal situations in the data migration process can be discovered in a timely manner, ensuring the quality and reliability of the data.
[0151] In some possible implementations of the embodiments of the present application, the first sending module 302 is specifically configured to:
[0152] When the data migration control value of the first electronic device and the data migration control value of the second electronic device are greater than or equal to a first threshold, send data migration permission information to the first electronic device, where the data migration control value is used to determine whether to allow the first electronic device to migrate data to the second electronic device.
[0153] In the embodiments of the present application, when the data migration control value of the first electronic device and the data migration control value of the second electronic device are both greater than or equal to the first threshold, the blockchain network sends data migration permission information to the first electronic device, and the first electronic device can perform data migration only after receiving the data migration permission information, otherwise it cannot perform data migration.
[0154] In some possible implementations of the embodiments of the present application, the data migration device 300 applied to the blockchain network provided by the embodiments of the present application further includes:
[0155] A first adjustment module, configured to, when the data migration is successful, increase the data migration control value of the first electronic device and the data migration control value of the second electronic device according to the actual data volume sent by the first electronic device, the actual data volume received by the second electronic device, the expected data volume to be sent by the first electronic device, and the expected data volume to be received by the second electronic device.
[0156] In some possible implementations of the embodiments of the present application, the first adjustment module is specifically configured to:
[0157] Determine a first data migration control value according to the data migration control value of the first electronic device before data migration, the actual data volume sent by the first electronic device, the expected data volume to be sent by the first electronic device, and a control value increase coefficient; increase the data migration control value of the first electronic device to the first data migration control value;
[0158] Determine a second data migration control value according to the data migration control value of the second electronic device before data migration, the actual data volume received by the second electronic device, the expected data volume to be received by the second electronic device, and a control value increase coefficient; increase the data migration control value of the second electronic device to the second data migration control value.
[0159] In some possible implementations of the embodiments of the present application, the data migration device 300 applied to the blockchain network provided by the embodiments of the present application further includes:
[0160] A second adjustment module, configured to reduce the data migration control value of the first electronic device and the data migration control value of the second electronic device according to the actual data volume sent by the first electronic device, the actual data volume received by the second electronic device, the expected data volume to be sent by the first electronic device, and the expected data volume to be received by the second electronic device when data migration is abnormal.
[0161] In some possible implementations of the embodiments of the present application, the second adjustment module is specifically configured to:
[0162] Determine a third data migration control value according to the data migration control value of the first electronic device before data migration, the actual data volume sent by the first electronic device, the expected data volume to be sent by the first electronic device, and a control value decrease coefficient; reduce the data migration control value of the first electronic device to the third data migration control value;
[0163] Determine a fourth data migration control value according to the data migration control value of the second electronic device before data migration, the actual data volume received by the second electronic device, the expected data volume to be received by the second electronic device, and a control value decrease coefficient; reduce the data migration control value of the second electronic device to the fourth data migration control value.
[0164] In the embodiments of the present application, since data migration of the electronic device is allowed only when the data migration control value of the electronic device is greater than or equal to the first threshold, after each data migration is completed, by adjusting the data migration control value of the electronic device, it is possible to encourage the electronic device to make the actually sent data volume as close as possible to the expected sent data volume or make the actually received data volume as close as possible to the expected received data volume during each data migration, that is, to send as much data as possible or receive as much data as possible during each data migration, so that data migration can be performed when data migration is needed later.
[0165] In some possible implementations of the embodiments of the present application, the data migration device 300 applied to the blockchain network provided by the embodiments of the present application further includes:
[0166] A determination module, configured to determine a first location according to the first blockchain address corresponding to the first electronic device, the second blockchain address corresponding to the second electronic device, and a data migration identifier, where the data migration identifier is generated according to the first identity authentication result, the second identity authentication result, and the time corresponding to the data migration request sent by the first electronic device, the first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device.
[0167] In some possible implementations of the embodiments of the present application, the determination module is specifically configured to:
[0168] Perform a first logical operation on the first blockchain address, the second blockchain address, and the data migration identifier to obtain a first logical operation value;
[0169] Calculate the hash value of the first logical operation value to obtain the first location.
[0170] In the embodiments of the present application, generating a location for storing migrated data through the data migration identifier, the blockchain address corresponding to the first electronic device, and the blockchain address corresponding to the second electronic device can ensure that the storage location of the migrated data is associated with the data migration transaction and can avoid storing the migrated data at the location of other data, resulting in the loss of other data.
[0171] In some possible implementations of the embodiments of the present application, the data migration device 300 applied to the blockchain network provided by the embodiments of the present application further includes:
[0172] A third receiving module, configured to receive a data access request sent by the second electronic device, where the data access request includes the address information of the second electronic device;
[0173] Correspondingly, the second sending module 305 is specifically configured to:
[0174] When the address information of the second electronic device is the same as the address information of the electronic device corresponding to the identification information and the second electronic device passes the authentication, the first data stored at the first location is sent to the second electronic device.
[0175] In some possible implementations of the embodiments of the present application, the second receiving module 303 is specifically configured to:
[0176] Receive the fourth data sent by the first electronic device, where the fourth data is the data in the first format obtained by converting the format of the first data.
[0177] In the embodiments of the present application, through format conversion, the problems of data format and communication protocol differences between devices of different manufacturers can be effectively solved, and data migration between devices of different manufacturers can be realized.
[0178] The data migration device applied to the blockchain network provided by the embodiments of the present application can implement Figure 1 each process implemented by the data migration method embodiment applied to the blockchain network. To avoid repetition, it will not be elaborated here.
[0179] Figure 4 is a schematic structural diagram of the data migration device applied to the first electronic device. The data migration device 400 applied to the first electronic device may include:
[0180] A third sending module 401, configured to send a data migration request to the blockchain network, where the data migration request at least includes the identification information of the second electronic device;
[0181] A fourth receiving module 402, configured to receive the data migration permission information sent by the blockchain network in response to the data migration request;
[0182] A fourth sending module 403, configured to send the first data to the blockchain network after receiving the data migration permission information, so as to migrate the second data to the second electronic device through the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device.
[0183] In an embodiment of the present application, the first electronic device sends a data migration request to a blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends first data to the blockchain network, where the first data includes second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at a first location on the blockchain network, and then sends the first data stored at the first location to the second electronic device, realizing the migration of the second data from the first electronic device to the second electronic device through the blockchain. By utilizing the decentralization and immutability of the blockchain, the security of data during migration can be ensured, and data tampering or leakage can be prevented.
[0184] In some possible implementations of the embodiment of the present application, the data migration permission information includes a data migration identifier, which is generated by the blockchain network according to the first identity authentication result, the second identity authentication result, and the time corresponding to the data migration request sent by the first electronic device. The first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device; The data migration device 400 applied to the first electronic device provided in the embodiment of the present application further includes:
[0185] A second generation module, configured to generate a key according to the data migration identifier;
[0186] An encryption module, configured to encrypt the second data with the key to obtain third data;
[0187] Correspondingly, the first data includes the third data.
[0188] In the embodiment of the present application, by encrypting the migrated data, the security of data migration can be improved.
[0189] In some possible implementations of the embodiment of the present application, the second generation module is specifically configured to:
[0190] Use a key derivation function to calculate the function value corresponding to the data migration identifier; use the function value as the key.
[0191] In some possible implementations of the embodiment of the present application, the data migration device 400 applied to the first electronic device provided in the embodiment of the present application further includes:
[0192] A calculation module, configured to calculate the hash value of the third data;
[0193] A third generation module, configured to generate a data verification value according to a hash value of third data, where the data verification value is used by a second electronic device to perform integrity verification on received data;
[0194] Correspondingly, the first data further includes a data verification value.
[0195] In the embodiments of the present application, through data integrity verification, abnormal situations in the data migration process can be detected in a timely manner, ensuring the quality and reliability of the data.
[0196] In some possible implementations of the embodiments of the present application, the third generation module is specifically configured to:
[0197] Perform a logical operation on the hash value of the third data and a value related to an elliptic curve to obtain a data verification value.
[0198] In some possible implementations of the embodiments of the present application, the data migration device 400 applied to the first electronic device provided in the embodiments of the present application further includes:
[0199] A conversion module, configured to convert the first data into fourth data in a first format;
[0200] Correspondingly, the first data includes the fourth data.
[0201] In the embodiments of the present application, through format conversion, the problems of data format and communication protocol differences between devices of different manufacturers can be effectively solved, realizing data migration across devices of different manufacturers.
[0202] The first electronic device in the embodiments of the present application may be a terminal or other devices other than terminals. Exemplarily, the first electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., or may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0203] The first electronic device in the embodiments of the present application can be an electronic device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0204] Optionally, as Figure 5 shown, the embodiments of the present application further provide an electronic device 500, including a processor 501 and a memory 502. A program or instruction that can run on the processor 501 is stored on the memory 502. When the program or instruction is executed by the processor 501, it implements the various steps of the data migration method embodiments provided in the embodiments of the present application applied to the first electronic device, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0205] Figure 6 It is a schematic diagram of the hardware structure of the electronic device implementing the embodiments of the present application.
[0206] The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610, etc.
[0207] Those skilled in the art can understand that the electronic device 600 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 610 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 6 The structure of the electronic device shown in
[0208] does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0209] In an embodiment of the present application, the first electronic device sends a data migration request to the blockchain network. After receiving the data migration request sent by the first electronic device, the blockchain network sends data migration permission information to the first electronic device in response to the data migration request. After receiving the data migration permission information, the first electronic device sends the first data to the blockchain network, where the first data includes the second data that the first electronic device needs to migrate to the second electronic device. The blockchain network stores the first data at a first location on the blockchain network, and then sends the first data stored at the first location to the second electronic device, realizing the migration of the second data from the first electronic device to the second electronic device through the blockchain. Utilizing the decentralization and immutability of the blockchain can ensure the security of data during the migration process and prevent data from being tampered with or leaked.
[0210] In some possible implementations of the embodiment of the present application, the data migration permission information includes a data migration identifier, which is generated by the blockchain network based on the first identity authentication result, the second identity authentication result, and the time corresponding to the data migration request sent by the first electronic device. The first identity authentication result is the identity authentication result obtained by authenticating the electronic device 600, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device; the processor 610 is further configured to:
[0211] Generate a key according to the data migration identifier;
[0212] Encrypt the second data using the key to obtain the third data;
[0213] Correspondingly, the first data includes the third data.
[0214] In the embodiment of the present application, encrypting the migrated data can improve the security of data migration.
[0215] In some possible implementations of the embodiment of the present application, the processor 610 is specifically configured to:
[0216] Calculate the function value corresponding to the data migration identifier using a key derivation function; use the function value as the key.
[0217] In some possible implementations of the embodiment of the present application, the processor 610 is further configured to:
[0218] Calculate the hash value of the third data;
[0219] Generate a data verification value according to the hash value of the third data, where the data verification value is used for the second electronic device to perform integrity verification on the received data;
[0220] Correspondingly, the first data further includes the data verification value.
[0221] In the embodiments of the present application, through data integrity verification, abnormal situations during the data migration process can be detected in a timely manner, ensuring the quality and reliability of the data.
[0222] In some possible implementations of the embodiments of the present application, the processor 610 is specifically configured to:
[0223] Perform a logical operation on the hash value of the third data and the value related to the elliptic curve to obtain a data verification value.
[0224] In some possible implementations of the embodiments of the present application, the processor 610 is further configured to:
[0225] The conversion module is configured to convert the first data into the fourth data in the first format;
[0226] Correspondingly, the first data includes the fourth data.
[0227] In the embodiments of the present application, through format conversion, the problems of data format and communication protocol differences between devices of different manufacturers can be effectively solved, realizing data migration across devices of different manufacturers.
[0228] It should be understood that in the embodiments of the present application, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The graphics processing unit 6041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. The other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0229] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 609 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.
[0230] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 610 either.
[0231] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the data migration method embodiment applied to the first electronic device provided by the embodiments of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0232] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium. Examples of computer-readable storage media include non-transitory computer-readable media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs, etc.
[0233] An embodiment of the present application also provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the data migration method embodiment applied to the first electronic device provided in the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0234] It should be understood that the chip mentioned in the embodiment of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0235] An embodiment of the present application also provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the data migration method embodiment applied to the first electronic device provided in the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0236] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0237] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0238] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A data migration method, characterized in that: Applied to a blockchain network, the method comprises: receiving a data migration request sent by a first electronic device, wherein the data migration request at least includes identification information of a second electronic device; In response to the data migration request, sending data migration permission information to the first electronic device; receiving first data sent by the first electronic device, wherein the first data includes second data that the first electronic device needs to migrate to the second electronic device, and the first data is sent by the first electronic device after receiving the data migration permission information; storing the first data at a first location on the blockchain network; The first data stored in the first location is sent to the second electronic device according to the identification information.
2. The method according to claim 1, characterized in that Before sending the data migration permission information to the first electronic device, the method further includes: Performing identity authentication on the first electronic device and the second electronic device; The sending of data migration permission information to the first electronic device includes: When the first electronic device and the second electronic device pass identity authentication, the data migration permission information is sent to the first electronic device.
3. The method according to claim 2, characterized in that The data migration permission information includes a data migration identifier, and the data migration identifier is used by the first electronic device to generate a key for encrypting the second data, and to encrypt the second data using the key to obtain third data; The first data includes the third data; Before sending the data migration permission information to the first electronic device, the method further includes: The data migration identifier is generated according to the first identity authentication result, the second identity authentication result and the time corresponding to the first electronic device sending the data migration request, wherein the first identity authentication result is the identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is the identity authentication result obtained by authenticating the second electronic device.
4. The method according to claim 3, characterized in that The first data also includes: a data verification value, wherein the data verification value is generated by the first electronic device according to the hash value corresponding to the third data, and the data verification value is used by the second electronic device to perform integrity verification on the received data.
5. The method according to claim 1, characterized in that The sending of data migration permission information to the first electronic device includes: When the data migration control value of the first electronic device and the data migration control value of the second electronic device are both greater than or equal to a first threshold, data migration permission information is sent to the first electronic device, and the data migration control value is used to determine whether the first electronic device is allowed to migrate data to the second electronic device.
6. The method according to claim 5, characterized in that The method further comprises: When data migration is successful, the data migration control value of the first electronic device and the data migration control value of the second electronic device are increased according to the amount of data actually sent by the first electronic device, the amount of data actually received by the second electronic device, the amount of data expected to be sent by the first electronic device, and the amount of data expected to be received by the second electronic device.
7. The method according to claim 6, characterized in that The increasing the data migration control value of the first electronic device and the data migration control value of the second electronic device includes: determining a first data migration control value according to the data migration control value of the first electronic device before data migration, the amount of data actually sent by the first electronic device, the amount of data expected to be sent by the first electronic device, and a control value increase coefficient; and increasing the data migration control value of the first electronic device to the first data migration control value; Determine the second data migration control value based on the data migration control value of the second electronic device before data migration, the amount of data actually received by the second electronic device, the amount of data expected to be received by the second electronic device and the control value improvement coefficient; and increase the data migration control value of the second electronic device to the second data migration control value.
8. The method according to claim 5, characterized in that The method further comprises: In the event of an abnormality in data migration, the data migration control value of the first electronic device and the data migration control value of the second electronic device are reduced according to the amount of data actually sent by the first electronic device, the amount of data actually received by the second electronic device, the amount of data expected to be sent by the first electronic device, and the amount of data expected to be received by the second electronic device.
9. The method according to claim 8, characterized in that The reducing the data migration control value of the first electronic device and the data migration control value of the second electronic device includes: determining a third data migration control value according to the data migration control value of the first electronic device before data migration, the amount of data actually sent by the first electronic device, the amount of data expected to be sent by the first electronic device, and a control value reduction coefficient; reducing the data migration control value of the first electronic device to the third data migration control value; Determine a fourth data migration control value based on the data migration control value of the second electronic device before data migration, the amount of data actually received by the second electronic device, the amount of data expected to be received by the second electronic device and the control value reduction coefficient; and reduce the data migration control value of the second electronic device to the fourth data migration control value.
10. The method according to claim 1, characterized in that Before storing the first data at the first location on the blockchain network, the method further includes: The first position is determined according to a first blockchain address corresponding to the first electronic device, a second blockchain address corresponding to the second electronic device, and a data migration identifier, wherein the data migration identifier is generated according to a first identity authentication result, a second identity authentication result, and a time corresponding to when the first electronic device sends the data migration request, the first identity authentication result is an identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is an identity authentication result obtained by authenticating the second electronic device.
11. The method according to claim 10, characterized in that The determining the first location according to the first blockchain address corresponding to the first electronic device, the second blockchain address corresponding to the second electronic device, and the data migration identifier includes: Perform a first logical operation on the first blockchain address, the second blockchain address, and the data migration identifier to obtain a first logical operation value; A hash value of the first logical operation value is calculated to obtain the first position.
12. The method according to claim 1, characterized in that Before sending the first data stored in the first location to the second electronic device according to the identification information, the method further includes: receiving a data access request sent by the second electronic device, wherein the data access request includes address information of the second electronic device; The sending, according to the identification information, the first data stored in the first location to the second electronic device includes: When the address information of the second electronic device is the same as the address information of the electronic device corresponding to the identification information and the second electronic device passes the identity authentication, the first data stored in the first location is sent to the second electronic device.
13. The method according to claim 1, characterized in that The receiving the first data sent by the first electronic device includes: Fourth data sent by the first electronic device is received, wherein the fourth data is data in a first format obtained by format-converting the second data.
14. A data migration method, characterized in that: Applied to a first electronic device, the method includes: Sending a data migration request to the blockchain network, wherein the data migration request includes at least identification information of the second electronic device; Receiving data migration permission information sent by the blockchain network in response to the data migration request; After receiving the data migration permission information, first data is sent to the blockchain network to migrate second data to the second electronic device through the blockchain network, wherein the first data includes second data that the first electronic device needs to migrate to the second electronic device.
15. The method according to claim 14, characterized in that The data migration permission information includes a data migration identifier, which is generated by the blockchain network according to a first identity authentication result, a second identity authentication result, and a time corresponding to when the first electronic device sends the data migration request, wherein the first identity authentication result is an identity authentication result obtained by authenticating the first electronic device, and the second identity authentication result is an identity authentication result obtained by authenticating the second electronic device; Before sending the first data to the blockchain network, the method further includes: Generate a key according to the data migration identifier; encrypting the second data using the key to obtain third data; The first data includes the third data.
16. The method according to claim 15, characterized in that The step of generating a key according to the data migration identifier includes: A key derivation function is used to calculate a function value corresponding to the data migration identifier; and the function value is used as the key.
17. The method according to claim 15, characterized in that Before sending the first data to the blockchain network, the method further includes: Calculating a hash value of the third data; Generate a data check value according to the hash value of the third data, wherein the data check value is used by the second electronic device to perform integrity check on the received data; The first data also includes the data check value.
18. The method according to claim 17, characterized in that Generating a data check value according to the hash value of the third data includes: A logical operation is performed on the hash value of the third data and a value related to the elliptic curve to obtain a data verification value.
19. The method according to claim 14, characterized in that Before sending the first data to the blockchain network, the method further includes: Convert the second data into a first format to obtain fourth data in a first format; The first data includes the fourth data.
20. A data migration device, characterized in that: Applied to a blockchain network, the device comprises: A first receiving module, configured to receive a data migration request sent by a first electronic device, wherein the data migration request at least includes identification information of a second electronic device; A first sending module, configured to send data migration permission information to the first electronic device in response to the data migration request; A second receiving module is configured to receive first data sent by the first electronic device, wherein the first data includes second data that the first electronic device needs to migrate to the second electronic device, and the first data is sent by the first electronic device after receiving the data migration permission information; A storage module, configured to store the first data at a first location on the blockchain network; The second sending module is used to send the first data stored in the first location to the second electronic device according to the identification information.
21. A data migration device, characterized in that: Applied to a first electronic device, the device comprises: A third sending module, configured to send a data migration request to the blockchain network, wherein the data migration request includes at least identification information of the second electronic device; A fourth receiving module, configured to receive data migration permission information sent by the blockchain network in response to the data migration request; The fourth sending module is used to send the first data to the blockchain network after receiving the data migration permission information, so as to migrate the second data to the second electronic device through the blockchain network, wherein the first data includes the second data that the first electronic device needs to migrate to the second electronic device.
22. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the data migration method as described in any one of claims 14-19 are implemented.
23. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the data migration method as described in any one of claims 14-19 are implemented.