Data transmission method and electronic equipment
By establishing WiFi Direct connections between electronic devices and using file transfer channels and file streaming channels to transmit different types of file data, the problem of low data transmission efficiency is solved, achieving more efficient data transmission and reducing user waiting time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-04-07
AI Technical Summary
In scenarios such as data migration, mobile phone cloning, and mobile phone relocation, the low data transmission efficiency between electronic devices in existing technologies leads to excessively long waiting times for users.
By establishing a WiFi direct connection between electronic devices, and simultaneously using a file transfer channel and a file stream transfer channel to transfer different types of file data, the file transfer channel is used to transfer files with a data size less than a preset threshold, and the file stream transfer channel is used to transfer files with a data size greater than or equal to the preset threshold, and multiple queues and pipes are used for parallel data transmission.
It improved data transmission efficiency, reduced user waiting time, and enhanced user experience.
Smart Images

Figure CN121815450A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a data transmission method and an electronic device. BACKGROUND
[0002] In the scenarios of data migration, mobile phone cloning and mobile phone moving, data such as gallery files, application cache data and third-party application packages need to be transmitted between two terminals. At present, two terminals that need to transmit data generally use a file transmission protocol to send data to be transmitted to the other terminal. However, this mode has low transmission efficiency, needs to spend a long time, and leads to poor user experience. SUMMARY
[0003] Embodiments of the present application provide a data transmission method and an electronic device to solve the problem of long waiting time when a large amount of data is transmitted between electronic devices.
[0004] In a first aspect, an embodiment of the present application provides a data transmission method applied to a first electronic device, and the method comprises the following steps.
[0005] The first electronic device establishes WiFi direct connection with a second electronic device.
[0006] The first electronic device establishes a file transmission channel and a first file stream transmission channel with the second electronic device in response to a received user operation, and the user operation is used to instruct to send data of a plurality of files to the second electronic device, wherein the plurality of files comprises a first file and a second file.
[0007] The first electronic device sends data of the first file to the second electronic device through the file transmission channel.
[0008] The first electronic device sends data of the second file to the second electronic device through the first file stream transmission channel.
[0009] The above method can establish two data channels, i.e., a file transmission channel and a file stream transmission channel, when the first electronic device needs to transmit a plurality of files to the second electronic device, so that the two channels are used to transmit data of the files at the same time, the efficiency of data transmission is improved, and the waiting time of the user is reduced.
[0010] It should be noted that the first electronic device is also referred to as an old device or an old mobile phone, and the second electronic device is also referred to as a new device or a new mobile phone.
[0011] In a possible implementation, the first file is a file of a gallery, a document or an application package, i.e., a first type of file, and the second file is cache data of an application, i.e., a second type of file.
[0012] The above method transmits gallery files, documents, or application packages via a file transfer channel, and transmits application cache data via a file stream transfer channel.
[0013] In one possible implementation, the data volume of the first file is greater than a preset threshold, i.e., it is a first type of file; the data volume of the second file is less than or equal to the preset threshold, i.e., it is a first type of file.
[0014] The above method transmits small files through a file transfer channel and large files through a file stream transfer channel.
[0015] In one possible implementation, prior to establishing the file transfer channel and the first file stream transfer channel, the method further includes:
[0016] When the total amount of data in the multiple files exceeds a preset value, the first electronic device modifies the bandwidth of the WiFi direct connection, and the modified bandwidth is greater than the original bandwidth.
[0017] In the above method, the first electronic device and the second electronic device first establish a WiFi direct connection with the default bandwidth, that is, a WiFi physical connection. Furthermore, when the total amount of data of the multiple files to be transmitted is greater than a preset value, a larger bandwidth is used to improve the data transmission efficiency.
[0018] In one possible implementation, establishing a file transfer channel with the second electronic device specifically includes:
[0019] The first electronic device creates the first session;
[0020] The first electronic device sends a first request to the second electronic device. The first request carries the identifier of the first session and the first session type. The first request is used to request the second electronic device to create a second session corresponding to the first session.
[0021] The first electronic device receives a first response message, which carries the identifier of the first session and the identifier of the second session.
[0022] The above method provides a way to establish a file transfer channel to facilitate the transfer of file-type data.
[0023] In one possible implementation, the first electronic device includes an application layer, an application framework layer, and a system library, wherein the application framework layer includes a transport service platform, and the system library includes a transport dynamic library.
[0024] The method further includes: the application layer sending a first instruction to the transmission service platform, the first instruction carrying the first file path of each of the M files; the M files include the first file;
[0025] The first electronic device creates a first session, specifically including: the transmission service platform responding to the first instruction and creating the first session;
[0026] The method further includes: the transmission service platform sending a first start command to the transmission dynamic library, the first start command carrying the first file path of each file in the M files; the transmission dynamic library responding to the first start command, starting a first client, and saving the first file path of each file in the M files;
[0027] The step of sending the data of the first file to the second electronic device through the file transfer channel specifically includes:
[0028] The first client obtains the data of the first file based on the first file path of the first file, and sends the data of the first file and the identifier of the first session to the second electronic device.
[0029] In one possible implementation, the transport dynamic library further includes a sending engine, wherein sending the data of the first file and the identifier of the first session to the second electronic device specifically includes:
[0030] When the data volume of the first file is less than or equal to a first threshold, the first client puts the data packet of the first file into a first queue; the data packet of the first file includes the identifier of the first session and part or all of the data of the first file;
[0031] When the data volume of the first file is greater than the first threshold and less than the second threshold, the first client puts the data packet of the first file into the second queue;
[0032] When the data volume of the first file is greater than or equal to the second threshold, the first client puts the data packet of the first file into the third queue;
[0033] The first client sends data packets from the first queue, the second queue, and the third queue to the sending engine in parallel;
[0034] The sending engine sends the received data packets to the second electronic device.
[0035] In another implementation, the first electronic device may set up more or fewer queues than three queues, for example, including the first queue and the second queue mentioned above, where the first threshold is equal to the second threshold, without limitation.
[0036] In the above method, for the first type of file, the first client can put the file into different queues based on the size of the file data, so that the sending tasks in the three queues can be carried out in parallel. On the one hand, this can improve the file sending efficiency, and on the other hand, it can also avoid large files occupying too much resources and small files being unable to be sent.
[0037] In one possible implementation, the method further includes:
[0038] The first client determines whether the first queue, the second queue, and the third queue contain data packets to be sent;
[0039] When the first client does not contain a data packet to be sent in the first queue and the data volume of the first file is greater than the first threshold, the first client puts the data packet of the first file into the first queue.
[0040] When the first client does not have a data packet to be sent in the second queue, and the data volume of the first file is less than or equal to the first threshold or greater than the second threshold, the first client puts the data packet of the first file into the second queue.
[0041] When the third queue does not contain any data packets to be sent and the data volume of the first file is less than the second threshold, the first client places the data packets of the first file into the third queue.
[0042] The above method allows large files to be transmitted through the small file task queue when there are few or no small file transmission tasks, and small files to be transmitted through the large file transmission task queue when there are few or no large file transmission tasks, thereby improving data transmission efficiency when small or large files are concentrated.
[0043] In one possible implementation, the first electronic device and the second electronic device establish a first file stream transmission channel, specifically including:
[0044] The first electronic device creates a third session;
[0045] The first electronic device sends a second request to the second electronic device. The second request carries the identifier of the third session and the second session type. The second request is used to request the second electronic device to create a fourth session corresponding to the third session.
[0046] The first electronic device receives a second response message, which carries the identifier of the third session and the identifier of the fourth session.
[0047] The above method provides a way to establish a file stream transmission channel to facilitate the transmission of the second type of file.
[0048] Optionally, the first electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transmission service platform, the system library includes a transmission dynamic library, and the transmission dynamic library includes a transmission engine.
[0049] The method further includes: the application layer creating a first pipe and sending a second instruction to the transmission service platform, the second instruction carrying the output FD of the first pipe;
[0050] The creation of the third session specifically includes: the transmission service platform responding to the second instruction to create a third session corresponding to the first pipe;
[0051] The method further includes: the transmission service platform sending a third start command to the transmission dynamic library, the third start command carrying the identifier of the third session and the output FD of the first pipe; the transmission dynamic library responding to the third start command starts a second client and saves the identifier of the third session and the output FD of the first pipe.
[0052] The first electronic device sends the data of the second file to the second electronic device through the first file stream transmission channel, specifically including: the application layer writing the data of the second file into the first pipe based on the ingress FD of the first pipe; the second client reading the data of the second file from the first pipe based on the egress FD of the first pipe; the second client sending the data packet of the second file to the sending engine; the data packet of the second file including the data of the second file read from the first pipe and the identifier of the third session; and the sending engine sending the received data packet of the second file to the second electronic device.
[0053] In the above method, the first electronic device performs inter-process communication through a pipe, transmitting the data of the application layer file to the second client in the system library through the pipe, so as to further transmit the data of the second file in the form of a data stream.
[0054] In one possible implementation, the plurality of files further includes a third file, and the method further includes:
[0055] In response to the user's operation, the first electronic device establishes a second file stream transmission channel with the second electronic device;
[0056] The first electronic device sends the data of the third file to the second electronic device through the second file stream transmission channel.
[0057] The above method allows two files of the second type (the second file and the third file) to be transmitted concurrently through different sessions, improving the efficiency of file transmission.
[0058] Optionally, the first electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transmission service platform, the system library includes a transmission dynamic library, and the transmission dynamic library includes a transmission engine.
[0059] The establishment of a second file stream transmission channel with the second electronic device specifically includes: the application layer creating a second pipe and sending a third instruction to the transmission service platform, the third instruction carrying the output FD of the third pipe; the transmission service platform responding to the third instruction creating a fifth session corresponding to the third pipe; the transmission service platform sending a third start instruction to the transmission dynamic library, the fifth start instruction carrying the identifier of the fifth session and the output FD of the third pipe; the transmission dynamic library responding to the fifth start instruction starting a third client and saving the identifier of the fifth session and the output FD of the third pipe.
[0060] The first electronic device sends the data of the third file to the second electronic device through the second file stream transmission channel, specifically including: the application layer writing the data of the third file into the third pipe based on the ingress FD of the third pipe; the third client reading the data of the third file from the third pipe based on the egress FD of the third pipe; the third client sending the data packet of the third file to the sending engine; the data packet of the third file including the data of the third file read from the third pipe and the identifier of the fifth session; the sending engine sending the received data packet of the third file to the second electronic device.
[0061] In the above method, the first electronic device performs inter-process communication through a pipe, transmitting the data of the application layer file to the second client in the system library through the pipe, so as to further transmit the data of the third file in the form of a data stream.
[0062] In one possible implementation, the plurality of files further includes a fourth file, and the method further includes:
[0063] In response to the user's operation, the first electronic device establishes a third file stream transmission channel with the second electronic device;
[0064] The first electronic device sends the data of the fourth file to the second electronic device through the third file stream transmission channel.
[0065] The above method allows multiple files of the second type (second file, third file, and fourth file) to be transmitted concurrently through different sessions, improving the efficiency of file transmission.
[0066] Optionally, the first electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transmission service platform, the system library includes a transmission dynamic library, and the transmission dynamic library includes a transmission engine.
[0067] The establishment of a third file stream transmission channel with the second electronic device specifically includes: the application layer creating a fifth pipe and sending a fourth instruction to the transmission service platform, the fourth instruction carrying the output FD of the fifth pipe; the transmission service platform responding to the fourth instruction creating a seventh session corresponding to the fifth pipe; the transmission service platform sending a seventh start instruction to the transmission dynamic library, the seventh start instruction carrying the identifier of the seventh session and the output FD of the fifth pipe; the transmission dynamic library responding to the seventh start instruction starting a fourth client and saving the identifier of the seventh session and the output FD of the fifth pipe;
[0068] The first electronic device sends the data of the fourth file to the second electronic device through the third file stream transmission channel, specifically including: the application layer writing the data of the fourth file into the fifth pipe based on the ingress FD of the fifth pipe; the fourth client reading the data of the fourth file from the fifth pipe based on the egress FD of the fifth pipe; the fourth client sending the data packet of the fourth file to the sending engine; the data packet of the fourth file including the data of the fourth file read from the fifth pipe and the identifier of the seventh session; and the sending engine sending the received data packet of the fourth file to the second electronic device.
[0069] In the above method, the first electronic device performs inter-process communication through a pipe, transmitting the data of the application layer file to the second client in the system library through the pipe, so as to further transmit the data of the fourth file in the form of a data stream.
[0070] Secondly, embodiments of this application also provide a data transmission method applied to a second electronic device, the method comprising:
[0071] The second electronic device establishes a direct WiFi connection with the first electronic device;
[0072] The second electronic device establishes a file transfer channel and a first file stream transfer channel with the first electronic device;
[0073] The second electronic device receives data from the first electronic device for a first file via the file transfer channel;
[0074] The second electronic device receives data from the second file of the first electronic device through the first file stream transmission channel.
[0075] The above method allows the first electronic device to establish dual data channels when it needs to transfer multiple files with the second electronic device. That is, it can establish a file transfer channel and a file stream transfer channel, so that the data of the files to be transferred can be used simultaneously, thereby improving the efficiency of data transmission and reducing the user's waiting time.
[0076] It should be noted that the first electronic device is also called an old device or an old mobile phone, and the second electronic device is also called a new device or a new mobile phone.
[0077] In one possible implementation, the first file is a gallery file, document, or application package, i.e., a first type of file, and the second file is application cache data, i.e., a second type of file.
[0078] In one possible implementation, the data volume of the first file is greater than a preset threshold, i.e., it is a first type of file; the data volume of the second file is less than or equal to the preset threshold, i.e., it is a second type of file.
[0079] In one possible implementation, establishing a file transfer channel with the first electronic device specifically includes: receiving a first request from the first electronic device, the first request carrying an identifier of a first session and a first session type; in response to the first request, if the first session type is a file session, creating a second session corresponding to the first session; and sending first response information to the first electronic device, the first response information carrying an identifier of the first session and an identifier of the second session.
[0080] Optionally, the second electronic device includes an application layer, an application framework layer, and a system library, wherein the application framework layer includes a transport service platform, and the system library includes a transport dynamic library.
[0081] The receipt of the first request from the first electronic device specifically includes: the transmission service platform receiving the first request from the first electronic device, wherein the first request further includes the first file path of M files, and the M files include the first file;
[0082] The step of responding to the first request and creating a second session corresponding to the first session when the first session type is a file session includes: the transmission service platform creating a second session corresponding to the first session when the first session type is a file session;
[0083] The method further includes: the transmission service platform generating a second file path for the M files based on the first file path of the M files; the transmission service platform sending a second start command to the transmission dynamic library, the second start command carrying the identifier of the second session and the second file path of the M files; the transmission dynamic library responding to the second start command starting a first server and saving the identifier of the second session and the second file path of the M files;
[0084] The step of sending the first response information to the first electronic device specifically includes: the transmission service platform sending the first response information to the first electronic device;
[0085] The second electronic device receives data from the first electronic device's first file through the file transfer channel, specifically including: the first server receiving a data packet from the first electronic device's first file, the data packet of the first file including part or all of the first file's data and the identifier of the first session; and writing part or all of the first file's data to the second file path of the first file.
[0086] In one possible implementation, establishing a first file stream transmission channel with the first electronic device specifically includes:
[0087] The second electronic device receives a second request from the first electronic device, the second request carrying an identifier of a third session and a second session type;
[0088] In response to the second request, the second electronic device creates a fourth session corresponding to the third session when the second session type is a file stream session;
[0089] The second electronic device sends a second response message to the first electronic device, the second response message carrying the identifier of the third session and the identifier of the fourth session.
[0090] Optionally, the second electronic device includes an application layer, an application framework layer, and a system library, wherein the application framework layer includes a transport service platform, and the system library includes a transport dynamic library.
[0091] The receipt of the second request from the first electronic device specifically includes: the transmission service platform receiving the second request from the first electronic device;
[0092] In response to the second request, when the second session type is a file stream session, creating a fourth session corresponding to the third session specifically includes: the transmission service platform, in response to the second request, creating a fourth session corresponding to the third session when the second session type is a file stream session;
[0093] The method further includes: the transport service platform sending a first creation instruction to the application layer, the first creation instruction including an identifier of a fourth session; the application layer responding to the first creation instruction creating a second pipe and sending the identifier of the fourth session and the ingress file descriptor (FD) of the second pipe to the transport service platform; the transport service platform sending a fourth startup instruction to the transport dynamic library, the fourth startup instruction carrying the identifier of the fourth session and the ingress FD of the second pipe; the transport dynamic library responding to the fourth startup instruction starting a second server; the second server saving the identifier of the fourth session and the ingress FD of the second pipe, and sending a fourth notification to the transport server platform, the fourth notification indicating that the second server has started successfully;
[0094] Sending the second response information to the first electronic device specifically includes: the transmission service platform sending the second response information to the first electronic device.
[0095] Optionally, the second electronic device receives data from the second file of the first electronic device through the first file stream transmission channel, specifically including:
[0096] The second server receives a data packet from the first electronic device containing the data of the second file and an identifier of the third session.
[0097] The second server determines the identifier of the fourth session corresponding to the identifier of the third session;
[0098] The second server writes the data of the second file into the second pipe through the inlet FD of the second pipe corresponding to the identifier of the fourth session;
[0099] The application layer reads data from the second file from the second pipe based on the output FD of the second pipe.
[0100] In one possible implementation, the method further includes:
[0101] The second electronic device establishes a second file stream transmission channel with the first electronic device;
[0102] The second electronic device receives data from the third file of the first electronic device through the second file stream transmission channel.
[0103] In one possible implementation, establishing a second file stream transmission channel with the first electronic device specifically includes:
[0104] The second electronic device receives a third request from the first electronic device, the third request carrying an identifier of the fifth session and a second session type;
[0105] In response to the third request, the second electronic device creates a sixth session corresponding to the fifth session when the second session type is a file stream session;
[0106] The second electronic device sends a third response message to the first electronic device, the third response message carrying the identifier of the fifth session and the identifier of the sixth session.
[0107] Optionally, the second electronic device includes an application layer, an application framework layer, and a system library, wherein the application framework layer includes a transport service platform, and the system library includes a transport dynamic library.
[0108] The receiving of the third request from the first electronic device specifically includes: the transmission service platform receiving the third request from the first electronic device;
[0109] In response to the third request, when the second session type is a file stream session, the creation of the sixth session corresponding to the fifth session specifically includes: the transmission service platform, in response to the third request, creating the sixth session corresponding to the fifth session when the second session type is a file stream session;
[0110] The method further includes: the transport service platform sending a second creation instruction to the application layer, the second creation instruction including an identifier of a sixth session; the application layer responding to the second creation instruction creating a fourth pipe and sending the identifier of the sixth session and the ingress file descriptor (FD) of the fourth pipe to the transport service platform; the transport service platform sending a sixth startup instruction to the transport dynamic library, the sixth startup instruction carrying the identifier of the sixth session and the ingress FD of the fourth pipe; the transport dynamic library responding to the sixth startup instruction starting a third server; the third server saving the identifier of the sixth session and the ingress FD of the fourth pipe, and sending a sixth notification to the transport server platform, the sixth notification indicating that the third server has started successfully.
[0111] Sending the third response information to the first electronic device specifically includes: the transmission service platform sending the third response information to the first electronic device.
[0112] Optionally, the second electronic device receives data from the third file of the first electronic device through the first file stream transmission channel, specifically including:
[0113] The second server receives a data packet of a third file from the first electronic device, the data packet of the third file including the data of the third file and the identifier of the fifth session;
[0114] The second server determines the identifier of the sixth session corresponding to the identifier of the fifth session;
[0115] The second server writes the data of the third file into the fourth pipe through the inlet FD of the fourth pipe corresponding to the identifier of the sixth session;
[0116] The application layer reads data from the third file from the fourth pipe based on the output FD of the fourth pipe.
[0117] In one possible implementation, the method further includes:
[0118] The second electronic device establishes a third file stream transmission channel with the first electronic device;
[0119] The second electronic device receives data from the fourth file of the first electronic device through the third file stream transmission channel.
[0120] In one possible implementation, establishing a third file stream transmission channel with the first electronic device specifically includes:
[0121] The second electronic device receives a fourth request from the first electronic device, the fourth request carrying the identifier of the seventh session and the second session type;
[0122] In response to the fourth request, the second electronic device creates an eighth session corresponding to the seventh session when the second session type is a file stream session;
[0123] The second electronic device sends a fourth response message to the first electronic device, the fourth response message carrying the identifier of the seventh session and the identifier of the eighth session.
[0124] Optionally, the second electronic device includes an application layer, an application framework layer, and a system library, wherein the application framework layer includes a transport service platform, and the system library includes a transport dynamic library.
[0125] Receiving the fourth request from the first electronic device specifically includes: the transmission service platform receiving the fourth request from the first electronic device;
[0126] In response to the fourth request, when the second session type is a file stream session, the creation of the eighth session corresponding to the seventh session specifically includes: when the transmission service platform responds to the fourth request, when the second session type is a file stream session, the creation of the eighth session corresponding to the seventh session;
[0127] The method further includes: the transport service platform sending a third creation instruction to the application layer, the third creation instruction including an identifier of an eighth session; the application layer responding to the third creation instruction creating a sixth pipe and sending the identifier of the eighth session and the ingress file descriptor (FD) of the sixth pipe to the transport service platform; the transport service platform sending an eighth startup instruction to the transport dynamic library, the eighth startup instruction carrying the identifier of the eighth session and the ingress FD of the fourth pipe; the transport dynamic library responding to the eighth startup instruction starting a fourth server; the fourth server saving the identifier of the eighth session and the ingress FD of the sixth pipe, and sending an eighth notification to the transport server platform, the eighth notification indicating that the fourth server has started successfully.
[0128] Sending the fourth response information to the first electronic device specifically includes: the transmission service platform sending the fourth response information to the first electronic device.
[0129] Optionally, the second electronic device receives data from the fourth file of the first electronic device through the third file stream transmission channel, specifically including:
[0130] The second server receives a data packet of the fourth file from the first electronic device, the data packet of the fourth file including the data of the fourth file and the identifier of the seventh session;
[0131] The second server determines the identifier of the eighth session corresponding to the identifier of the seventh session;
[0132] The second server writes the data of the fourth file into the sixth pipe through the inlet FD of the sixth pipe corresponding to the identifier of the eighth session;
[0133] The application layer reads data from the fourth file from the sixth pipe based on the output FD of the sixth pipe.
[0134] Thirdly, embodiments of this application also provide an electronic device, including a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to implement the method as described in the first aspect or any possible implementation of the first aspect.
[0135] Fourthly, embodiments of this application also provide an electronic device, including a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to implement the method as described in the second aspect or any possible implementation of the second aspect.
[0136] Fifthly, embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions that, when executed, cause an electronic device to perform the method as described in the first aspect or any possible implementation of the first aspect.
[0137] In a sixth aspect, embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions that, when executed, cause an electronic device to perform the method as described in the second aspect or any possible implementation of the second aspect.
[0138] In a seventh aspect, embodiments of this application provide a computer program product, which includes computer program code that, when executed on a computer, causes an electronic device to implement the method described in the first aspect or any possible implementation of the first aspect.
[0139] Eighthly, embodiments of this application provide a computer program product including computer program code that, when executed on a computer, causes an electronic device to implement the method described in the second aspect or any possible implementation of the second aspect.
[0140] Ninthly, embodiments of this application provide a chip system including at least one processor for implementing the method as described in the first aspect or any possible implementation of the first aspect.
[0141] In a tenth aspect, embodiments of this application provide a chip system including at least one processor for implementing the method as described in the second aspect or any possible implementation of the second aspect.
[0142] It should be understood that the second to tenth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding possible implementations are similar, and will not be repeated here. Attached Figure Description
[0143] Figure 1 This application provides a schematic diagram of the structure of a communication system according to an embodiment of the present application.
[0144] Figure 2 A flowchart illustrating a data transmission method provided in an embodiment of this application;
[0145] Figures 3A to 3L A schematic diagram of a user interface involved in a data transmission method provided in an embodiment of this application;
[0146] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0147] Figure 5A A schematic diagram of the hardware and software structure of an electronic device provided in an embodiment of this application;
[0148] Figure 5B A schematic diagram of the software structure of a first electronic device and a second electronic device in a specific application scenario, provided for embodiments of this application;
[0149] Figure 6A A schematic diagram illustrating the process of establishing a WiFi physical connection between a new mobile phone and an old mobile phone, the process of establishing a file transfer channel, and the process of transferring a first type of file, provided in this embodiment of the application.
[0150] Figure 6B A flowchart illustrating the process of transferring cached data of a first application from an old mobile phone to a new mobile phone, as provided in an embodiment of this application.
[0151] Figure 6C A flowchart illustrating the process of transferring cached data of a second application from an old mobile phone to a new mobile phone, as provided in an embodiment of this application.
[0152] Figure 6D A flowchart illustrating the process of transferring cached data of a third application from an old mobile phone to a new mobile phone, as provided in an embodiment of this application.
[0153] Figure 6E A flowchart illustrating the progress prompts and data recovery process for a new mobile phone provided in this application embodiment;
[0154] Figure 7 A schematic flowchart illustrating a method for placing a file data packet into a queue, as provided in an embodiment of this application;
[0155] Figure 8 A schematic diagram illustrating the priority strategy set for embodiments of this application;
[0156] Figure 9 A flowchart illustrating the data transmission method provided in an embodiment of this application;
[0157] Figure 10 A flowchart illustrating another data transmission method provided in this application embodiment. Detailed Implementation
[0158] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0159] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0160] First, a brief explanation of the technical terms involved in the embodiments of this application will be given.
[0161] (1) A session is a temporary, interactive information exchange between two or more electronic devices. Sessions are distinguished by identifiers that differentiate between different users and different sessions. For example, when a first electronic device 10 needs to send file data to a second electronic device 20, it creates a session (Session_A). The second electronic device 20 then creates a session (Session_B) corresponding to Session_A. When sending file data to the second electronic device 20, the identifier of Session_A is carried. The second electronic device 20 determines the corresponding session Session_B based on the identifier of Session_A and then saves the file data.
[0162] (2) A pipe is a method of inter-process communication. A parent process creates a pipe and obtains two file descriptors (FDs) pointing to the two ends of the pipe, i.e., the output end and the input end. The parent process then creates a child process, which includes one FD pointing to either the output or input end of the same pipe, or two FDs pointing to both the output and input ends of the same pipe. The parent process can write data to the pipe, and the child process can read data from the pipe; conversely, the child process can write data to the pipe, and the parent process can read data from the pipe, thus achieving inter-process communication. For example, in this embodiment, the parent process can be the process of the application "Mobile Cloner" installed in the first electronic device.
[0163] The data transmission method provided in this application can be applied to scenarios such as data migration, mobile phone cloning, and mobile phone relocation, which require the transmission of large amounts of data with diverse data types.
[0164] Figure 1 The diagram illustrates the structure of a communication system according to an embodiment of this application. This communication system may include multiple devices, such as a first electronic device 10 and a second electronic device 20. The first electronic device 10 can initiate data transmission services to the second electronic device 20. The end initiating the data transmission service (i.e., the first electronic device) is also called the client, and the end receiving the data (i.e., the second electronic device) is also called the server. In some scenarios, it is necessary to transfer some files from the first electronic device 10 to the second electronic device 20. For example, the first electronic device 10 may be an old mobile phone or an old electronic device, and the second electronic device may be a new mobile phone or a new electronic device. It is necessary to transfer / relocate / clone some files from the old mobile phone or the old electronic device to the new mobile phone or the new electronic device.
[0165] The data type of the files to be transferred between the first electronic device 10 and the second electronic device 20 can be varied depending on the source, such as contacts, messages, call logs, calendars, photo galleries, music, documents, application cache data, third-party application packages, etc. For example, it includes a first file and a second file.
[0166] In order to improve the efficiency of data transmission and reduce the time spent transferring multiple files, in this embodiment of the application, after the first electronic device 10 establishes a WiFi direct connection with the second electronic device 20, it can transmit the data of the first file to the second electronic device 20 through a file transfer protocol, and transmit the data of the second file to the second electronic device 20 through a file stream transfer protocol.
[0167] Specifically, the first electronic device 10 and the second electronic device 20 simultaneously establish a file transfer channel and a file stream transfer channel. Then, the first electronic device 10 sends the data of the first file to the second electronic device 20 through the file transfer channel, and sends the data of the second file to the second electronic device 20 through the file stream transfer channel.
[0168] The above method, when transferring multiple files via WiFi Direct, uses a file transfer protocol to transfer some files and a file streaming protocol to transfer others, and performs file transfer concurrently, which can improve the efficiency of data transmission.
[0169] For example, the first file may be data from files such as contacts, messages, call logs, calendars, photo galleries, music, documents, and third-party application packages, while the second file may be cached data from the application. That is, the first electronic device 10 can transmit data from files such as contacts, messages, call logs, calendars, photo galleries, music, documents, and third-party application packages to the second electronic device 20 via a file transfer protocol, while transmitting data from files such as cached data from the application to the second electronic device 20 via a file streaming protocol.
[0170] For example, the file transfer protocol used can be determined based on the size of the data in the file to be transferred. For instance, the first file can be a file whose data size is less than a preset threshold, and the second file can be a file whose data size is greater than or equal to the preset threshold. That is, for example, after establishing a WiFi direct connection with the second electronic device 20, the first electronic device 10 transfers files with a data size less than the preset threshold to the second electronic device 20 via a file transfer protocol, while transferring files with a data size greater than or equal to the preset threshold to the second electronic device 20 via a file streaming protocol. The preset threshold can be 200M, 400M, 500M, 600M, or other values.
[0171] In this embodiment of the application, the first electronic device 10 and the second electronic device 20 described above may not be limited to... Figure 1The mobile phones and laptops shown can also be desktop computers, laptops, handheld computers, tablets, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and / or smart city devices. The embodiments of this application do not impose any special restrictions on the specific type of terminal.
[0172] The following uses the application scenario of mobile phone cloning as an example to illustrate the process of data transmission between devices.
[0173] The following description uses a mobile phone cloning scenario as an example. Figure 2 The diagram illustrates a method for transferring data from an old mobile phone to a new mobile phone. This method may include, but is not limited to, some or all of the following steps:
[0174] (1) The user prepares the new phone and the old phone that need to be cloned.
[0175] (2) Open the "Phone Clone" application on the new phone, select the local phone as the new phone, and the QR code will be displayed.
[0176] On the new phone, open the phone cloning application, select the current phone as the new phone, enable the Wi-Fi hotspot, and generate a QR code containing the connection information for that Wi-Fi hotspot. Display this QR code. Specifically, the connection information may include the Wi-Fi hotspot name, password, etc. (See the following example.) Figures 3A-3C Exemplary illustration.
[0177] Specifically, the new phone displays the desktop, such as Figure 3A The user interface 31 shown responds to user actions such as clicking the "Phone Clone" icon on the desktop, launching the "Phone Clone" application and displaying... Figure 3B The user interface 32 is shown. Further, in response to a user operation that selects the device as a new phone in user interface 32, the new phone activates a WiFi hotspot, generates a QR code containing connection information for that WiFi hotspot, and displays it. Figure 3C The user interface 33 shown includes a generated QR code.
[0178] (3) Open the application "Phone Cloning" on the old phone, select the old phone as the device, scan the QR code of the new phone to be cloned, and the old phone and the new phone establish a physical connection.
[0179] On the old phone, open the phone cloning application, select the old phone as the device, and enter the QR code scanning interface. Then, scan the QR code displayed on the new phone to obtain the Wi-Fi hotspot name and password, and then select the data to be cloned. (The following is a combination of steps...) Figures 3D-3F Exemplary illustration.
[0180] Specifically, the old phone displays the desktop, such as Figure 3D The user interface 34 shown responds to a user action, such as a click, to the "Phone Clone" icon on the desktop, launching the "Phone Clone" application and displaying... Figure 3E The user interface 35 is shown. Further, in response to a user action that selects the device as the old phone in the user interface 35, the old phone displays as shown... Figure 3F The QR code scanning interface 36 shown may include a preview window 361. The older mobile phone can scan the QR code shown in the user interface 33. The preview window 361 of the scanning interface 36 can display the image captured by the camera in real time, and the scanned image can obtain the name and password of the WiFi hotspot. Furthermore, after obtaining the name and password of the WiFi hotspot, the older mobile phone can connect to the WiFi hotspot to establish a direct WiFi connection with the new mobile phone, and display information such as... Figure 3G The user interface 37 shown prompts the user that the old phone is establishing a connection with the new phone.
[0181] It should be noted that when an old phone and a new phone establish a physical connection, they can use the default bandwidth, such as 80MHz.
[0182] (4) Select the data to be cloned on the old phone.
[0183] Specifically, after the new and old phones establish a physical connection, you can access... Figure 3H The data selection interface 38 shown allows users to select the data to be cloned / transferred. Selection interface 38 can include multiple data items to be transferred, such as contacts, messages, call logs, calendar entries, gallery items, music, documents, and applications. Each data item can correspond to a selection control used to select the data to be transferred. The old mobile phone responds to the selection operation input to the selection control, allowing it to select the data corresponding to the selected control.
[0184] (5) The old mobile phone and the new mobile phone open the data transmission channel to transmit data.
[0185] The selection interface 38 may include a control 381 for initiating data transfer. In response to a user action input to the control 381, such as a click, the old phone can trigger the establishment of a data transfer channel with the new phone. Furthermore, the old phone sends selected data to the new phone through this data transfer channel, and displays information such as… Figure 3I The user interface 39 shown may also include a progress bar or prompt message to indicate the sending progress. At this time, the new mobile phone can receive data and display, as shown... Figure 3J The user interface 40 shown indicates that the local machine is receiving data. Similarly, the user interface 40 can also display a progress bar or prompt information to indicate the progress of the reception.
[0186] Optionally, after receiving a user input to control 381, before triggering the establishment of a data transmission channel with the new phone, the old phone can determine the required bandwidth based on the selected data volume. If the selected data volume is greater than a first threshold, such as 30G, the bandwidth for establishing a direct WiFi connection can be reset, such as setting it to 160MHz, to establish an ultra-high-speed direct WiFi connection.
[0187] (6) After the old mobile phone has finished transmitting the selected data, the new mobile phone will restore the received data.
[0188] Specifically, after the old phone has sent the selected data, that is, after the migration is complete, it can display something like this: Figure 3K The user interface 41 shown prompts the user to complete the transfer of selected data on the old phone. In response to a user action such as a click on the "Done" control, the "Phone Clone" application can be exited.
[0189] After receiving the data sent by the old phone, the new phone can display something like this. Figure 3L The user interface 42 shown imports the received data into the new phone to restore the received data. Optionally, the user interface 42 may also display prompts indicating the progress of data import into the new phone, or the estimated time required to import all data and / or the estimated time required to import the remaining data (i.e., data that has not yet been imported).
[0190] (7) The cloning process is complete.
[0191] After importing all the data into the new phone, the cloning process is complete. The new phone can then exit the "Phone Cloning" application.
[0192] In other embodiments, the old mobile phone can first select the data to be transferred, then scan the QR code to establish a physical connection with the new mobile phone. In this case, compared to the above... Figure 2The method embodiment shown differs in that: in response to a user operation that selects the device as the old phone in user interface 35, the old phone can display as follows: Figure 3H The data selection interface 38 shown allows users to select the data to be cloned / transferred. In response to user input on control 381, such as a click, the following display is shown: Figure 3F The data scanning interface 36 shown allows older mobile phones to scan the QR code displayed on the user interface 33 to obtain the name and password of the WiFi hotspot, and then connect to the WiFi hotspot to establish a direct WiFi connection with the new mobile phone, as shown in the image. Figure 3G The user interface 37 shown indicates that a connection is being established with the new phone. After a successful connection, the old phone and the new phone open a data transmission channel, with the old phone sending selected data to the new phone and the new phone receiving the data.
[0193] It should be noted that the specific implementation of data transfer between the old and new mobile phones can be found below. Figures 6A-6E The method embodiments shown or Figures 9-10 The method embodiments shown are not described in detail here.
[0194] The above example uses a mobile phone as the electronic device and an application for cloning the phone. In other embodiments, the new / old mobile phone can be the first electronic device and the second electronic device, respectively. "Mobile phone cloning" can also be other applications that can transfer data (also called target applications). This application does not limit the scope of the embodiments.
[0195] The apparatus involved in the embodiments of this application is described below.
[0196] like Figure 4 As shown, this is an electronic device 100 provided in an embodiment of this application. The electronic device 100 can be the one described above. Figure 1 The first electronic device or the second electronic device or the above Figures 3A-3LFor new or old mobile phones, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a camera 191, a display screen 192, and a subscriber identification module (SIM) card interface 193, etc. The sensor module 180 may include one or more of the following: a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer, a proximity sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0197] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0198] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. The processor is used to implement the logic for multi-device collaborative management, such as service connection establishment logic, service disconnection logic, and service mode switching logic.
[0199] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
[0200] In some embodiments, the processor 110 may include one or more interfaces. It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100.
[0201] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0202] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0203] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0204] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal.
[0205] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0206] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0207] Electronic device 100 implements display functions through a GPU, display screen 192, and application processor. Display screen 192 is used to display images, videos, etc.
[0208] Electronic device 100 can perform shooting functions through an image signal processor (ISP), camera 191, video codec, GPU, display screen 192, and application processor. Camera 191 is used to capture still images or videos.
[0209] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 performs various functional applications and data processing of electronic device 100 by executing instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.
[0210] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0211] The SIM card interface 193 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 193 to make contact with or separate from the electronic device 100.
[0212] Figure 5A This is a schematic diagram of the hardware and software structure of an electronic device provided in an embodiment of this application. The electronic device can be the aforementioned first electronic device, second electronic device, new mobile phone, new device, old mobile phone, or a combination of old and new devices. Figure 5B The software architectures of the first electronic device / old mobile phone and the second electronic device / new mobile phone are illustrated exemplarily in a specific application scenario.
[0213] like Figure 5A and Figure 5B As shown, the hardware and software architecture of electronic devices can adopt a layered architecture. A layered architecture divides the system into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. Figure 5B Only a portion of the software architecture is shown.
[0214] like Figure 5A As shown, the hardware and software architecture framework of the electronic device involved in this application may include an application layer, an application framework layer (FWK), system libraries and Android runtime, a hardware abstraction layer (HAL) (not shown), a kernel layer, and a hardware layer.
[0215] The application layer can include a series of applications, including system applications and third-party applications. For example, the application package can include applications such as WLAN applications, Bluetooth applications, phone cloning, contacts, telephone, gallery, messaging, music, video, maps and browser, as well as other applications not shown, such as Alipay, WeChat, camera, calendar, notes and other applications.
[0216] Among them, the WLAN application is mainly used to enable, connect to, and configure WLAN, while the Bluetooth application is used to enable, connect to, and configure Bluetooth.
[0217] Phone cloning is used to clone data from an old device to a new device via WiFi Direct.
[0218] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. It may include a window manager, content providers, a view system, and a resource manager, among other things.
[0219] The application framework layer also includes session management and a transport service platform. Session management is used to manage individual sessions. The transport service platform can include a DFILE file transfer protocol module and a DSTREAM file stream transfer protocol module. The DFILE module is used to create the data transfer path (i.e., the file transfer path) required for the first type of file transfer, while the DSTREAM module is used to create the data transfer path (i.e., the file stream transfer path) required for the second type of file transfer.
[0220] It should be understood that the specific functionalities of the transmission service platform, transmission dynamic library, and sending engine can also be found in the following... Figures 6A-6B and Figures 9-10 The method shown will not be elaborated here.
[0221] The runtime is responsible for system scheduling and management. The runtime includes the core libraries and the virtual machine. The core libraries consist of two parts: one part contains the functionalities that the programming language (e.g., Java) needs to call, and the other part contains the system's core libraries.
[0222] The application layer and application framework layer run in a virtual machine. The virtual machine executes the programming files (e.g., Java files) of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0223] System libraries can include multiple functional modules. For example: Surface Manager, Media Libraries, 3D image processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0224] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The Media Library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D Image Processing Library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D Graphics Engine is the drawing engine for 2D graphics.
[0225] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and upper-level software, its purpose being to abstract hardware. The HAL is an abstract interface for device kernel drivers, providing application programming interfaces (APIs) for accessing the underlying devices to higher-level Java API frameworks. The HAL contains multiple library modules, each implementing an interface for a specific type of hardware component.
[0226] The system library may also include a transport dynamic library. The transport dynamic library may include one or more clients, or one or more servers, depending on whether the electronic device is a first electronic device or a second electronic device. If the first electronic device acts as the sender, the transport dynamic library may also include a send engine, which may include one or more send threads and a priority module. Each send thread is used to send files, and the priority module can set the priority of each send thread. If the second electronic device acts as the receiver, the transport dynamic library may also include a send engine, which may include one or more receive threads, each used to receive files.
[0227] The kernel layer is the foundation of the Android operating system; all the final functions of the Android operating system are implemented through the kernel layer. The kernel layer can contain drivers such as WiFi, Bluetooth, display, camera, and audio. The Bluetooth driver drives the Bluetooth module. The WiFi driver drives the WiFi module. In some embodiments, the WiFi driver is also called a network card driver or a wireless network card driver. The kernel may include one or more UDP socket buffers.
[0228] The hardware layer can include WiFi modules, Bluetooth modules, and may also include displays, microphones, cameras, memory, audio encoders, and video encoders, etc.
[0229] It should be noted that the application provided Figure 5A and Figure 5BThe illustrated hardware and software structure diagram of the electronic device is merely an example and does not limit the specific module divisions within different layers of the Android operating system. For details, please refer to the descriptions of the Android operating system software structure in conventional technologies. Furthermore, the data transmission method provided in this application can also be implemented based on other operating systems, which will not be listed here.
[0230] The data transmission method provided in this application is described below in two examples.
[0231] Example 1
[0232] Combination Figures 6A-6E A flowchart of a data transmission method is provided, illustrating the data transmission method provided in this embodiment. Figures 6A-6E Taking phone cloning as an example, this method is not limited to phone cloning; it can also be applied to other scenarios requiring the transfer of multiple files. Figure 6A It describes the process of establishing a physical WiFi connection between a new phone and an old phone, and the process of transferring data through a file transfer channel; Figures 6B-6D This describes the process of transmitting data through a file stream transfer channel. Figure 6E The process of progress indicators and data recovery is described.
[0233] like Figures 6A-6E As shown, the data transmission method may include, but is not limited to, some or all of the following steps:
[0234] like Figure 6A As shown, Figure 6A It describes the process of establishing a physical WiFi connection between a new phone and an old phone, the process of establishing a file transfer channel, and the process of transferring the first type of file.
[0235] The process of physical connection:
[0236] S01, the new phone's application "Phone Clone" receives user input from the user who selected this phone as the new phone.
[0237] The new phone can open the phone cloning application and receive user input to select the original phone as the new phone.
[0238] S02, in response to the user's operation, the new phone uses the "Phone Clone" application to activate a WiFi hotspot, generating and displaying a QR code containing the WiFi hotspot's connection information. This connection information may include the WiFi hotspot's name, password, etc. The specific implementations of S01 and S02 can be found above. Figure 2 Step (2) and in the embodiments shown Figures 3A-3C .
[0239] S03, the old phone's application "Phone Clone" receives user input from the user who selected the old phone as their device.
[0240] The old phone can open the phone cloning application and receive user input selecting the old phone as the device.
[0241] S04, the old phone's "Phone Clone" application responds to the user's action and opens the QR code scanning interface.
[0242] S05, the old phone's "Phone Clone" application scans a QR code to get hotspot information.
[0243] Open the phone cloning application on the old phone, select the old phone as the device, enter the QR code scanning interface, and then scan the QR code displayed on the new phone to obtain the name and password of the WiFi hotspot. Then you can execute S06 to connect to the WiFi hotspot and establish a WiFi direct connection (also known as a WiFi P2P connection) with the new phone.
[0244] S06: After obtaining hotspot information, the old phone establishes a physical connection with the new phone using the default bandwidth based on the hotspot information. The default bandwidth can be 80MHz or other values.
[0245] For a more detailed implementation of S03-S06, please refer to the above. Figure 2 Step (3) and in the embodiments shown Figures 3D-3G .
[0246] S07, after establishing a Wi-Fi direct connection with the new phone, the "Phone Clone" application on the old phone allows users to select the data to be cloned. See the above for details. Figure 2 Step (4) and in the embodiment shown Figure 3H This will not be elaborated upon here.
[0247] S08, the old phone's "Phone Clone" application modifies the WiFi Direct bandwidth to establish an ultra-high-speed physical connection when the amount of selected data is greater than or equal to a first threshold.
[0248] In this case, the channel width (also known as bandwidth) of the ordinary physical connection established in step S06 is different from that of the ultra-high-speed physical connection established in step S08. The bandwidth of the ultra-high-speed physical connection is greater than that of the ordinary physical connection. For example, the bandwidth used by the ultra-high-speed physical connection is 160MHz, while the bandwidth used by the ordinary physical connection is 80MHz.
[0249] In other embodiments, the application "phone clone" for older mobile phones may not differentiate the bandwidth of the P2P physical connection based on the amount of data to be transmitted, but may instead use either an ultra-high-speed physical connection or a regular physical connection.
[0250] During the process of establishing a communication connection between an old and a new mobile phone via WiFi Direct, a physical connection needs to be established first, as described in step S06 above. Then, a socket establishment process is performed, i.e., a control channel is established between the old and new phones. Further, a data channel is established between the old and new phones through this control channel. The establishment of the control channel typically requires a TCP three-way handshake. After a successful handshake, the control channel is successfully created. The establishment process of the data channel between the old and new phones can include the establishment process of a file transfer channel and a file stream transfer channel, depending on the data type to be transmitted, as detailed below.
[0251] In some embodiments, the data type may include a first type (also called a file type) and a second type (also called a file stream type). Files of the first data type are transmitted using a file transfer protocol, and the transmission process can be found in the following description of the transmission process for files of the first type. Files of the second type are transmitted using a file stream transfer protocol, and the transmission process can be found in the following description of the transmission process for files of the second type.
[0252] In the first implementation, the data type of a file can be determined based on its source. Files such as those in a gallery, documents, or application packages are classified as type 1 files, while cached data from an application is classified as type 2 files.
[0253] In the second implementation, files with a data size less than a preset threshold belong to the first type; files with a data size greater than or equal to the preset threshold belong to the second stream type. The preset threshold can be any value between 100M and 2G, such as 200M, 300M, 500M, or other values.
[0254] The following explanation uses the first type of file partitioning as an example.
[0255] Old mobile phone response to the above Figure 3H The user operation of control 381 in the user interface shown allows for the simultaneous establishment of multiple data transfer channels, such as a file transfer channel and at least one file stream transfer channel. After establishing a file transfer channel, it is used to transfer files of the first type. Similarly, after establishing a file stream transfer channel, it is used to transfer files of the corresponding second type. This will be explained in detail below:
[0256] The transfer process for the first type of file:
[0257] The following sections S09-S25 describe the file transfer process using the file transfer protocol, with S09-S21 describing the establishment of the file transfer channel and S22-S25 describing the process of transferring file data using the file transfer channel after its establishment.
[0258] S09, the application "Phone Cloning" on the old phone contains M files in the selected data, obtain the first file path of each file. M is a positive integer not less than 1.
[0259] For example, the M files include files for storing contacts, files for storing call logs, application packages for third-party applications, etc.
[0260] It should be understood that in another implementation, the M files can be selected files whose data volume is less than a preset threshold.
[0261] S10, the old mobile phone's application "Mobile Cloning" sends a first instruction to the local transmission service platform. The first instruction carries first service information, which includes the first file path of each of the M files. The first instruction is used to instruct the start of a service to transmit the data of the M files.
[0262] S11, the old mobile phone's transmission service platform responds to the first instruction and creates the first session. During the creation of the first session, an identifier for that first session is generated.
[0263] S12, the old mobile phone's transmission service platform sends a first startup instruction to the local transmission dynamic library. The first startup instruction carries the first file path of M files and the identifier of the first session, which is used to instruct the local client to start.
[0264] S13, the old mobile phone's transfer dynamic library responds to the first startup command, starts the first client, and saves the first file paths of M files and the identifier of the first session. The first client is used to implement the transfer of these M files.
[0265] S14, the old mobile phone's transmission dynamic library sends a first notification to the local transmission service platform. This first notification may carry the identifier of the first session to notify the first client that it has started successfully.
[0266] S15, the old mobile phone's transmission service platform sends a first request to the new mobile phone's transmission service platform. The first request carries the identifier of the first session, the first session type, and the device identifier of the new mobile phone, and is used to request the new mobile phone to start the transmission service corresponding to the first session.
[0267] S16, the new mobile phone's transmission service platform responds to the first request, parses the first request, obtains the identifier and session type of the first session, and if the first session type indicates a file session, creates a second session corresponding to the first session, and generates second file paths for M files based on the first file paths of M files. When creating the second session, an identifier for the second session is generated.
[0268] The second file path is used to store the file's data on the new phone.
[0269] S17, the new mobile phone's transmission service platform sends a second startup command to the local transmission dynamic library, carrying the identifier of the second session and the second file path of M files.
[0270] S18, the new phone's transmission dynamic library starts the first server, saves the second file path of M files and the identifier of the second session.
[0271] S19, the new mobile phone's transmission dynamic library sends a second notification to the local transmission service platform, carrying the identifier of the second session, to notify the first server that it has been successfully started.
[0272] S20, the transmission service platform of the new mobile phone sends the first response information corresponding to the first request to the transmission service platform of the old mobile phone. The first response information is used to notify the server-side transmission server that the start-up was successful, and can carry the identifier of the first session and the identifier of the second session.
[0273] Optionally, the new phone's transmission service platform can notify the local application "Phone Cloning" that the service has been successfully launched, and this notification carries an identifier of the second session.
[0274] S21, after receiving the first response information, the transmission service platform of the old mobile phone parses the first response information to obtain the identifier of the first session and the identifier of the second session, and notifies the local application "Mobile Cloning" that the service has started successfully. This notification carries the identifier of the second session.
[0275] S22, the old phone's application "Phone Clone" sends a file transfer command to the local transfer dynamic library, carrying an identifier for the first session, instructing the transfer dynamic library to transfer the service data corresponding to the first session. It should be understood that the service data corresponding to the first session consists of M files.
[0276] In other embodiments, the transmission service platform of the old mobile phone can also directly notify the local transmission dynamic library that the transmission server corresponding to the first session has started successfully, in which case the above S21-S22 can be omitted.
[0277] S23, the old mobile phone's transmission dynamic library (specifically, the first client) opens M files based on the first file path of M files and reads data from each file. It should be understood that the M files include the first file. The first file is a file of type 1.
[0278] S24, the old mobile phone's transmission dynamic library (specifically, the first client) sends the data of each of the M files and the identifier of the second session to the new mobile phone's transmission dynamic library.
[0279] S25, when the new mobile phone's transmission dynamic library (specifically, the first server) receives the identifier of the second session, it writes the received data to the second file path.
[0280] In one implementation of S24 and S25, the old phone's transmission dynamic library can first send the data of each of the M files and the identifier of the second session to the local transmission engine. The old phone's transmission engine can then send the data of each of the M files and the identifier of the second session to the new phone's transmission engine. The new phone's transmission engine can then send the received data of each of the M files and the identifier of the second session back to the local transmission dynamic library.
[0281] Optionally, the new phone's transfer dynamic library can also send progress notifications to the "Phone Clone" application to indicate the amount of data in the received files.
[0282] The old mobile phone's transmission dynamic library (which can also be the first client) can include multiple queues, each queue of which can be used to store data packets of files to be sent. Example 1 of this application uses three queues. The specific implementation is as follows:
[0283] See Figure 7 The diagram shows a schematic flowchart of a method for placing file data packets into a queue.
[0284] The first client can sequentially read M files, where the first file is any one of the M files. For example, after reading the data of the first file, the first client can determine whether the data size of the first file is less than or equal to a first threshold. If so, the data size of the first file is less than or equal to the first threshold, and the data packet of the first file is placed in the first queue (small file queue). The data packet of the first file includes the identifier of the first session and part or all of the data of the first file. Further, the first client can determine whether the data size of the first file is greater than or equal to a second threshold. If not, the data size of the first file is greater than the first threshold and less than the second threshold, and the data packet of the first file is placed in the second queue (medium file queue). Conversely, if the data size is greater than or equal to the second threshold, the data packet of the first file is placed in the third queue (large file queue). The second threshold is greater than the first threshold. Further, the first client sends the data packets from the first, second, and third queues in parallel to the sending engine; subsequently, the sending engine sends the received data packets to the second electronic device.
[0285] For example, the first threshold could be 500MB and the second threshold could be 1GB.
[0286] For example, the first threshold can be 200MB and the second threshold can be 500MB.
[0287] This method allows the first client to place files into different queues based on their data size, enabling the sending tasks in the three queues to be performed in parallel. This improves the efficiency of file sending and avoids large files consuming excessive resources while small files cannot be sent.
[0288] Optionally, after reading the data from the first file, and before placing the data into the queue, the first client can determine whether the first, second, and third queues contain data packets to be sent. If all queues contain data packets to be sent, the data packets from the first file can be placed into the corresponding queues based on the aforementioned rules.
[0289] When the first client finds no data packets to be sent in the first queue and the data size of the first file exceeds a first threshold, it can place the data packets of the first file into the first queue. Similarly, when the second queue does not contain any data packets to be sent, and the data size of the first file is less than or equal to the first threshold or greater than the second threshold, the client can place the data packets into the second queue. When the third queue does not contain any data packets to be sent, and the data size of the first file is less than the second threshold, the client can place the data packets into the third queue. This method allows large files to be transmitted through the small file task queue when there are few or no small file transmission tasks, and vice versa, improving data transmission efficiency when small or large files are concentrated.
[0290] The transfer process for the second type of file:
[0291] It should be understood that the selected data may include one or more files of the second type. This application embodiment uses the example of application cache data as a second-type file. In other embodiments, the application cache data may be replaced with files of the second type. In this case, a pipe and file stream transmission channel can be created for each second-type file to transmit the data of that file; however, only a specified number of file stream transmission channels can exist at any given time.
[0292] For example, the selected data includes at least the cached data of N applications, specifically, at least the cached data of a first application, a second application, and a third application. An older phone can simultaneously transmit the cached data of the first application, the second application, and the third application to a newer phone.
[0293] In this embodiment, multiple file stream transmission channels can be established simultaneously to transmit data from multiple second-type files concurrently, thereby improving data transmission efficiency. This embodiment uses the establishment of three file stream transmission channels as an example.
[0294] like Figure 6B As shown, Figure 6B Steps S30-S45 describe the process of establishing a first file transfer channel between the new mobile phone and the old mobile phone, and steps S46-S51 describe the process of transferring data of a second file (exemplarily, cached data of a first application) through the first file transfer channel.
[0295] like Figure 6C As shown, Figure 6CSteps S60-S75 describe the process of establishing a second file transfer channel between the new mobile phone and the old mobile phone, and steps S76-S81 describe the process of transferring data of a third file (exemplarily, cached data of a second application) through the second file transfer channel.
[0296] like Figure 6D As shown, Figure 6D Steps S90-S105 describe the process of establishing a third file transfer channel between the new mobile phone and the old mobile phone, and steps S106-S111 describe the process of transferring data of a fourth file (exemplarily, cached data of a third application) through the third file transfer channel.
[0297] like Figure 6B The diagram shown illustrates the process of transferring cached data of the first application from an old mobile phone to a new mobile phone, which may include, but is not limited to, some or all of the following steps:
[0298] S30, the old phone's application "phone clone" selects data containing the cached data of the first application, creates the first pipeline corresponding to the first application, and generates the inlet FD and outlet FD of the first pipeline.
[0299] S31, the old mobile phone's application "Mobile Cloner" sends a second instruction to the transmission service platform. The second instruction carries the output FD of the first pipe corresponding to the first application and is used to start a service for transmitting the cached data of the first application.
[0300] In S32, the old mobile phone's transmission service platform responds to the second instruction and creates a third session corresponding to the first pipeline. When creating the third session, an identifier for the third session is generated.
[0301] S33, the old mobile phone's transmission service platform sends a third start command to the local transmission dynamic library. This third start command carries the identifier of the third session, the session type, and the output FD of the first pipe. The session type of the third session is file stream.
[0302] S34, in response to the third startup command, the old phone's transmission dynamic library starts the second client, saving the identifier of the third session and the output FD of the first pipe. The second client is used to transmit cached data from the first application.
[0303] S35, the old mobile phone's transport dynamic library sends a third notification to the local transport service platform. This third notification is used to notify the second client that it has been successfully started and can carry the identifier of the third session.
[0304] S36, the old mobile phone's transmission service platform sends a second request to the new mobile phone's transmission service platform, carrying the identifier and session type of the third session and the device identifier, to request the start of the transmission service corresponding to the third session.
[0305] S37, the new mobile phone's transmission service platform responds to the second request and creates a fourth session corresponding to the third session. When creating the fourth session, an identifier for the fourth session is generated.
[0306] S38, the new mobile phone's transmission service platform sends a first creation instruction to the local application "Mobile Cloner". This first creation instruction may carry an identifier of the fourth session to indicate the creation of the second pipeline corresponding to the fourth session.
[0307] S39, the new phone's application "Phone Clone" responds to the creation command, creates a second pipe, and generates the input FD and output FD of the second pipe.
[0308] S40, the new phone's application "Phone Clone" sends an instruction message to the local transmission service center, which carries the identifier of the fourth session and the incoming FD of the second channel.
[0309] S41, after receiving the instruction information, the transmission service platform of the new mobile phone sends a fourth startup instruction to the local transmission dynamic library. This fourth startup instruction carries the identifier of the fourth session and the ingress FD of the second pipe, which is used to instruct the startup of the second server. The second server is used to transmit the cached data of the first application.
[0310] S42, the new phone's transmission dynamic library responds to the fourth startup command, starts the second server, and saves the identifier of the fourth session and the ingress FD of the second pipe.
[0311] S43, the new mobile phone's transport dynamic library sends a fourth notification to the local transport service platform. This fourth notification is used to notify the second server that it has been successfully started and can carry the identifier of the fourth session.
[0312] S44, the transmission service platform of the new mobile phone sends a second response message to the transmission service platform of the old mobile phone. The second response message may carry the identifier of the third session and the identifier of the fourth session to indicate that the new mobile phone has started the transmission service. At this time, the new mobile phone and the old mobile phone establish a transmission channel for application cache data.
[0313] Optionally, the new phone's transmission service platform can notify the local application "Phone Cloner" that the service has started successfully. This notification can carry the incoming FD of the second pipe to indicate that the new phone's application "Phone Cloner" can read data from the indicated second pipe.
[0314] S45, after receiving the second response information, the transmission service platform of the old mobile phone can parse the second response information to obtain the identifier of the third session and the identifier of the fourth session. Then, based on the identifier of the third session, it can determine the corresponding output FD of the first pipe and further notify the local application "Mobile Cloning" that the service has started successfully. This notification can carry the output FD of the first pipe.
[0315] S46, after receiving the notification carrying the output FD of the first pipe, the application "Phone Clone" of the old mobile phone can write the cached data of the first application into the first pipe based on the input FD of the first pipe.
[0316] Specifically, the cached data of an application corresponds to a first pipe. After receiving a notification carrying the output FD of the first pipe, the application corresponding to the output FD of the first pipe can be determined, and then the cached data of the application can be written to the input FD of the first pipe.
[0317] S47, the old mobile phone's transmission dynamic library (specifically, a second client) reads the cached data of the first application from the output end FD of the first pipe.
[0318] S48, the old phone's transport dynamic library (specifically, the second client) sends the cached data of the first application and the identifier of the third session to the new phone's transport dynamic library.
[0319] S49, after receiving the cached data of the first application and the identifier of the third session, the transmission dynamic library of the new mobile phone (specifically, the second server) can determine the identifier of the corresponding fourth session based on the identifier of the third session, and then determine the ingress FD of the corresponding second pipe based on the determined identifier of the fourth session.
[0320] It should be understood that the dynamic database (specifically, the second server) stores the correspondence between the third and fourth sessions, as well as the correspondence between the fourth session and the ingress FD of the pipeline.
[0321] In S50, the new phone's transmission dynamic library (specifically, a second server) can write the cached data of the first application into the second pipe based on the ingress FD of the second pipe.
[0322] S51, the new phone's application "Phone Clone" can read cached data of the first application from the second pipe based on the output FD of the second pipe.
[0323] In one specific implementation of S48, the second client on the old phone can fragment and package the cached data of the first application into a data packet. This data packet includes not only a portion of the cached data from the first application but also an identifier for the third session. The data packet is then sent to the sending engine, which can then forward the data packet to the new phone.
[0324] like Figure 6C The diagram shown illustrates the process of transferring cached data of a second application from an old mobile phone to a new mobile phone. This process may include, but is not limited to, some or all of the following steps:
[0325] In S60, the "Phone Clone" application on older phones creates a third pipeline corresponding to the second application by selecting data containing the cached data of the second application, and generates the ingress FD and egress FD of the third pipeline.
[0326] S61, the old phone's application "Phone Clone" sends a third instruction to the transmission service platform. This third instruction carries the output FD of the third pipe corresponding to the second application, which is used to start a service for transmitting the cached data of the second application.
[0327] In S62, the older mobile phone's transmission service platform responds to the third command and creates a fifth session corresponding to the third pipeline. When creating the fifth session, an identifier for that fifth session is generated.
[0328] In S63, the old mobile phone's transport service platform sends a fifth start command to the local transport dynamic library. This fifth start command carries the identifier of the fifth session, the session type, and the output FD of the third pipe. The session type of the fifth session is file stream.
[0329] In S64, the older mobile phone's transport dynamic library responds to the fifth startup command, launches the third client, and saves the identifier of the fifth session and the output FD of the third pipe. The third client is used to transmit cached data from the second application.
[0330] In S65, the old mobile phone's transport dynamic library sends a fifth notification to the local transport service platform. This fifth notification is used to notify the third client that it has been successfully started and can carry the identifier of the fifth session.
[0331] S66, the old mobile phone's transmission service platform sends a third request to the new mobile phone's transmission service platform, carrying the identifier and session type of the fifth session, and the device identifier, to request the start of the transmission service corresponding to the fifth session.
[0332] In S67, the new mobile phone's transmission service platform responds to the third request and creates a sixth session corresponding to the fifth session. When creating the sixth session, an identifier for the sixth session is generated.
[0333] S68, the new mobile phone's transmission service platform sends a second creation instruction to the local application "Mobile Cloner". This second creation instruction carries the identifier of the sixth session and is used to instruct the creation of the fourth pipe corresponding to the sixth session.
[0334] S69, the new phone's application "Phone Clone" responds to the second creation command, creates the fourth pipe, and generates the input FD and output FD of the fourth pipe.
[0335] In S70, the new phone's application "Phone Clone" sends an instruction message to the local transmission service center, which carries the identifier of the sixth session and the incoming FD of the fourth channel.
[0336] S71, after receiving the instruction information, the transmission service platform of the new mobile phone sends a sixth start command to the local transmission dynamic library. This sixth start command carries the identifier of the sixth session and the ingress FD of the fourth pipe, which is used to instruct the start of the second server. The second server is used to transmit the cached data of the second application.
[0337] In S72, the new phone's transport dynamic library responds to the sixth startup command, starts the third server, and saves the identifier of the sixth session and the ingress FD of the fourth pipe.
[0338] S73, the new mobile phone's transport dynamic library sends a sixth notification to the local transport service platform. This sixth notification is used to notify the third server that it has been successfully started and can carry the identifier of the sixth session.
[0339] S74, the transmission service platform of the new mobile phone sends a third response message to the transmission service platform of the old mobile phone. The third response message may carry the identifier of the fifth session and the identifier of the sixth session to indicate that the new mobile phone has started the transmission service. At this time, the new mobile phone and the old mobile phone establish a transmission channel for application cache data.
[0340] Optionally, the new phone's transmission service platform can notify the local application "Phone Cloner" that the service has started successfully. This notification can carry the incoming FD of the fourth pipe to indicate that the new phone's application "Phone Cloner" can read data from the indicated fourth pipe.
[0341] S75, after receiving the third response information, the transmission service platform of the old mobile phone can parse the third response information to obtain the identifier of the fifth session and the identifier of the sixth session. Then, based on the identifier of the fifth session, it can determine the corresponding output FD of the third pipe and further notify the local application "Mobile Cloning" that the service has started successfully. This notification can carry the output FD of the third pipe.
[0342] S76, after receiving the notification carrying the output FD of the third pipe, the old mobile phone application "Mobile Cloner" can write the cached data of the second application into the third pipe based on the input FD of the third pipe.
[0343] Specifically, an application's cached data corresponds to a third pipe. Upon receiving a notification carrying the output FD of the third pipe, the application corresponding to the output FD of the third pipe can be determined, and then the cached data of the application can be written to the input FD of the third pipe.
[0344] S77, the old mobile phone's transmission dynamic library (specifically, a third client) reads the cached data of the second application from the output end of the third pipe FD.
[0345] In S78, the old phone's transport dynamic library (which could be a third client) sends cached data from the second application and the identifier of the fifth session to the new phone's transport dynamic library.
[0346] S79, after receiving the cached data of the second application and the identifier of the fifth session, the new mobile phone's transmission dynamic library (specifically, the third server) can determine the identifier of the corresponding sixth session based on the identifier of the fifth session, and then determine the ingress FD of the corresponding fourth channel based on the determined identifier of the sixth session.
[0347] It should be understood that the dynamic database (which may specifically be a third-party server) stores the correspondence between the fifth session and the sixth session, as well as the correspondence between the sixth session and the ingress FD of the pipeline.
[0348] In S80, the new phone's transport dynamic library (specifically, a third-party server) can write cached data from the second application into the fourth pipe based on the ingress FD of the fourth pipe.
[0349] In the S81, the new phone's application "Phone Clone" can read cached data from the second application from the fourth pipe based on the output FD of the fourth pipe.
[0350] In one specific implementation of S78, a third client on an older phone can fragment and package the cached data of the second application into a data packet. This data packet includes not only a portion of the cached data from the second application but also the identifier of the fifth session. The data packet is then sent to the sending engine, which can then forward the data packet to the new phone.
[0351] like Figure 6D The diagram shown illustrates the process of transferring cached data of a third-party application from an old mobile phone to a new mobile phone. This process may include, but is not limited to, some or all of the following steps:
[0352] In S90, the "Phone Clone" application of the old phone contains cached data of the third application in the selected data, creates a fifth pipe corresponding to the third application, and generates the inlet FD and outlet FD of the fifth pipe.
[0353] S91, the old phone's application "Phone Clone" sends a fourth instruction to the transmission service center. This fourth instruction carries the output FD of the fifth pipe corresponding to the third application, which is used to start a service for transmitting the cached data of the third application.
[0354] In S92, the older mobile phone's transmission service platform responds to the fourth instruction and creates the seventh session corresponding to the fifth channel. When creating the seventh session, an identifier for that seventh session is generated.
[0355] In S93, the old mobile phone's transmission service platform sends a seventh start command to the local transmission dynamic library. This seventh start command carries the identifier of the seventh session, the session type, and the output FD of the fifth pipe. The session type of the seventh session is file stream.
[0356] In S94, the old mobile phone's transport dynamic library responds to the seventh startup command, starts the fourth client, and saves the identifier of the seventh session and the output FD of the fifth pipe. The fourth client is used to transmit cached data from the third application.
[0357] In S95, the old mobile phone's transport dynamic library sends a seventh notification to the local transport service platform. This seventh notification is used to notify the fourth client that it has been successfully started and can carry the identifier of the seventh session.
[0358] S96, the old mobile phone's transmission service platform sends a fourth request to the new mobile phone's transmission service platform, carrying the identifier and session type of the seventh session, and the device identifier, to request the start of the transmission service corresponding to the seventh session.
[0359] In the S97, the new mobile phone's transmission service platform responds to the fourth request and creates the eighth session corresponding to the seventh session. When creating the eighth session, an identifier for the eighth session is generated.
[0360] In S98, the new mobile phone's transmission service platform sends a third creation instruction to the local application "Mobile Cloner". This third creation instruction carries the identifier of the eighth session and is used to instruct the creation of the sixth pipe corresponding to the eighth session.
[0361] In the S99, the new phone's application "Phone Clone" responds to the third creation command, creating the sixth pipe and generating the input FD and output FD of the sixth pipe.
[0362] S100, the new mobile phone's application "Mobile Cloning" sends an instruction message to the local transmission service center, which carries the identifier of the eighth session and the incoming FD of the sixth channel.
[0363] S101, after receiving the instruction information, the transmission service platform of the new mobile phone sends an eighth start command to the local transmission dynamic library. This eighth start command carries the identifier of the eighth session and the ingress FD of the sixth pipe, which is used to instruct the start of the fourth server. The fourth server is used to transmit the cached data of the third application.
[0364] S102, the new mobile phone's transmission dynamic library responds to the eighth startup command, starts the fourth server, and saves the identifier of the eighth session and the ingress FD of the sixth pipe.
[0365] S103, the new mobile phone's transmission dynamic library sends an eighth notification to the local transmission service platform. This eighth notification is used to notify the fourth server that it has been successfully started and can carry the identifier of the eighth session.
[0366] S104, the transmission service platform of the new mobile phone sends a fourth response message to the transmission service platform of the old mobile phone. The fourth response message may carry the identifier of the seventh session and the identifier of the eighth session to indicate that the new mobile phone has started the transmission service. At this time, the new mobile phone and the old mobile phone establish a transmission channel for application cache data.
[0367] Optionally, the new phone's transmission service platform can notify the local application "Phone Cloner" that the service has started successfully. This notification can carry the incoming FD of the sixth pipe to indicate that the new phone's application "Phone Cloner" can read data from the indicated sixth pipe.
[0368] S105, after receiving the fourth response information, the transmission service platform of the old mobile phone can parse the fourth response information to obtain the identifier of the seventh session and the identifier of the eighth session. Then, based on the identifier of the seventh session, it can determine the corresponding output FD of the fifth pipe and further notify the local application "Mobile Cloning" that the service has started successfully. This notification can carry the output FD of the fifth pipe.
[0369] S106, after receiving the notification carrying the output FD of the fifth pipe, the old mobile phone application "Mobile Cloner" can write the cached data of the third application into the fifth pipe based on the input FD of the fifth pipe.
[0370] Specifically, an application's cached data corresponds to a fifth pipe. Upon receiving a notification carrying the output FD of the fifth pipe, the application corresponding to the output FD of the fifth pipe can be determined, and then the cached data of the application can be written to the input FD of the fifth pipe.
[0371] S107, the old mobile phone's transmission dynamic library (specifically, the fourth client) reads the cached data of the third application from the output end of the fifth pipe, based on the output end FD of the fifth pipe.
[0372] S108, the old phone's transport dynamic library (specifically, the fourth client) sends the cached data of the third application and the identifier of the seventh session to the new phone's transport dynamic library.
[0373] S109, after receiving the cached data of the third application and the identifier of the seventh session, the transmission dynamic library of the new mobile phone (specifically, the fourth server) can determine the identifier of the corresponding eighth session based on the identifier of the seventh session, and then determine the ingress FD of the corresponding sixth pipe based on the determined identifier of the eighth session.
[0374] It should be understood that the dynamic database (specifically, the fourth server) stores the correspondence between the seventh and eighth sessions, as well as the correspondence between the eighth session and the ingress FD of the pipeline.
[0375] S110, the new phone's transmission dynamic library (specifically, the fourth server) can write the cached data of the third application into the sixth pipe based on the ingress FD of the sixth pipe.
[0376] S111, the new phone's application "Phone Clone" can read cached data from the third application from the sixth pipe based on the output FD of the sixth pipe.
[0377] In one specific implementation of S108, the fourth client on the old phone can fragment and package the cached data of the third application into a data packet. This data packet includes not only a portion of the cached data from the third application but also the identifier of the seventh session. The data packet is then sent to the sending engine. The sending engine can then send this data packet to the new phone.
[0378] Optionally, the selected data also includes cached data from the fourth application. After transmitting the cached data from the first application, the "Phone Clone" application can release the pipes and file stream transfer channels corresponding to the first application. At this point, the current number of pipes is less than 3, and the number of file stream transfer channels is also less than 3. A fourth file stream transfer channel can then be established to transmit the cached data from the fourth application, until the cached data from the selected application is completely transmitted. The process of establishing the fourth file stream transfer channel is the same as that of the first file stream transfer channel described above, and will not be repeated here.
[0379] Progress notifications and the data recovery process on the new phone:
[0380] like Figure 6E As shown, the process may include, but is not limited to, some or all of the following steps:
[0381] In S120, the old mobile phone's transmission dynamic library (such as the first client) can send file list information to the new mobile phone's transmission dynamic library (such as the first server) before sending file data to the new mobile phone (also before S23). This file list information may include information such as the identifier and data size of each file in the selected files.
[0382] In practice, the "Phone Clone" application on the old phone can send the file list information to the local transfer dynamic library, which in turn can send the file list information to the new phone.
[0383] S121, the new mobile phone's transfer dynamic library can determine the total amount of data in the selected file, i.e., the total amount of data to be transferred, based on the file list information after the holiday.
[0384] S122, the new mobile phone's transmission dynamic library determines the reception progress based on the amount of data currently received and the total amount of data in the selected file. This reception progress is used to indicate the ratio of the amount of data currently transmitted to the total amount of data in the selected file, or the ratio itself.
[0385] S123, the new phone's transfer dynamic library can also send progress notifications to the local application "Phone Clone," which carries the receiving progress.
[0386] S124, the new phone's "Phone Clone" application can display the receiving progress after receiving a progress notification.
[0387] The S125's new phone application "Phone Clone" can restore data after receiving selected files (such as data from M files and cached data from N applications).
[0388] It should be understood that new mobile phones can receive and restore data simultaneously, and this is not a limitation here.
[0389] After receiving data from a file (such as data from M files and cached data from N applications), the new phone can store the file data in the appropriate location for restoration on the new phone. During the restoration process, the new phone can display something like... Figure 3L The interface shown.
[0390] Optionally, after sending the data from M files and the cached data from N applications, the old phone's "Phone Clone" application can display an indication message or user interface to show that the sending is complete, such as... Figure 3K As shown.
[0391] In some embodiments, the sending engine can receive data packets of either a first type of file or a second type of file. For example, the sending engine can receive data packets for each of M files, or it can receive data packets for cached data from N applications. The sending engine can set the priority of data packets for different types of files. The data packets for the second type of file have a higher priority than those for the first type of file.
[0392] like Figure 8 The diagram shown is a schematic illustration of the priority strategy set in an embodiment of this application.
[0393] In this embodiment, foreground sessions have a higher priority than background sessions. Both foreground and background sessions can be divided into three queues:
[0394] For example, the system includes a DMsg queue, a DStream queue, and a DFile queue. The DMsg queue is used to store data to be transmitted for sessions with high requirements for Quality of Service (QoS) parameters such as latency, such as keyboard and mouse services. The DStream queue can be used to store data of a second type of file, such as the data packets to be transmitted in the third session S3 (i.e., the data packets of the second file), the data packets to be transmitted in the fifth session S5 (i.e., the data packets of the third file), and the data packets to be transmitted in the seventh session S7 (i.e., the data packets of the fourth file). The DFile queue can be used to store data of a first type of file, such as the data packets to be transmitted in the first session S1 (i.e., the data packets of the first file).
[0395] After receiving a data packet, the sending engine can put it into the corresponding queue. For example, the data packets of the S1 session are put into the DFile queue, the data packets of the S3, S5 and S7 sessions are put into the DStream queue, and the data packets of the session generated by the keyboard and mouse service are put into the DMsg queue.
[0396] The sending engine prioritizes sending packets from the DMsg queue, followed by packets from the DStream queue, and finally packets from the DFile queue, in order to ensure that latency-sensitive services such as keyboard and mouse sharing can respond quickly and prioritize packets from the DStream queue.
[0397] It should be noted that, in the embodiments of this application, data packets can also be referred to as data frames.
[0398] When establishing a data transmission channel between an old mobile phone and a new mobile phone, the request and response data can be sent by setting frames.
[0399] Example 2
[0400] likeFigure 9 As shown, this is another data transmission method provided in an embodiment of this application. This method can be derived from the above... Figure 1 The communication system implementation shown may include, but is not limited to, some or all of the following steps:
[0401] S201, the first electronic device establishes a direct WiFi connection with the second electronic device.
[0402] S202, the first electronic device receives a user operation to send data of multiple files to the second electronic device. The multiple files include a first file and a second file.
[0403] The first file is a file of type 1, and the second file is a file of type 2.
[0404] For example, the first type of file is a gallery file, document, or application package, and the second type of file is cached data of the application.
[0405] For example, the data volume of the first type of file is greater than a preset threshold, while the data volume of the second type of file is less than or equal to the preset threshold.
[0406] S203a, the first electronic device responds to the user's operation and establishes a file transfer channel with the second electronic device.
[0407] S203b, the first electronic device responds to the user's operation and establishes a first file stream transmission channel with the second electronic device.
[0408] It should be understood that the first electronic device may simultaneously execute S203a and S203b in response to the user's operation.
[0409] S204, after S203a, the first electronic device can send the data of the first file to the second electronic device through the file transfer channel.
[0410] S205, after S203b, the first electronic device can send the data of the second file to the second electronic device through the first file stream transmission channel.
[0411] For a more detailed explanation of the implementation of steps S201-S203a and S205, please refer to the above. Figure 6A The method shown will not be elaborated here.
[0412] For a more detailed implementation of steps S203b and S206, please refer to the above. Figure 6B The method shown will not be elaborated here.
[0413] like Figure 10 The diagram shown is a flowchart illustrating another data transmission method provided in an embodiment of this application.
[0414] In some embodiments, the plurality of files further includes a third file, and the method may further include:
[0415] S203c, the first electronic device responds to the user's operation and establishes a second file stream transmission channel with the second electronic device.
[0416] S206, after S203c, the first electronic device can send the data of the third file to the second electronic device through the second file stream transmission channel.
[0417] The third file is a file of the second type. For specific implementations of S203c and S206, please refer to the above. Figure 6C The method shown will not be elaborated here.
[0418] In some embodiments, the plurality of files further includes a fourth file, and the method may further include:
[0419] S203d, the first electronic device responds to the user's operation and establishes a third file stream transmission channel with the second electronic device.
[0420] S207, after S203d, the first electronic device sends the data of the fourth file to the second electronic device through the third file stream transmission channel.
[0421] The fourth file is a file of the second type. For specific implementations of S203d and S207, please refer to the above. Figure 6D The method shown will not be elaborated here.
[0422] It should be noted that S203c and S203d can be executed simultaneously with S203a and S203b.
[0423] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0424] This application also provides an electronic device that may include a memory and a processor. The memory may be used to store a computer program; the processor may be used to invoke the computer program in the memory to cause the electronic device to execute the method executed by the first electronic device, the second electronic device, the new mobile phone, or the old mobile phone in any of the above embodiments.
[0425] This application also provides a chip system, which includes at least one processor for implementing the functions involved in the methods executed by the first electronic device, the second electronic device, the new mobile phone, or the old mobile phone in any of the above embodiments.
[0426] In one possible design, the chip system also includes a memory for storing program instructions and data, which may be located inside or outside the processor.
[0427] The chip system can consist of chips or include chips and other discrete components.
[0428] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0429] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.
[0430] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0431] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the first electronic device, the second electronic device, the new mobile phone, or the old mobile phone in any of the above embodiments.
[0432] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the first electronic device, the second electronic device, the new mobile phone, or the old mobile phone in any of the above embodiments.
[0433] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.
[0434] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).
[0435] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0436] In summary, the above are merely embodiments of the technical solution of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data transmission method, characterized in that, Applied to a first electronic device, the method includes: The first electronic device establishes a direct WiFi connection with the second electronic device; In response to a received user operation, the first electronic device establishes a file transfer channel and a first file stream transfer channel with the second electronic device; the user operation is used to instruct the second electronic device to send data of multiple files, the multiple files including a first file and a second file. The first electronic device sends the data of the first file to the second electronic device through the file transfer channel; The first electronic device sends the data of the second file to the second electronic device through the first file stream transmission channel.
2. The method according to claim 1, characterized in that, The first file is a file, document, or application package of a gallery, and the second file is cached data of the application; or, the data volume of the first file is greater than a preset threshold; the data volume of the second file is less than or equal to the preset threshold.
3. The method according to claim 1, characterized in that, Before establishing the file transfer channel and the first file stream transfer channel, the method further includes: When the total amount of data in the multiple files exceeds a preset value, the first electronic device modifies the bandwidth of the WiFi direct connection, and the modified bandwidth is greater than the original bandwidth.
4. The method according to any one of claims 1-3, characterized in that, The establishment of a file transfer channel with the second electronic device specifically includes: The first electronic device creates the first session; The first electronic device sends a first request to the second electronic device. The first request carries the identifier of the first session and the first session type. The first request is used to request the second electronic device to create a second session corresponding to the first session. The first electronic device receives a first response message, which carries the identifier of the first session and the identifier of the second session.
5. The method according to claim 4, characterized in that, The first electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transmission service platform, and the system library includes a transmission dynamic library. The method further includes: the application layer sending a first instruction to the transmission service platform, the first instruction carrying the first file path of each of the M files; the M files include the first file; The first electronic device creates a first session, specifically including: the transmission service platform responding to the first instruction and creating the first session; The method further includes: the transmission service platform sending a first start command to the transmission dynamic library, the first start command carrying the first file path of each file in the M files; the transmission dynamic library responding to the first start command, starting a first client, and saving the first file path of each file in the M files; The step of sending the data of the first file to the second electronic device through the file transfer channel specifically includes: The first client obtains the data of the first file based on the first file path of the first file, and sends the data of the first file and the identifier of the first session to the second electronic device.
6. The method according to claim 5, characterized in that, The transmission dynamic library also includes a sending engine, wherein sending the data of the first file and the identifier of the first session to the second electronic device specifically includes: When the data volume of the first file is less than or equal to a first threshold, the first client puts the data packet of the first file into a first queue; the data packet of the first file includes the identifier of the first session and part or all of the data of the first file; When the data volume of the first file is greater than the first threshold and less than the second threshold, the first client puts the data packet of the first file into the second queue; When the data volume of the first file is greater than or equal to the second threshold, the first client puts the data packet of the first file into the third queue; The first client sends data packets from the first queue, the second queue, and the third queue to the sending engine in parallel; The sending engine sends the received data packets to the second electronic device.
7. The method according to claim 6, characterized in that, The method further includes: The first client determines whether the first queue, the second queue, and the third queue contain data packets to be sent; When the first client does not contain a data packet to be sent in the first queue and the data volume of the first file is greater than the first threshold, the first client puts the data packet of the first file into the first queue. When the first client does not have a data packet to be sent in the second queue, and the data volume of the first file is less than or equal to the first threshold or greater than the second threshold, the first client puts the data packet of the first file into the second queue. When the third queue does not contain any data packets to be sent and the data volume of the first file is less than the second threshold, the first client places the data packets of the first file into the third queue.
8. The method according to any one of claims 1-7, characterized in that, Establishing a first file stream transmission channel with the second electronic device specifically includes: The first electronic device creates a third session; The first electronic device sends a second request to the second electronic device. The second request carries the identifier of the third session and the second session type. The second request is used to request the second electronic device to create a fourth session corresponding to the third session. The first electronic device receives a second response message, which carries the identifier of the third session and the identifier of the fourth session.
9. The method according to claim 8, characterized in that, The first electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transmission service platform, the system library includes a transmission dynamic library, and the transmission dynamic library includes a transmission engine. The method further includes: the application layer creating a first pipe and sending a second instruction to the transmission service platform, the second instruction carrying the outgoing file descriptor (FD) of the first pipe; The creation of the third session specifically includes: the transmission service platform responding to the second instruction to create a third session corresponding to the first pipe; The method further includes: the transmission service platform sending a third start command to the transmission dynamic library, the third start command carrying the identifier of the third session and the output FD of the first pipe; the transmission dynamic library responding to the third start command starts a second client and saves the identifier of the third session and the output FD of the first pipe. The first electronic device sends the data of the second file to the second electronic device through the first file stream transmission channel, specifically including: the application layer writing the data of the second file into the first pipe based on the ingress FD of the first pipe; the second client reading the data of the second file from the first pipe based on the egress FD of the first pipe; the second client sending the data packet of the second file to the sending engine; the data packet of the second file including the data of the second file read from the first pipe and the identifier of the third session; and the sending engine sending the received data packet of the second file to the second electronic device.
10. The method according to any one of claims 1-9, characterized in that, The plurality of files also includes a third file, and the method further includes: In response to the user's operation, the first electronic device establishes a second file stream transmission channel with the second electronic device; The first electronic device sends the data of the third file to the second electronic device through the second file stream transmission channel.
11. The method according to any one of claims 1-10, characterized in that, The plurality of files also includes a fourth file, and the method further includes: In response to the user's operation, the first electronic device establishes a third file stream transmission channel with the second electronic device; The first electronic device sends the data of the fourth file to the second electronic device through the third file stream transmission channel.
12. A data transmission method, characterized in that, Applied to a second electronic device, the method includes: The second electronic device establishes a direct WiFi connection with the first electronic device; The second electronic device establishes a file transfer channel and a first file stream transfer channel with the first electronic device; The second electronic device receives data from the first electronic device for a first file via the file transfer channel; The second electronic device receives data from the second file of the first electronic device through the first file stream transmission channel.
13. The method according to claim 12, characterized in that, The first file is a file, document, or application package of a gallery, and the second file is cached data of the application; or, the data volume of the first file is greater than a preset threshold; the data volume of the second file is less than or equal to the preset threshold.
14. The method according to claim 12 or 13, characterized in that, The establishment of a file transfer channel with the first electronic device specifically includes: receiving a first request from the first electronic device, the first request carrying an identifier of a first session and a first session type; responding to the first request, when the first session type is a file session, creating a second session corresponding to the first session; and sending first response information to the first electronic device, the first response information carrying an identifier of the first session and an identifier of the second session.
15. The method according to claim 14, characterized in that, The second electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transport service platform, and the system library includes a transport dynamic library. The receipt of the first request from the first electronic device specifically includes: the transmission service platform receiving the first request from the first electronic device, wherein the first request further includes the first file path of M files, and the M files include the first file; The step of responding to the first request and creating a second session corresponding to the first session when the first session type is a file session includes: the transmission service platform creating a second session corresponding to the first session when the first session type is a file session; The method further includes: the transmission service platform generating a second file path for the M files based on the first file path of the M files; the transmission service platform sending a second start command to the transmission dynamic library, the second start command carrying the identifier of the second session and the second file path of the M files; the transmission dynamic library responding to the second start command starting a first server and saving the identifier of the second session and the second file path of the M files; The step of sending the first response information to the first electronic device specifically includes: the transmission service platform sending the first response information to the first electronic device; The second electronic device receives data from the first electronic device's first file through the file transfer channel, specifically including: the first server receiving a data packet from the first electronic device's first file, the data packet of the first file including part or all of the first file's data and the identifier of the first session; and writing part or all of the first file's data to the second file path of the first file.
16. The method according to any one of claims 12-15, characterized in that, Establishing a first file stream transmission channel with the first electronic device specifically includes: The second electronic device receives a second request from the first electronic device, the second request carrying the identifier of the third session and the second session type; In response to the second request, the second electronic device creates a fourth session corresponding to the third session when the second session type is a file stream session; The second electronic device sends a second response message to the first electronic device, the second response message carrying the identifier of the third session and the identifier of the fourth session.
17. The method according to claim 16, characterized in that, The second electronic device includes an application layer, an application framework layer, and a system library. The application framework layer includes a transport service platform, and the system library includes a transport dynamic library. The receipt of the second request from the first electronic device specifically includes: the transmission service platform receiving the second request from the first electronic device; In response to the second request, when the second session type is a file stream session, creating a fourth session corresponding to the third session specifically includes: the transmission service platform, in response to the second request, creating a fourth session corresponding to the third session when the second session type is a file stream session; The method further includes: the transport service platform sending a first creation instruction to the application layer, the first creation instruction including an identifier of a fourth session; the application layer responding to the first creation instruction creating a second pipe and sending the identifier of the fourth session and the ingress file descriptor (FD) of the second pipe to the transport service platform; the transport service platform sending a fourth startup instruction to the transport dynamic library, the fourth startup instruction carrying the identifier of the fourth session and the ingress FD of the second pipe; the transport dynamic library responding to the fourth startup instruction starting a second server; the second server saving the identifier of the fourth session and the ingress FD of the second pipe, and sending a fourth notification to the transport server platform, the fourth notification indicating that the second server has started successfully. Sending the second response information to the first electronic device specifically includes: the transmission service platform sending the second response information to the first electronic device.
18. The method according to claim 17, characterized in that, The second electronic device receives data from the second file of the first electronic device through the first file stream transmission channel, specifically including: The second server receives a data packet from the first electronic device containing the data of the second file and an identifier of the third session. The second server determines the identifier of the fourth session corresponding to the identifier of the third session; The second server writes the data of the second file into the second pipe through the inlet FD of the second pipe corresponding to the identifier of the fourth session; The application layer reads data from the second file from the second pipe based on the output FD of the second pipe.
19. The method according to any one of claims 12-18, characterized in that, The method further includes: The second electronic device establishes a second file stream transmission channel with the first electronic device; The second electronic device receives data from a third file associated with the first electronic device via the second file stream transmission channel.
20. The method according to any one of claims 12-19, characterized in that, The method further includes: The second electronic device establishes a third file stream transmission channel with the first electronic device; The second electronic device receives data from the fourth file of the first electronic device through the third file stream transmission channel.
21. An electronic device, characterized in that, The device includes a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11 or 12-20.
22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, cause the electronic device to perform the method as described in any one of claims 1-11 or 12-20.
23. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, causes the electronic device to perform the method as described in any one of claims 1-11 or 12-20.