Communication method, related device and communication system

By establishing direct communication connections between electronic devices for file transfer, the problems of complex user operation and poor real-time performance in existing technologies are solved, enabling convenient and efficient device-to-device file transfer.

CN122137832APending Publication Date: 2026-06-02HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-11-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, file transfer between electronic devices requires a server as an intermediary, resulting in complex user operations and poor real-time performance.

Method used

By establishing direct communication connections between electronic devices, and utilizing the first and second service modules for device-to-device file transfer, server intermediaries are avoided.

Benefits of technology

It simplifies user operations, improves the real-time performance and convenience of file transfer, and reduces the performance requirements of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137832A_ABST
    Figure CN122137832A_ABST
Patent Text Reader

Abstract

This application applies to the field of communications, providing a communication method, related equipment, and a communication system. The method is applied to a first electronic device, which includes a first service module. The method includes: upon receiving a connection operation, sending a first connection request to a server through the first service module, causing the server to send a second connection request to a second electronic device, the second connection request being used to request the second electronic device to control the second service module to be in an operational state; establishing a communication connection between the first service module and the second service module of the second electronic device; and after the communication connection is successfully established, performing file transfer with the second electronic device through the communication connection upon receiving a file transfer operation. Based on the communication technology method of this application, the real-time performance and flexibility of file transfer can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more specifically, to a communication method, related equipment, and communication system. Background Technology

[0002] With the rapid development of electronic technology, users' demands for file transfer are increasing daily. Files stored on a first electronic device can be uploaded to a server serving that device. A second electronic device can then download files from the server.

[0003] Files not uploaded to the server by the first electronic device cannot be accessed by the second electronic device. Users need to perform operations on both the first and second electronic devices separately. Therefore, file transfer is inconvenient and lacks real-time speed, making user operations complex. Summary of the Invention

[0004] This application provides a communication method, related equipment, and communication system that can improve the real-time performance and flexibility of file transfer while reducing the complexity of user operations.

[0005] In a first aspect, a communication method is provided, wherein a first electronic device includes a first service module, the method comprising: upon detecting a connection operation, sending a first connection request to a server through the first service module, such that the server sends a second connection request to a second electronic device, the second connection request being used to request the second electronic device to control the second service module to be in an operating state; establishing a communication connection between the first service module and the second service module of the second electronic device; and after the communication connection is successfully established, upon detecting a file transfer operation, performing file transfer with the second electronic device through the communication connection.

[0006] The communication method provided in this application allows the first electronic device to send a connection request via a first service module based on a user's connection operation. This request is then sent to the second electronic device via a server, activating the second service module within the second electronic device. This establishes a communication connection between the first and second service modules. After the connection is established, the first electronic device performs file transfer with the second electronic device based on the user's file transfer operation. By operating the first electronic device, the user can establish a communication connection between the first and second service modules, enabling file transfer between the two devices. This method offers lower user complexity, higher real-time file transfer performance, and greater convenience, thus improving the user experience.

[0007] In some possible implementations, before transferring files with the second electronic device via the communication connection in response to a user's file transfer operation, the method further includes: sending a first file list request to the second electronic device via the communication connection, the first file list request including a display quantity threshold and a target path of the second electronic device; receiving first file list information sent by the second electronic device in response to the first file list request, the first file list information including file information of at least one first target file, wherein the quantity of at least one first target file stored under the target path is greater than or equal to the display quantity threshold; displaying a second application interface, the second application interface including the first file list information; the step of transferring files with the second electronic device via the communication connection in response to a user's file transfer operation includes: after receiving the file transfer operation in the second application interface, transferring files with the second electronic device via the communication connection.

[0008] The second application interface can be an interface displaying file information of files stored under the target path of the second electronic device. To obtain file information of files in the target directory of the second electronic device, the first electronic device can send a first file list request to the second electronic device. The first file list request includes the target path and a display quantity threshold. The display quantity threshold is the maximum number of file information entries displayed in the second application interface. In response to the first file list request, the second electronic device sends first file list information to the first electronic device. The first file list information includes file information of at least one first target file. Furthermore, if the number of at least one candidate file stored under the target path of the second electronic device is greater than or equal to the display quantity threshold, the number of at least one first target file equals the display quantity threshold. Therefore, after receiving the first file list request, if there are many candidate files stored under the target path, the second electronic device does not need to send the file information of all candidate files to the first electronic device; instead, it sends the file information of candidate files whose number is less than or equal to the display quantity threshold. Thus, the data volume of the file information of the first target files is smaller, allowing for faster transmission to the first electronic device. This means the first electronic device can display the file information of candidate files under the target path in a shorter time after sending the first file list request, improving the user experience.

[0009] In some possible implementations, the number of at least one candidate file stored under the target path is greater than the display quantity threshold, and the at least one first target file is the file corresponding to the first page number information; the method further includes: after receiving a page jump operation in the second application interface, sending a second file list request to the second electronic device through the communication connection, the second file list request including the second page number information indicated by the page jump operation; receiving second file list information sent by the second electronic device in response to the second file list request through the communication connection, the second file list information including file information of at least one second target file corresponding to the second page number information, the number of the at least one second target file being less than or equal to the display quantity threshold; and displaying the second file list information in the second application interface.

[0010] If the number of at least one candidate file stored under the target path in the second electronic device exceeds the display quantity threshold, the second electronic device can divide the file information into multiple pages. Different page numbers can correspond to different files. The number of files corresponding to each page number is less than or equal to the display quantity threshold. When the first electronic device displays the file information of the first target file corresponding to the first page number through the second application interface, based on the user's page jump operation in the first application interface, the first electronic device can send a second file list request to the second electronic device via a communication connection. The second file list request includes the second page number information indicated by the page jump operation. After receiving the second file list request, the second electronic device can send the second file list information back to the first electronic device. The second file list information includes the file information of at least one second target file corresponding to the second page number. Thus, when the user performs a page jump operation, the second electronic device promptly sends the file information of the file corresponding to the page number information indicated by the page jump operation to the first electronic device. When the user does not need to view the file information of the file corresponding to more page numbers, the second electronic device can stop transmitting this file information to the first electronic device, reducing the amount of data transmitted between the first and second electronic devices and reducing the occupation of transmission resources.

[0011] In some possible implementations, the method further includes: when the second application interface receives a sorting method adjustment operation, sending a third file list request to the second electronic device via the communication connection, the third file list request including the target sorting method indicated by the sorting method adjustment operation; and receiving third file list information sent by the second electronic device in response to the third file list request via the communication connection, the third file list information including file information of at least one third target file, the at least one third target file being the first candidate file in the sorting result of sorting the at least one candidate file according to the target sorting method.

[0012] Upon receiving a user's sorting adjustment operation on the second application interface, the first electronic device can send a third file list request to the second electronic device. After receiving the third file list request, the second electronic device can sort at least one candidate file stored in the target path according to the target sorting method specified in the request. The second electronic device can send third file list information to the first electronic device, where at least one third target file is the first candidate file in the sorting result. By sending the target sorting method indicated by the adjustment operation from the first electronic device to the second electronic device, the second electronic device sorts the candidate files according to the target sorting method and sends the file information of the first candidate file in the sorting result to the first electronic device. This reduces the amount of data transmitted between the second and first electronic devices while ensuring that the candidate files in the target path are arranged according to the user's instructions, thus improving user satisfaction.

[0013] In some possible implementations, the file transfer operation is an upload operation, and the step of transferring the file with the second electronic device through the communication connection after detecting the file transfer operation includes: transferring the first file in the first electronic device indicated by the upload operation to the second electronic device, so that the first file is stored in the target path.

[0014] When the file information of a file in the target path of the second electronic device is displayed on the second application interface of the first electronic device, if a user upload operation is detected, the first electronic device transfers the first file from its own device to the second electronic device, so that the second electronic device stores the first file in the target path. This provides greater flexibility in setting the path where the uploaded file is stored on the second device, allowing users to choose the optimal storage path and improving the user experience.

[0015] For example, after receiving an upload operation in the second application interface, the first electronic device can send an upload request to the second electronic device through the communication connection. The upload request may include a target path. After receiving the upload request, the second electronic device can send an upload response to the first electronic device through the communication connection. After receiving the upload response, the first electronic device can transfer the first file to the second electronic device.

[0016] In some possible implementations, the second electronic device transmits files to the first electronic device at the file block level. The method further includes: if the transmission is interrupted during the reception of file blocks, then after the transmission resumes, determining whether there are any file blocks among the received file blocks that have been modified after reception; if there are modified file blocks, sending a first transmission request to the second electronic device, the first transmission request carrying a first file block identifier of the modified file block; and receiving file data sent by the second electronic device in response to the first transmission request, the file data including the first target file block, the first target file block being determined based on the first file block identifier.

[0017] If, after a transmission interruption and retransmission, a modified file block exists within the file blocks already received by the first electronic device, the first electronic device sends a first file block identifier of the modified file block to the second electronic device. This ensures that the second electronic device sends the first target file block determined by the first file block identifier. Thus, by detecting and retransmitting the modified file block at the receiving end, it can be ensured that the file received by the receiving end is completely consistent with the file sent by the sending end, thereby avoiding file corruption or data loss due to transmission errors or network problems.

[0018] In some possible implementations, determining whether there are any file blocks that have been modified after being received in the received file blocks includes: if a first file exists, verifying each file block according to the verification information corresponding to each file block of the first file, wherein the update time of the first file is later than the time of the transmission interruption, the first file includes at least one of the received file blocks, and the verification information corresponding to each file block is information sent by the second electronic device received through the communication connection before the transmission interruption; and determining whether there are any file blocks that have been modified after being received in the received file blocks according to the verification results.

[0019] By checking whether the sent file blocks are modified during transmission interruption and resending the modified file blocks to the receiver, it can be ensured that the file received by the receiver is completely consistent with the file sent by the sender, thereby avoiding file corruption or data loss due to transmission errors or network problems.

[0020] In some possible implementations, the file data may also include a second target file block modified by the second electronic device, indicated by a second file block identifier, wherein the original file block indicated by the second file block identifier is included in the received file block.

[0021] By checking whether the sent file blocks are modified during transmission interruption and resending the modified file blocks to the receiver, it can be ensured that the file received by the receiver is completely consistent with the file sent by the sender, thereby avoiding file corruption or data loss due to transmission errors or network problems.

[0022] In some possible implementations, the method further includes: displaying a first application interface of a first application; the step of sending a first connection request to a server through the first service module after receiving a connection operation includes: after receiving the connection operation in the first application interface, sending the first connection request to the server through the first service module, wherein the first connection request and the second connection request include an application identifier of a second application in the second electronic device, and the second application is used to display the progress of the file transfer.

[0023] When the second application displays the progress of file transfer via the communication connection between the first and second service modules, the first connection request and the second connection request may include the application identifier of the second application. The second electronic device can determine the second service module based on the application identifier of the second application. The second service module can be understood as the service module corresponding to the application identifier of the second application. Thus, the method of determining the second service module is more flexible.

[0024] In a second aspect, a communication method is provided, applied to a second electronic device, comprising: responding to a second connection request sent by a receiving server, controlling a second service module to be in an operating state, wherein the second connection request is sent by the server upon receiving a first connection request sent by a first electronic device, and the first connection request is sent by a first service module in the first electronic device upon the first electronic device detecting a connection operation; establishing a communication connection between the second service module and the first service module of the first electronic device; and performing file transfer with the first electronic device through the communication connection.

[0025] Thirdly, a communication device is provided, including a unit for performing the method of the first or second aspect. The device may be an electronic device or a chip within an electronic device.

[0026] Fourthly, an electronic device is provided, including a memory and a processor, the memory for storing a computer program, and the processor for calling and running the computer program from the memory, causing the electronic device to perform the method of the first aspect or the second aspect.

[0027] Fifthly, a chip is provided, including a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to implement the method of the first aspect or the second aspect.

[0028] In a sixth aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing computer program code for implementing the method of the first aspect or the second aspect.

[0029] In a seventh aspect, a computer program product is provided, the computer program product comprising: computer program code, the computer program code being used to implement the method of the first aspect or the second aspect;

[0030] Eighthly, a communication system is provided, comprising a first electronic device, a second electronic device, and a server, wherein the first electronic device is configured to perform the method described in the first aspect, and the second electronic device is configured to perform the method described in the second aspect. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of a graphical user interface provided in an embodiment of this application;

[0032] Figure 2 This is a schematic diagram of a graphical user interface of an electronic device provided in an embodiment of this application;

[0033] Figure 3 This is a schematic flowchart illustrating a communication method provided in an embodiment of this application;

[0034] Figure 4 This is a schematic diagram of the software system of the electronic device provided in the embodiments of this application;

[0035] Figure 5 This is a schematic structural diagram of a communication system provided in an embodiment of this application;

[0036] Figure 6 This is a schematic flowchart illustrating another communication method provided in an embodiment of this application;

[0037] Figure 7 This is a schematic diagram illustrating the communication connection status between the first service module and the second service module;

[0038] Figure 8 This is a schematic flowchart of the communication method provided in the embodiments of this application;

[0039] Figure 9 This is a schematic flowchart illustrating another communication method provided in the embodiments of this application;

[0040] Figure 10 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0041] Figure 11 This is a schematic flowchart illustrating another communication method provided in the embodiments of this application;

[0042] Figure 12 This is a schematic flowchart illustrating another communication method provided in the embodiments of this application;

[0043] Figure 13 This is a schematic flowchart illustrating another communication method adopted in the embodiments of this application;

[0044] Figure 14 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0045] Figure 15 This is a schematic diagram of a hardware system for an electronic device applicable to this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0047] It should be understood that "at least one" in this application refers to one or more items, and "more than one" refers to two or more items. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document 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, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0048] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0049] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties (e.g., the user has given explicit consent, the user has been notified, etc.), and the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0050] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0051] With the rapid development of electronic technology, users' demands for file transfer are increasing daily. In near-field communication (NFC), two electronic devices can perform device-to-device (D2D) file transfer. In NFC, the communication technologies used by the electronic devices can be range-limited technologies such as Bluetooth and local area networks (LANs). However, when electronic devices communicate via far-field communication technologies such as mobile networks and the internet, such as… Figure 1 As shown in (a), the first electronic device 101 and the second electronic device 102 can transfer files via the server 103. After the first electronic device 101 uploads a stored file to the server 103, the second electronic device 102 can retrieve the file from the server 103. This method requires the server to have good concurrency performance and strong storage capacity, placing high demands on the server's performance.

[0052] The first electronic device 101 uploads the stored file to the server 103 based on the user's upload operation on the first electronic device 101. The second electronic device 102 retrieves the file from the server 103 based on the user's retrieval operation on the second electronic device 102. In other words, the second electronic device 102 cannot retrieve files stored on the first electronic device 101 that have not been uploaded to the server 103. The user needs to perform operations on both the first electronic device 101 and the second electronic device 102. Therefore, the user operation during file transfer is relatively complex.

[0053] To address the aforementioned problems, embodiments of this application provide a communication method. For example... Figure 1 As shown in (b), file transfer between the first electronic device 101 and the second electronic device 102 does not require the server 103 to store the transferred files, enabling D2D remote file transfer between electronic devices. Users can operate the first electronic device 101, and the first electronic device 101 can then access the files stored in the second electronic device 102, making user operation more convenient.

[0054] The user's actions on the first electronic device can be seen in [reference]. Figure 2 Explanation. For example... Figure 2 (a) in this application describes a graphical user interface (GUI) provided in an embodiment. A GUI provides a way for users to interact with computer applications through graphical elements (such as windows, icons, menus, and buttons). Figure 2 The GUI shown in (a) is the application interface 210 of the first application in the first electronic device. The application interface 210 includes controls corresponding to multiple electronic devices.

[0055] Upon detecting that the user has selected the control corresponding to device B among the multiple electronic devices, the first electronic device can display... Figure 2 The first application interface 220 is shown in (b) above. The application interface 220 includes a remote control control 221 and a file transfer control 222. When the user clicks the file transfer control 222, the first electronic device can detect whether a communication connection exists between the first service module and the second service module of device B. If no communication connection exists, the first electronic device can establish a communication connection between the first service module and the second service module with device B and display... Figure 2 The application interface 230 of the first application is shown in (c). The application interface 230 includes a disconnect control 231. Upon detecting that the user clicks the disconnect control 231, the first electronic device can stop establishing the communication connection between the first service module and the second service module with device B, and display... Figure 2The application interface 220 shown in (b) is either Figure 2 The application interface 210 is shown in (a) of the diagram.

[0056] Once the communication connection between the first service module and the second service module is successfully established, the first electronic device can obtain file information of files at a preset path in device B and display it. Figure 2 The application interface 240 of the first application is shown in (d). The application interface 240 includes file information of files in preset paths, such as the file names of the files in the preset paths, such as "folder1", "folder2", "file1", "file2" and "file3".

[0057] In the user Figure 2 In the application interface 220 of the first application shown in (b), click Figure 2 In the case of file transfer control 222 (b) in the above, if the first electronic device detects a communication connection between the first service module and the second service module, it can also display... Figure 2 The application interface 240 of the first application is shown in (d).

[0058] When the user clicks "Folder 1," the user indicates a new path. The first electronic device can retrieve file information of the files in the new path indicated by the user on device B. The application interface 240 can display the file information of the files in the new path indicated by the user.

[0059] The application interface 240 may also include a download control 243 and a selection icon corresponding to each displayed file information. Multiple file information entries may be arranged in a top-to-bottom order. The selection icon corresponding to each file information entry may be located to the left of that file information entry. Upon detecting that a user clicks on a selection icon corresponding to a file information entry, the first electronic device can determine that the user has selected the file corresponding to that file information entry. Upon detecting that a user clicks on the download control 243, the first electronic device can download the file corresponding to the file information selected by the user from the second electronic device.

[0060] The application interface 240 may also include a file download control corresponding to each displayed file information. The file download control for each file information may be located to the right of that file information. When a user clicks the file download control corresponding to a file information item, the first electronic device can download the file corresponding to that file information from the second electronic device.

[0061] The application interface 240 may also include an exit control 242. Upon detecting that the user clicks the exit control 242, the first electronic device can disconnect the communication connection between the first service module and the second service module in the second electronic device, and display... Figure 2The application interface 220 shown in (b) is either Figure 2 The application interface 210 is shown in (a) of the diagram.

[0062] The application interface 240 may also include other indicator controls 241. Upon detecting that a user clicks on another indicator control 241, such as... Figure 2 As shown in (e), the application interface 240 may include a file upload control 244 and a sorting method control 245.

[0063] Upon detecting that a user clicks on the sorting method control 245, the first electronic device can display as follows: Figure 2 The first application's application interface 250 is shown in (f). Application interface 250 includes a sorting method option and a confirmation control 251. When the user clicks on the sorting method option and then clicks on the confirmation control 251, the first electronic device can display application interface 240. Furthermore, the file information in application interface 240 is arranged according to the sorting method selected by the user.

[0064] When a file transfer occurs between the first electronic device and the second electronic device, the application interface 240 can also display a transfer progress control 246 after the user clicks on other indicator controls 241. Upon detecting that the user has clicked on the transfer progress control 246, the first electronic device can display the file transfer progress.

[0065] like Figure 2 As shown in (g), if the application interface 240 can include a file upload control 244, the user can also click on the file upload control 244. When the user clicks on the file upload control 244, the first electronic device can display as shown in (g). Figure 2 The application interface 260 of the first application is shown in (h). The application interface 260 includes file information of files locally stored on the first electronic device and a confirmation upload control 260. Upon detecting the user's selection of file information from locally stored files and clicking the confirmation upload control 260, the first electronic device can upload the file corresponding to the user's selected file information to the second electronic device. Figure 2 The path corresponding to (g) in the text.

[0066] Users can perform zoom operations on the application interface 240 to adjust the number of file information displayed on the application interface 240, i.e., adjust the display quantity threshold. Zoom operations can include pinch and expand operations. If a user pinch operation is detected, the display quantity threshold can be decreased. If a user pinch operation is detected, the display quantity threshold can be increased.

[0067] In display Figure 2During the process shown in the GUI, the first electronic device and the second electronic device can perform... Figure 3 The communication method is illustrated. The execution entity for each step in the method provided in this application can be an electronic device, or a software / hardware module within the electronic device capable of image acquisition. For ease of explanation, the following embodiments use an electronic device as an example.

[0068] Figure 3 This is a schematic flowchart of a communication method provided in an embodiment of this application. Figure 3 The method shown is applied to a communication system. The communication system includes a first electronic device, a second electronic device, and a server. Figure 3 The method shown includes steps S310 to S350.

[0069] Before proceeding to step S310, the first electronic device may display a first application interface.

[0070] Step S310: After receiving the connection operation, send the first connection request to the server.

[0071] The connection operation can be performed on the first application interface. The first service module can be an application or a module within an application. The first application interface can be the interface of the first application. The first application can be the application to which the first service module belongs, or it can be an application other than the application to which the first service module belongs. The content of an application's interface can be provided by that application. The service module can also be called a file transfer service.

[0072] The connection operation can be a first trigger operation on the first control in the first application interface. For example, the first application interface can be... Figure 2 The application interface 220 shown in (b) is the first trigger operation. Figure 2 The click operation of the transmission control 222 in the application interface 220 shown in (b) of the diagram. Or, Figure 2 The application interface 210 shown in (a) may include the names of multiple electronic devices and a file transfer control corresponding to the name of each electronic device. The first control may be the file transfer control corresponding to the name of a second electronic device. The first triggering operation may be a click operation on the file transfer control corresponding to the name of the second electronic device.

[0073] The first connection request is used to request the server to send a second connection request to the second electronic device. The second connection request is used to request the second electronic device to control the second service module to be in running state.

[0074] In step S320, in response to receiving the first connection request, the server sends a second connection request to the second electronic device.

[0075] The first connection request may include a second device identifier to instruct the server to send a second connection request to the second electronic device. The first electronic device records the second device identifier of the second electronic device.

[0076] The first connection request may also include a first device identifier of the first electronic device, so that the server can determine the sender of the first connection request.

[0077] Both the first connection request and the second connection request may include the identifier of the second service module in the second electronic device. Alternatively, both the first connection request and the second connection request may include the identifier of the second application in the second electronic device. The second application may be the application where the second service module resides, or it may be an application other than the application where the second service module resides. If the second application is an application other than the application where the second service module resides, the second service module can provide services to the second application. Thus, the second electronic device can determine the second service module based on the second application identifier and control the second service module to be in an operating state.

[0078] In step S330, in response to receiving the second connection request, the second electronic device controls the second service module to operate.

[0079] Step S340: The first electronic device and the second electronic device establish a communication connection between the first service module and the second service module.

[0080] The second connection request may include a first device identifier. During the establishment of a communication connection between the first and second service modules, the information sent by the first electronic device may carry the first device identifier. The second electronic device can then match the first device identifier carried in the information received from the first electronic device during the connection establishment process with the first device identifier carried in the second connection request. If the matching result is the same, the second service module can establish a communication connection with the first service module. If the matching result is different, the second service module can choose not to establish a communication connection with the first service module. This improves the security of the communication connection.

[0081] Both the first connection request and the second connection request may include the identifier of the first service module. During the establishment of a communication connection between the first and second service modules, the information sent by the first electronic device may carry the identifier of the first service module. If the matching result between the first application identifier carried in the information sent by the first electronic device and the identifier of the first service module carried in the second connection request is the same, the second service module may establish a communication connection with the first service module. If the matching result is different, the second service module may not establish a communication connection with the first service module. This improves the security of the communication connection.

[0082] Alternatively, both the first connection request and the second connection request may include a first application identifier of the first application. The first application identifier can be used to identify the first application. During the establishment of a communication connection between the first service module and the second service module, the information sent by the first electronic device may carry the first application identifier. If the first application identifier carried in the information sent by the first electronic device during the connection establishment process matches the second application identifier carried in the second connection request, the second application can establish a communication connection with the first application. If the matching results are different, the second application may choose not to establish a communication connection with the first application. This improves the security of the communication connection.

[0083] If the first application and the second application are the same application, the first connection request and the second connection request may include the application identifier of one of the applications.

[0084] Step S350: After the communication connection is successfully established, and after receiving the file transfer operation, file transfer is performed with the second electronic device through the communication connection.

[0085] After a successful communication connection is established, the first electronic device can output a prompt message to remind the user to perform a file transfer operation. For example, after a successful communication connection is established, the first electronic device can display a second application interface of the first application. This second application interface can be understood as the prompt message.

[0086] The following explanation uses the example of a first service module located in an application other than the first application, and a second service module located in an application other than the second application.

[0087] The first service module and the second service module can establish a communication connection based on preset parameters. Alternatively, in some cases, the establishment of a communication connection between the first service module and the second service module depends on the first transmission parameter information sent by the first application to the first service module, and the second transmission parameter information sent by the second service module to the first service module.

[0088] When the establishment of a communication connection between the first service module and the second service module depends on the first and second transmission parameter information, both the first and second connection requests include the second application identifier of the second application. Upon receiving the second connection request, the second electronic device can control the operation of the second application, causing it to send the second transmission parameter information to the second service module. The first transmission parameter information can be sent from the first application to the first service module when the first application receives a user connection operation from its first application interface.

[0089] Before step S310, the first service module can determine whether a communication connection exists between the first service module and the second service module. If the first service module determines that there is no service connection between the first service module and the second service module, step S310 can proceed. If the first service module determines that there is a service connection between the first service module and the second service module, step S350 can proceed.

[0090] After a user connects to the second electronic device, a communication connection can exist between the first and second service modules. With this communication connection established, the first application on the first electronic device can be either running or not running. After the user controls the first application to run by clicking a control on the desktop of the first electronic device, or after the first application runs due to the establishment of a communication connection between the first and second service modules, if a file transfer is being performed between the first and second service modules, the first service module can send transfer progress information to the first application.

[0091] In some embodiments, after receiving a file transfer operation in the second application interface, file transfer can be performed with the second electronic device via a communication connection. The second application interface of the first application displayed on the first electronic device after the communication connection is successfully established may include... Figure 2 The application interface 240 is shown in (d), (e), and (g). Alternatively, the second application interface of the first application may also include an interface with text such as "Connection successful".

[0092] File transfer between the first electronic device and the second electronic device can be carried out through the first service module and the second service module.

[0093] The communication method provided in this application embodiment allows the first electronic device to send a connection request via a first service module based on a user's triggering operation. This connection request is then sent to the second electronic device via a server, causing the second service module in the second electronic device to run. This establishes a communication connection between the first and second service modules. After the communication connection is established, the first electronic device transfers files with the second electronic device through this connection based on the user's file transfer operation. By operating the first electronic device, the user can establish a communication connection between the first service module in the first electronic device and the second service module in the second electronic device, thereby enabling file transfer between the two devices. This method offers lower user operation complexity, higher real-time file transfer performance, and greater convenience, improving the user experience.

[0094] In some embodiments, after a communication connection is established, the second application interface displayed by the first electronic device may include upload and download controls. When the first electronic device detects that a user clicks the upload control, the second interface may display file information of files stored in the first electronic device. Upon detecting a first selection operation by the user on the file information, the first electronic device may upload the file corresponding to the file information selected by the user through the first selection operation to the second electronic device.

[0095] If the second application interface includes upload and download controls, and the first electronic device detects a user's click on the download control, the second application interface can display file information of the file stored in the second electronic device. If a second selection operation by the user on the file information is detected, the first electronic device can download the file corresponding to the file information selected by the user through the second selection operation to the first electronic device.

[0096] To obtain file information of files stored in a second electronic device, a first electronic device can send a list information request to the second electronic device. The list information request may include a target path. After receiving the list information request, the second electronic device can send file information of candidate files under the target path to the first electronic device. The first electronic device can display the received file information of the candidate files through a second application interface.

[0097] A target path refers to a specific file storage location or directory. A target path can represent a folder on a disk, or other storage area that can be recognized and accessed by the operating system.

[0098] In other embodiments, after the communication connection is established but before the second application interface is displayed by the first electronic device, the first electronic device can send a first file list request to the second electronic device through the communication connection. The first file list request includes the target path of the second electronic device.

[0099] The target path can be preset in the first electronic device or determined based on user operation.

[0100] After receiving the first file list request, the second electronic device can send the first file list information to the first electronic device via a communication connection. The first file list information includes file information for at least one first target file. At least one candidate file is stored in the target path of the second electronic device. The at least one first target file belongs to the at least one candidate file. That is, the at least one first target file can be some or all of the candidate files stored in the target path of the second electronic device.

[0101] After receiving the first file list information, the first electronic device can display a second application interface. The second application interface can be used to display file information of the at least one first target file.

[0102] For example, the first file list request may include a display quantity threshold. The display quantity threshold is the maximum number of file information files that the first electronic device can display when displaying the second application interface. After receiving the first file list request, the second electronic device may divide the candidate files stored in the target path of the second electronic device into at least one part, and the number of candidate files in each part is less than or equal to the display quantity threshold. At least one part, and at most one part, has a number of candidate files less than the display quantity threshold.

[0103] In the first file list information sent by the second electronic device to the first electronic device, the file information of at least one first target file may be the file information of a file belonging to a portion obtained by the second electronic device. If the number of at least one candidate file is greater than or equal to the display quantity threshold, the number of at least one first target file may be the display quantity threshold.

[0104] Therefore, if the first file list request includes a display quantity threshold, the interface displayed by the first electronic device after receiving the first file list information may include file information of all files in the first file list information.

[0105] After receiving the first file list request, if the second electronic device has a large number of candidate files stored in the target path, it does not need to send the file information of all candidate files to the first electronic device. Instead, it sends the file information of candidate files whose number is less than or equal to the display quantity threshold. Therefore, the file information of the first target file is smaller and can be transmitted to the first electronic device more quickly. This means the first electronic device can display the file information of the candidate files in the target path in a shorter time after sending the first file list request, improving the user experience.

[0106] If the number of at least one candidate file stored under the target path exceeds the display quantity threshold, the second electronic device can divide the at least one candidate file into different parts, and the different parts can correspond to different page number information. At least one first target file in the first file list information is a file in the part corresponding to the first page number information.

[0107] The first file list information may also include multiple page number information. Different page number information can represent different page numbers. Page numbers start from 1 and are consecutive without interruption. The first file list information may also include the number of multiple page number information, that is, the number of candidate files that the second electronic device divides into at least one part. At least one candidate file in the first file list information sent by the second electronic device to the first electronic device may be the candidate file corresponding to the page number information representing page 1.

[0108] After receiving the first file list information, the second application interface displayed by the first electronic device may further include the number of page numbers. The second application interface may also include the page number represented by the first page number information. The page number represented by the first page number information may be 1.

[0109] When the first electronic device displays the second application interface, after receiving a page navigation operation on the second application interface, the first electronic device can send a second file list request to the second electronic device via a communication connection. The second file list request includes the second page number information indicating the page navigation operation.

[0110] After receiving the second file list request, the second electronic device can send the second file list information to the first electronic device via a communication connection. The second file list information includes file information for at least one second target file corresponding to the second page number information. The number of at least one second target file is less than or equal to the display quantity threshold.

[0111] After receiving the second file list information, the first electronic device can display the file information of at least one second target file in the second file list information on the second application interface.

[0112] When the file information in the second application interface changes from the file information of at least one first target file to the file information of at least one second target file, the page numbers in the second application interface can change from the page numbers represented by the first page number information to the page numbers represented by the second page number information. This allows users to easily adjust the displayed file information based on the page numbers in the second application interface.

[0113] Therefore, when a user performs a page jump operation, the second electronic device promptly sends the file information corresponding to the page number indicated by the page jump operation to the first electronic device. If the user does not need to view the file information corresponding to further page numbers, the second electronic device can stop transmitting this file information to the first electronic device, reducing the amount of data transmitted between the two devices and minimizing the consumption of transmission resources.

[0114] While the first electronic device displays the second application interface, the user can also adjust the sorting method. After detecting that the user has adjusted the sorting method on the second application interface, the first electronic device can send a third file list request to the second electronic device via a communication connection. The third file list request includes the target sorting method indicated by the sorting method adjustment operation.

[0115] The second application interface may include Figure 2 The application interface 240 shown in (d), (e), and (g) may also include Figure 2 The application interface 250 is shown in (f). The user receives sorting adjustment operations on the second application interface, which may include... Figure 2 (d) shows the user's click operation on other indicator controls 241. Figure 2 The click operation on the sorting method control 245 as described in (e) and the user's... Figure 2 The sorting method selection operation and the click operation of the confirmation control 251 are shown in the application interface 250 (f).

[0116] In the first file list information sent by the second electronic device to the first electronic device, the at least one first target file can be the file that appears first in the sorting result obtained by the second electronic device arranging at least one candidate file under the target path according to an initial sorting method. The initial sorting method can be a preset sorting method in the second electronic device, or it can be a sorting method carried in the first file list request sent by the first electronic device to the second electronic device. If the initial sorting method is carried in the first file list request, the initial sorting method can be a preset sorting method in the first electronic device, or it can be a sorting method specified by the user in the first electronic device.

[0117] After receiving the third file list request, the second electronic device can sort at least one candidate file stored under the target path according to the target sorting method in the third file list request. Then, the second electronic device can send the third file list information to the first electronic device via a communication connection. The third file list information includes file information of at least one third target file, which is the first candidate file in the sorting result of the at least one candidate file according to the target sorting method.

[0118] The first electronic device sends an adjustment operation instruction to the second electronic device, which then sorts the candidate files according to the target sorting method and sends the file information of the first candidate file in the sorting result back to the first electronic device. This reduces the amount of data transmitted between the second and first electronic devices while arranging the candidate files under the target path according to the user's instructions, thereby improving user satisfaction.

[0119] The second application interface facilitates the first electronic device downloading files from the second electronic device and uploading files from the first electronic device to the second electronic device.

[0120] For example, a file transfer operation performed by the user in the second application interface could be a download operation. A download operation could include the user's actions on the second application interface. Figure 2 The application interface 240 shown in (d) allows for the selection of file information and the clicking of the download control 243.

[0121] When the first electronic device detects that the user is performing a download operation on the second application interface, it can download the file corresponding to the file information selected by the user from the second electronic device.

[0122] For example, the file transfer operation performed by the user in the second application interface can also be an upload operation. The second application interface may also include Figure 2 The user interface 260 is shown in (h) above. The user's upload operation may include... Figure 2 The user's click operation on the file upload control 244 is shown in (g) in the figure, and in Figure 2 The application interface 260 shown in (h) allows users to select file information of files stored in the first electronic device and click on the upload control 244.

[0123] Upon detecting a user's upload operation, the first electronic device can transmit the first file in the first electronic device that indicates the upload operation to the second electronic device, so that the first file is stored in the target path of the second electronic device.

[0124] When the file information of a file in the target path of the second electronic device is displayed on the second application interface of the first electronic device, if a user upload operation is detected, the first electronic device transfers the first file from its own device to the second electronic device, so that the second electronic device stores the first file in the target path. In other words, the user can more flexibly adjust the settings for how files uploaded from the first electronic device are stored in the second device, making it easier for the user to choose the storage path of the first file in the second electronic device and improving the user experience.

[0125] For example, after receiving an upload operation in the second application interface, the first electronic device can send an upload request to the second electronic device through the communication connection. The upload request may include a target path. After receiving the upload request, the second electronic device can send an upload response to the first electronic device through the communication connection. After receiving the upload response, the first electronic device can transfer the first file to the second electronic device.

[0126] Users can also adjust the target path in the second application interface. For example, if the second application interface displayed on the first electronic device shows file information for at least one candidate file under the target path of the second electronic device, and the file information of a candidate file indicates that the file type of the candidate file is a folder, then the user's click on the folder can be considered a path adjustment operation. The subpath corresponding to that folder under the target path becomes the new target path.

[0127] Upon detecting a user's path adjustment operation on the second application interface, a fourth file list request can be sent to the second electronic device. The fourth file list request includes the new target path indicated by the path adjustment operation.

[0128] Upon receiving a request for a fourth file list, the second electronic device can send fourth file list information to the first electronic device. The fourth file list information includes file information for at least one fourth target file located in the new target path. Upon receiving the fourth file list information, the first electronic device can display the file information of at least one fourth target file through a second application interface.

[0129] File transfer between the first electronic device and the second electronic device can be performed at the file block level. During file transfer, interruptions may occur due to user actions or abnormal disconnections of the communication connection. Upon resumption of file transfer, the first electronic device and / or the second electronic device can identify the file blocks modified during the interruption and retransmit them to ensure that the file transmitted to the receiving end is consistent with the file transmitted to the sending end.

[0130] Taking the first electronic device as the receiving end as an example, if the transmission is interrupted during the process of the first electronic device receiving a file block through the first application, then after the transmission resumes, it is determined whether there is a file block that has been modified after the reception. If there is a modified file block, a first transmission request is sent to the second electronic device, and the first transmission request includes the first file block identifier of the modified file block.

[0131] After receiving the first transmission request, the second electronic device can send file data to the first electronic device. The file data includes the first target file block, which is determined based on the first file block identifier. That is, the first target file block can be understood as the file block corresponding to the first file block identifier in the second electronic device.

[0132] The information sent by the second electronic device, carrying each file block, may also include verification information for that file block. This verification information can be Message-Digest Algorithm 5 (MD5). MD5 is a widely used cryptographic hash function that can include a 128-bit (16-byte) hash value to ensure the integrity and consistency of transmitted information. The verification information for each file block is calculated based on that file block. The verification information calculated after a file block has been modified may differ from the verification information calculated for the file block before the modification.

[0133] After receiving each file block, the first electronic device can verify the file block based on the verification information corresponding to that file block in the information carried by that file block. For file blocks that pass verification, the first electronic device can store them and send an acknowledgment message for that file block to the second electronic device. For file blocks that fail verification, the first electronic device can choose not to send an acknowledgment message, allowing the second electronic device to resend the file block until it receives an acknowledgment message for the verification block from the first electronic device.

[0134] The file blocks already received by the first electronic device can be understood as file blocks that have passed verification. When transmission resumes after an interruption, each file block can be verified again using its verification information. File blocks that fail verification are considered modified. However, verifying each file block based on its verification information to determine if it has been modified requires significant computing resources.

[0135] To reduce the likelihood of determining if a file block has been modified, it is necessary to determine if a first file exists. The first file is one whose update time is later than the time of the transmission interruption, and the first file packet contains at least one received file block. If a first file exists, the file blocks within it are verified using the carried checksum information. Based on the verification result, it can be determined whether any file blocks in the received file have been modified after reception. File blocks that pass verification have not been modified after reception, while file blocks that fail verification have been modified after reception.

[0136] In addition to the receiving end being able to determine whether a modified file block exists, the sending end can also determine whether a modified file block exists.

[0137] The second electronic device can act as the sender of the file block. The file data sent by the second electronic device to the first electronic device may also include a second target file block, indicated by a second file block identifier, which has been modified by the second electronic device. The original file block indicated by the second file block identifier is included in the file block already received by the first electronic device.

[0138] For each file block in the second file whose transmission time is later than the interruption time, the second electronic device can perform verification based on the corresponding verification information of that file block. Among the file blocks already sent to the first electronic device, the file block identifier of the file block that failed verification can be used as the identifier of the second file block. The file blocks already sent to the first electronic device can be file blocks that have received corresponding acknowledgment information from the first electronic device.

[0139] The communication method provided in this application relates to a first electronic device and a second electronic device. For ease of understanding, the software system of the electronic device will be described below.

[0140] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of an electronic device.

[0141] Figure 4 This is a software architecture block diagram of an electronic device according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer and the kernel layer. The application layer may include a series of application packages.

[0142] like Figure 4 As shown, the application layer can include applications such as camera, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and photo album.

[0143] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0144] like Figure 4 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, file system, etc.

[0145] The window manager manages window programs. It can obtain the screen size, determine the presence of a status bar, lock the screen, and capture the screen. The content provider stores and retrieves data, making this data accessible to applications. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images. The phone manager provides communication functionality for the electronic device 100. The resource manager provides various resources for applications. The notification manager allows applications to display notification information in the status bar, which can be used to convey informational messages and can disappear automatically after a short pause without user interaction. The file system assigns a unique inode to each file stored on the electronic device's storage device to record file information. The inode and file data are stored together on the electronic device's storage device. The storage device can include disks, etc. The file system is a core component of the operating system, responsible for managing and organizing files on the storage device.

[0146] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0147] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0148] The application layer and application framework layer run in a virtual machine. The virtual machine executes the 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.

[0149] The kernel layer is the layer between hardware and software. The kernel layer can include driver modules. Driver modules can include display drivers, camera drivers, audio drivers, and sensor drivers, etc.

[0150] In the first electronic device, the application layer may further include a first application, a first file transfer service, and a first communication module. The first file transfer service may include a first task management module, a first task module, and a first connection management module. The first file transfer service and the first communication module may reside in applications other than the first application; they may reside in the same or different applications. After the first electronic device is powered on, it can control the operating state of the first communication module, but may not control the operating state of the first file transfer service.

[0151] In the second electronic device, the application layer may include a second application, a second file transfer service, and a second communication module. The second file transfer service may include a second task management module, a second task module, and a second connection management module.

[0152] The first electronic device may further include a first communication module. The first communication module may be located at the application layer, or may include portions located at the application framework layer, a portion located at the kernel layer, or more or fewer portions. The second electronic device may further include a second communication module.

[0153] Figure 5 This is a schematic structural diagram of a communication system provided in an embodiment of this application.

[0154] The communication system 400 includes a first electronic device 101, a second electronic device 102, and a server 103. The first electronic device 101 includes a first application, a first file transfer service, and a first communication module. The second electronic device 102 includes a second application, a second file transfer service, and a second communication module. Disks utilize magnetic recording technology to store data and are one of the main storage media in electronic devices.

[0155] In the communication system 400, the first electronic device 101 and the second electronic device 102 can establish a communication connection between the first service module and the second service module through the server 103. The first electronic device 101 and the second electronic device 102 can transfer file list information and files through this communication connection. After the file transfer is completed, the first electronic device 101 and the second electronic device 102 can disconnect the communication connection.

[0156] In order to establish a communication connection, the communication system 400 may perform steps S411 to S419.

[0157] Step S411: The first application sends the first connection establishment information to the first file transfer management service.

[0158] The first connection establishment information may include a second device identifier of the second electronic device 102 and a second application identifier of the second application in the second electronic device 102. The first connection establishment information may also include all or part of the parameters in the initialization connection parameters.

[0159] After the first file transfer management service receives the first connection establishment information, it proceeds to step S412.

[0160] In step S412, the first file transfer management service sends a first connection establishment request to the first communication module.

[0161] The first connection establishment request includes a second device identifier and a second application identifier, as well as a first device identifier of the first electronic device and a first application identifier of the first application.

[0162] Step S413: The first communication module forwards the first connection establishment request to the server.

[0163] In step S414, the server sends a second connection establishment request to the second communication module.

[0164] The second connection establishment request may include a first device identifier of the first electronic device, a first application identifier of the first application, and a second application identifier. For example, the second connection establishment request may also include a second device identifier. Where the first connection establishment information may also include initialization connection parameters, the second connection establishment request may also include initialization connection parameters.

[0165] Step S415: The second communication module initiates the second file transfer service.

[0166] Starting the second file transfer service can also be understood as waking up the second file transfer service or controlling its operation. In other words, it enables the second file transfer service to run when it is not currently in operation.

[0167] After receiving the second connection establishment request, the second communication module can determine the second file transfer service corresponding to the second application identified by the second application identifier, and control the system to operate in the second file transfer service state. Alternatively, the second communication module can send the identifier of the second application to other modules in the second electronic device 102, which can then control the operating state of the second file transfer service.

[0168] If the second file transfer service is in operation, the second file transfer service can proceed to step S416.

[0169] Step S416: The second file transfer service launches the second application.

[0170] Through steps S411 to S416, both the first application in the first electronic device 101 and the second application in the second electronic device 102 are running. Steps S411 to S416 can be understood as the service initialization process. After the user opens the first application on the first electronic device, they can click to enable the remote file transfer function on the application interface of the first application. When the first electronic device starts the first application, it can control the operation of the first file transfer service.

[0171] In response to the user enabling the file transfer function in the application interface of the first application, the first file transfer service can send a connection establishment request to the remote second electronic device through the server. After receiving the connection establishment request, the second electronic device enables the second file transfer service and controls the operation of the second application through the second file transfer service. At this point, the file transfer services on both ends have been launched by the upper-layer business application and are both in running state. After step S416, the first electronic device and the second electronic device can establish a communication connection between the first service module and the second service module.

[0172] If the second application is running, step S417 can be performed.

[0173] Step S417: The first file transfer and the second file transfer services establish a communication connection between the first service module and the second service module.

[0174] Both the first and second file transfer services can request to establish a communication connection. The communication connection between the first and second service modules can also be called a far-field transmission channel connection. This communication connection can be a peer-to-peer (P2P) connection or a relay connection.

[0175] After the negotiation between the first file transfer and the second file transfer services is completed, the communication connection is successfully established. Steps S418 and S419 can then be performed.

[0176] In step S418, the first file transfer sends a connection success message to the first application.

[0177] In step S419, the first file transfer sends a connection success message to the second application.

[0178] Through steps S418 to S419, the first file transfer and the second file transfer services notify the upper-layer application that the communication connection has been successfully established.

[0179] After a communication connection is successfully established between the first electronic device 101 and the second electronic device 102, the second electronic device 102 can send a file list request to the first electronic device 101. The file list information can also be understood as directory information.

[0180] In step S421, the first application may send a file list request to the first file transfer service.

[0181] The file list request carries the first path information.

[0182] In step S421, the first file transfer service may forward the file list request to the second file transfer service.

[0183] Step S423: The second file transfer service obtains the file list information of the target path represented by the first path information in the second disk.

[0184] In step S424, the second file transfer service sends the file list information of the target path to the first file transfer service.

[0185] Step S425: The first file transfer service sends file list information to the first application.

[0186] After the first application receives the file list information, it can display the file list information.

[0187] Through steps S211 to S425, after the communication connection is successfully established, the first electronic device can obtain file list information under the target path in the second electronic device through the first file transfer service. After obtaining the file list information under the target path, the first electronic device displays the file list information on the application interface of the first application. The page displaying the file list information can be understood as the remote file page of the first electronic device.

[0188] The user can instruct the first electronic device to download one or more files corresponding to the file information displayed in the file list. Alternatively, the user can upload files stored in the first electronic device 101 to the second electronic device 102. For example, during the file upload process, the communication system 400 can perform steps S431 to S434.

[0189] Step S431: The first application sends an upload request to the first file transfer service.

[0190] The upload request includes the second file path information and file information.

[0191] In step S432, the first file transfer service reads a file from the first disk based on the second file path information and the file information.

[0192] Step S433: The first file transfer service sends a file to the second file transfer service.

[0193] In step S434, the second file transfer service stores the file on the second disk.

[0194] After the file transfer is completed, the first electronic device 101 and the second electronic device 102 can proceed to steps S441 to S444.

[0195] Step S441: The first application sends a disconnection instruction to the first file transfer service.

[0196] Step S442: The first file transfer service disconnects from the second file transfer service.

[0197] After the connection is broken, the first file transfer service can proceed to step S443, and the second file transfer service can proceed to step S444.

[0198] In step S443, the first file transfer service sends a disconnection notification to the first application.

[0199] In step S444, the second file transfer service sends a disconnection notification to the second application.

[0200] The user disconnects the connection from the application interface of the first application. This disconnection can be achieved by clicking the disconnect control within the first application's interface or by exiting the first application's interface. The communication connection between the first file transfer service of the first electronic device and the second file service of the second electronic device is broken.

[0201] When a communication connection exists between the first service module and the second service module, both the first file transfer service and the second file transfer service can be configured with transfer tasks for file transfer or file list information transfer. If the communication connection is disconnected by the user, both the first file transfer service and the second file transfer service can destroy the transfer tasks configured within the service.

[0202] The following is combined with Figure 6 The process of establishing a communication connection between the first service module and the second service module is explained.

[0203] Figure 6 This is a schematic flowchart illustrating a communication method provided in an embodiment of this application. The first file transfer service may include a first task management module, a first task module, and a first connection management module. The second file transfer service includes a second task management module, a second task module, and a second connection management module.

[0204] Before proceeding to step S611, the first electronic device can receive an identifier of the first electronic device sent by the server. The first application in the first electronic device and the second application in the second electronic device can be logged into with the same account. When the user opens the first application and it runs, the first application can send the account identifier of the account it is logged into to the server. After receiving the account identifier sent by the first application, the server can send an identifier of the electronic device logged into with the account represented by that account identifier to the first application. The first application can display the electronic device represented by the electronic device identifier sent by the server through its application interface. For example, Figure 2 The multiple electronic devices shown in (a) may be electronic devices that have the same account as the first application login.

[0205] The first application and the second application can be the same or different applications. For example, the first application and the second application can have the same or different package names. The application's package name is a unique identifier used to distinguish different applications within the system. The system uses package names to identify and manage applications, including operations such as installation, updates, and uninstallation.

[0206] Step S611: The first application obtains the user's connection operation.

[0207] A user's connection action can be an operation performed by the user on a first application of a first electronic device. The user's connection action can also instruct a second application of a second electronic device. For example, the user's connection action can be a triggering operation on a first control within the first application interface of the first application.

[0208] In response to the acquisition of the connection operation, the first application can proceed to step S612. Step S612 can be understood as step S411.

[0209] In step S612, the first application sends the first connection establishment information to the first task management module.

[0210] The first connection establishment information includes the second device identifier of the second electronic device and the second application identifier of the second application in the second electronic device.

[0211] The first connection establishment information may also include first transmission parameter information. The first transmission parameter information may include one or more parameters and their values, such as the save path when the first electronic device downloads a file through the communication connection between the first service module and the second service module, the display quantity threshold in the first electronic device, the file arrangement method in the first electronic device, and the idle time threshold. The parameter value of each parameter in the first transmission parameter information can be understood as the default value for that parameter. The first transmission parameter information is information recorded by the first application.

[0212] After receiving the first connection establishment information, the first task management module can proceed to step S613. Step S613 may include steps S412 and S413.

[0213] In step S613, the first task management module sends a first connection establishment request to the server 103.

[0214] The first connection establishment request includes the second device information, the second application identifier, and the first device identifier of the first electronic device 103 and the first application identifier of the first application.

[0215] It should be understood that the first task management module can send the first connection establishment request through the first communication module in the first electronic device 101. That is, the first connection establishment request sent by the first task management module can be forwarded to the server 103 through the first communication module.

[0216] The first connection establishment request can be carried in a first message queuing telemetry transport (MQTT) message sent by the first electronic device to the server.

[0217] After receiving the first connection establishment request, server 103 can proceed to step S614. Step S614 can be understood as step S414.

[0218] In step S614, server 103 sends a second connection establishment request to the second communication module in the second electronic device 102.

[0219] The second connection establishment request includes a first device identifier, a first application identifier, and a second application identifier. The second connection establishment request may also include a second device identifier. The second connection establishment request may be carried in a second MQTT message sent by the server to the second electronic device.

[0220] After receiving the second connection establishment request, the second communication module can control the operation of the second application corresponding to the second application identifier and the second file transfer service, and proceed to step S615. Step S615 can be understood as step S415.

[0221] In step S615, the second communication module initiates the second file transfer service and sends the second connection establishment information to the second task management module in the second file transfer service.

[0222] The second connection establishment information includes the first device identifier, the first application identifier, and the second application identifier.

[0223] The second file transfer module can perform step S616 based on the second connection establishment information. Step S616 can be understood as step S416.

[0224] Step S616: The second task management module launches the second application.

[0225] After the second task management module launches the second application, it can also send information carrying the first device identifier and the first application identifier to the second application.

[0226] If the second application is running, step S617 can be performed.

[0227] In step S617, the second application sends a third connection establishment message to the second task management module.

[0228] The third connection establishment information includes the second transmission parameter information. The second transmission parameter information may include one or more parameters and their values, such as the save path when the second electronic device downloads files through the communication connection between the first and second service modules, the display quantity threshold in the second electronic device, the file arrangement method in the second electronic device, and the idle time threshold. The parameter value of each parameter in the second transmission parameter information can be understood as the default value for that parameter. The second transmission parameter information is information recorded by the second application. The parameters in the first and second transmission parameter information may be the same or different, and the parameter values ​​of the same parameters may also be the same or different.

[0229] Through steps S611 to S617, the second application and the second file transfer service in the second electronic device are in operation. Furthermore, both the first service module and the second service module have obtained the device identifier and application identifier of the peer device involved in the file transfer.

[0230] After receiving the first connection establishment information, the first task management module can also perform steps S621 and S624. In step S621, the first file transfer service initializes the connection.

[0231] During connection initialization, the first task management module can initialize thread resources and sockets, and set parameter values ​​according to the first transmission parameter information.

[0232] Sockets play a crucial role in communication; they are a fundamental component of network communication, allowing processes on different hosts to exchange data. As the endpoint of network communication, a socket provides a clear interface for inter-process communication. Initializing a socket marks the beginning of preparations for network communication and ensures that subsequent communication operations can proceed smoothly.

[0233] In subsequent communication processes, the first task module and the first connection management module can call the thread created by the first task management module through initialization to achieve the corresponding function.

[0234] During connection initialization, the first task management module can also detect the parameters in the first transmission parameter information to determine whether each parameter and its value meet preset requirements such as format. If the detection result of the parameters in the first transmission parameter information indicates that they meet the preset requirements, the first task management module can send the save path, display quantity threshold, and file arrangement method in the first transmission parameter information to the first task module, and send the idle time threshold to the first connection management module.

[0235] In step S624, the first task management module sends a third connection establishment request to the first connection management module.

[0236] The third connection establishment request includes a second device identifier and a second application identifier.

[0237] After the second application receives the second connection establishment information, the second electronic device can perform steps S622, S623 and S625.

[0238] Step S622: The second application sends the second connection establishment information to the second task management module.

[0239] Step S623: The second file transfer service is initialized.

[0240] During connection initialization, the second task management module can initialize thread resources and sockets, and set parameter values ​​according to the second transmission parameter information.

[0241] During the connection initialization process, the second task management module can also send the save path, display quantity threshold and file arrangement method from the second transmission parameter information to the second task module, and send the idle time threshold to the second connection management module.

[0242] In step S625, the second task management module sends a fourth connection establishment request to the second connection management module.

[0243] The fourth connection establishment request includes the first device identifier and the first application identifier.

[0244] After steps S621, S623 to S625, the first connection management module and the second connection management module can proceed to steps S626, S631 to S633.

[0245] Step S626: The first connection management module establishes an initial connection with the second connection management module.

[0246] Steps S624 to S626 can be understood as the initial connection establishment process. The initial connection can also be understood as the connection between the first electronic device and the second electronic device. After step S626, through the initial connection, the communication system 400 can establish a communication connection between the first service module and the second service module. After step S626, the first connection management module and the second connection management module can proceed to step S631.

[0247] Step S631: The first connection management module and the second connection management module negotiate connection information through an initial connection.

[0248] Connection information negotiation includes negotiating one or more of the following: transmission protocol, encryption algorithm, public key, certificate, and protocol capabilities. Protocol capabilities include whether compressed transmission is supported, whether interrupted resume is supported, and whether the idle time threshold can be changed. Negotiation of the transmission protocol can include negotiating the transmission protocol type and / or version number. The encryption algorithm and public key can be used to encrypt and decrypt information subsequently transmitted through this communication connection. The protocol version is used to indicate how the first and second file transfer services process information transmitted through this communication connection. The first and second electronic devices can determine the security of the other device through certificate exchange. Capability support can be used to adjust the status of the communication connection or the method of information transmission through the communication connection during subsequent communication. After connection information negotiation in step S631, the communication connection between the first and second service modules is successfully established. The communication connection between the first and second service modules can also be understood as a file transfer channel between the first and second electronic devices.

[0249] Step S417 may include steps S621 to S626, and step S631. After step S631, the first connection management module may perform step S632, and the second connection management module may perform step S633. Step S632 can be understood as step S418, and step S433 can be understood as step S419.

[0250] In step S632, the first connection management module sends a connection success message to the first application.

[0251] In step S633, the second connection management module sends a connection success message to the second application.

[0252] In step S612, after receiving the first connection establishment request sent by the first application, the first task management module can further determine whether a communication connection exists between the first service module and the second service module. If no communication connection exists between the first service module and the second service module, the first task management module can proceed to step S613. If a communication connection exists between the first service module and the second service module, the first task management module can skip step S613 and return a connection success message to the first application.

[0253] After receiving the first connection establishment request sent by the first application upon detecting a user's connection operation, the first task management module determines that a communication connection exists between the first service module and the second service module. This may be due to the following reasons: before the first task management module receives the first connection establishment request, the user of the second electronic device performs a connection operation on the second electronic device, thus establishing a communication connection between the first service module and the second service module.

[0254] After the first connection management module and the second connection management module perform step S631 to successfully establish a communication connection between the first service module and the second service module, the connection success information sent by the connection management module to the application can be forwarded through the connection management module. The connection management module can record the existence of a communication connection between the first service module and the second service module.

[0255] After the communication connection between the first service module and the second service module is successfully established, the first electronic device and the second electronic device can monitor and control the status of the communication connection. After the communication connection between the first service module and the second service module is successfully established, the communication connection is in a connected state.

[0256] When the communication connection between the first service module and the second service module is in a connected state, the state of the connection can be controlled.

[0257] Figure 7 A schematic diagram showing the communication connection status between the first service module and the second service module is provided.

[0258] In step S626, after the initial connection is established, the communication connection between the first service module and the second service module can be understood as being in the initial state (initial, init).

[0259] During the connection information negotiation process in step S631, the communication connection between the first service module and the second service module changes from the initial state to the connecting state. After the connection information negotiation in step S631, the connection is successfully established, and the communication connection between the first service module and the second service module changes from the connecting state to the connected state. If the connection fails, it enters the disconnected state.

[0260] When a communication connection exists between the first service module and the second service module, the first electronic device and / or the second electronic device can manage the state of the communication connection. For example, the first connection management module in the first electronic device can detect the length of time the connection has been without data transmission and, through... Figure 8 The method shown can adjust the state of the communication connection between the first service module and the second service module.

[0261] Figure 8 This is a schematic flowchart of the communication method provided in the embodiments of this application. When the communication connection is in a connected state, the first connection management module can perform step S801.

[0262] Step S801: The first connection management module determines whether there is no data transmission in the communication connection between the first service module and the second service module within the first preset time period.

[0263] If data transmission occurs within the first preset duration, step S801 can be performed again. The time interval between steps S801 performed on adjacent sides can be less than the first preset duration. If no data transmission occurs within the first preset duration, the first connection management module can determine that the communication connection is in an idle state and proceed to step S802.

[0264] Determining whether data transmission occurs during the communication connection between the first and second electronic devices can be understood as monitoring that communication connection. Once the communication connection is successfully established, monitoring of that connection can begin.

[0265] In step S802, the first connection management module sends a keep-alive packet to the second connection management module through the communication connection.

[0266] A survival kit can also be called a heartbeat kit.

[0267] The second connection management module can perform step S803 upon receiving a keep-alive packet.

[0268] In step S803, the second connection management module sends a response message to the first connection management module through the communication connection.

[0269] The first connection management module can send a keep-alive packet to the second connection management module in step S802, or after receiving the response information in step S803, it can proceed to step S804.

[0270] When the communication connection between the first service module and the second service module is in an idle state, if the first electronic device and the second electronic device transmit data through this communication connection, the communication connection will transition from the idle state to the connected state. When the communication connection between the first service module and the second service module is in the connected state, the first connection management module does not need to send a keep-alive packet.

[0271] Step S804: The first connection management module determines whether there is no data transmission within a time period of an idle time threshold.

[0272] The time period with a duration equal to the idle time threshold can be the time period with a duration equal to the idle time threshold before step S804.

[0273] If data transmission occurs within a time period whose duration is determined to be the idle time threshold, step S802 can be performed again.

[0274] If the duration of no data transmission in the communication connection between the first service module and the second service module is greater than or equal to a third preset duration, the communication connection between the first electronic device and the second electronic device is disconnected. To ensure the existence of a communication connection, the duration of two consecutive steps S802 is less than the third duration threshold.

[0275] For example, the third preset duration can be 30 seconds, and the time interval between two consecutive steps S802, i.e., the time interval between two consecutive send of keep-alive packets, can be 20 seconds.

[0276] If there is no data transmission in the communication connection between the first service module and the second service module within a time period whose duration is determined to be the idle time threshold, the first connection management module and the second connection management module can proceed to step S805.

[0277] Step S805: The first connection management module disconnects from the second connection management module.

[0278] The first connection management module disconnects from the second connection management module, that is, the communication connection between the first electronic device and the second electronic device is disconnected.

[0279] After step S805, the first connection management module can proceed to step S806, and the second connection management module can proceed to step S807.

[0280] In step S806, the first connection management module sends a connection disconnection message to the first application.

[0281] In step S807, the second connection management module sends a connection disconnection message to the second application.

[0282] After step S805, the connection between the first connection management module and the second connection management module is disconnected.

[0283] When the connection between the first connection management module and the second connection management module is in a connected state or an idle state, the connection may be abnormally disconnected due to network anomalies or other reasons, and the connection will be in a disconnected state.

[0284] like Figure 8 As shown in (b), when the communication connection is abnormally disconnected or fails, resulting in the connection between the first connection management module and the second connection management module being in a disconnected state, the first connection management module can send abnormal disconnection information to the first task module, and the second connection management module can send abnormal disconnection information to the second task module.

[0285] During data transmission between the first task module and the second task module via this communication connection, after receiving an abnormal disconnection message, the first task module can proceed to step S821. After receiving the abnormal disconnection message, the second task module can proceed to step S822.

[0286] Step S821: The first task module pauses data transmission.

[0287] In step S822, the second task module pauses data transmission.

[0288] The first task module and the second task module can record the transmission progress respectively.

[0289] In the case of a communication connection, the first connection management module and the second connection management module can perform step S823.

[0290] Step S823: The first connection management module and the second connection management module reconnect.

[0291] During the reconnection process, the communication connection between the first connection management module and the second connection management module remains in a connected state. If the communication connection is successfully reconnected via step S823, the first connection management module can proceed to step S814, and the second connection management module can proceed to step S815.

[0292] In step S814, the first connection management module sends a connection success message to the first task module.

[0293] In step S815, the second connection management module sends a connection success message to the second task module.

[0294] Upon receiving a connection success message, the first task module may proceed to step S823. Upon receiving a connection success message, the second task module may proceed to step S824.

[0295] Step S823: The first task module resumes data transmission.

[0296] Step S824: The second task module resumes data transmission.

[0297] If the reconnection attempt in step S823 fails, the first connection management module can send network error information to the first application, and the second connection management module can send network error information to the second application. The first application and / or the second application can output a prompt message indicating a network error. The prompt message can also remind the user to switch networks.

[0298] The disconnection of the communication connection between the first service module and the second service module can also be based on a user instruction. If the first application detects a user disconnection operation, it can proceed to step S441, sending a disconnection instruction to the first connection management module. Figure 2 The operation of clicking the exit control 242 on the application interface 240 shown in (d) can also be the operation of the user controlling the first application to exit.

[0299] Based on the received disconnection instruction, the first connection management module can disconnect the communication connection between the first service module and the second service module from the second connection management module. In the event that the communication connection is disconnected, the first establishment management module can send a disconnection notification to the first application, and the second establishment management module can send a disconnection notification to the second application.

[0300] After a communication connection is successfully established between the first electronic device and the second electronic device, they can transfer files through this connection. To facilitate file downloads from the second electronic device to the user of the first electronic device, the first electronic device can obtain file information stored on the second electronic device and display this information to the user. The following section combines... Figure 9 The process of obtaining file information is explained.

[0301] Figure 9 This is a schematic flowchart of a communication method provided in an embodiment of this application.

[0302] After the first application receives the connection success information sent by the first connection management module or the first task management module, the first application can proceed to step S901.

[0303] In step S901, the first application sends a first directory request to the first task management module. The first directory request may be a file list request sent by the first application to the first file transfer service in step S421.

[0304] The first directory request may include a target path. The target path may be a path indicated by user actions or a default path recorded by the first electronic device.

[0305] If the user specifies a sorting method parameter value, the first directory request may also include sorting method indication information, which indicates the sorting method parameter value specified by the user. If the user specifies a display quantity threshold, the first directory request may also include the display quantity threshold parameter value specified by the user. The display quantity threshold indicates the maximum number of file information items that can be displayed on one page when the first electronic device displays file information.

[0306] For example, after a successful communication connection is established between the first electronic device and the second electronic device, the first application in the first electronic device can send a first directory request in response to the connection success information sent by the first file transfer service. That is, after the communication connection is established but before the first application sends the first directory request for the first time, if the user of the first electronic device may not have yet set the sorting method and display quantity threshold, the first directory request may not include the parameter values ​​for the sorting method and display quantity threshold. However, if the user has set the parameter values ​​for the sorting method and display quantity threshold on the first electronic device after the communication connection is established but before the first application sends the first directory request for the first time, the first directory request can include the parameter values ​​for the sorting method and display quantity threshold.

[0307] If the transmission parameter information in the first connection establishment information does not include a display quantity threshold, the first directory request may include a display quantity threshold parameter value. If the transmission parameter information in the first connection establishment information does not include a sorting method, the first directory request may include a sorting method parameter value.

[0308] If the first connection establishment information includes a sorting method, but the user adjusts the default sorting method after the first application sends the first connection establishment information, the first directory request sent by the first application to the first task management module may include the new parameter value of the sorting method indicated by the user. Similarly, if the first connection establishment information includes a display quantity threshold, but the user adjusts the default display quantity threshold after the first application sends the first connection establishment information, the first directory request sent by the first application to the first task management module may include the new parameter value of the display quantity threshold indicated by the user.

[0309] After receiving the first directory request sent by the first application, the first task management module can proceed to step S902.

[0310] Step S902: The first task management module creates a first directory task in the first task module.

[0311] The first directory task is used to obtain file information for files in the target path. File information may include one or more of the following: filename, file type, file size, file path, and modification time.

[0312] During the creation of the first directory task, the first task management module can set the transmission parameters corresponding to the first directory task. The transmission parameters corresponding to the first directory task include the target path, the display quantity threshold of the first electronic device, and the sorting method, etc.

[0313] For either the display quantity threshold or the sorting method, if the first directory request includes a value for that parameter, the value of that parameter in the transmission parameters corresponding to the first directory task is the value of the sorting method parameter in the first directory request. If the first directory request does not include a value for that parameter, the value of that parameter in the transmission parameters corresponding to the first directory task can be either the value of that parameter carried in the first connection establishment request or the default value of that parameter recorded in the first task management module.

[0314] In the transmission parameters corresponding to the first directory task, the value of the target path parameter is the same as the value of the target path in the first directory request.

[0315] In step S903, the first task module sends a second directory request to the first connection management module through the directory task.

[0316] The second directory request may include the parameter value of each transmission parameter in the transmission parameters corresponding to the first directory task.

[0317] In step S904, the first connection management module sends a second directory request to the second connection management module.

[0318] The second directory request sent from the first connection management module to the second connection management module can be understood as the file list request sent from the first file transfer service to the second file transfer service in step S422.

[0319] In step S905, the second connection management module sends a second directory request to the second task management module.

[0320] During the creation of a second directory task, the second task management module can set the transmission parameters corresponding to the second directory task. The parameter values ​​of the transmission parameters corresponding to the second directory task are the parameter values ​​carried in the second directory request.

[0321] Step S906: The second task management module creates a second directory task in the second task module.

[0322] The second directory task is used to send file information of files under the target path to the first electronic device. The second directory task can obtain file information of files under the target path from the second disk of the second electronic device. The target path refers to the path on the second disk.

[0323] In step S907, the second task module determines the information on page 1 through the second directory task.

[0324] After step S906, the second directory task can proceed to step S423 to obtain file information of files under the target path of the second disk.

[0325] After obtaining the file information of the files under the target path, the information on page 1 can be determined by the second task module by arranging the file information of the files under the target path according to the sorting method in the transmission parameters corresponding to the second directory task. For the method by which the second task module determines the information on page 1, please refer to [link to documentation]. Figure 10 The explanation is as follows: Page 1 information may include file information for at least one file under the target path. If the number of files under the target path is greater than or equal to the display quantity threshold of the first electronic device, the second task module may divide the files under the target path into multiple pages of information.

[0326] In step S908, the second task module sends the information of page 1 to the second connection management module.

[0327] In step S909, the second connection management module sends the information of page 1 to the first connection management module.

[0328] The sending of page 1 information from the second connection management module to the first connection management module can be understood as the file list information sent from the first file transfer service to the second file transfer service in step S422.

[0329] In step S910, the first connection management module sends the first page information to the first task module.

[0330] The first task module can receive the information on page 1 through the first directory task and proceed to step S911.

[0331] In step S911, the first task module can send page 1 information to the first application through the first directory task.

[0332] Thus, the first application can display the information on page 1.

[0333] The page number may be adjusted while the user is viewing the information on page 1.

[0334] Step S921: The first application detects the user's page number adjustment operation.

[0335] Step S922: The first application sends page number information to the first task module.

[0336] The page number information indicates the i-th page in the user's page number adjustment instruction. The first task module can receive the page number information through the first directory task.

[0337] In step S923, the first task module sends page number information to the second task module through the first directory task.

[0338] It should be understood that information transmission between the first task module and the second task module requires forwarding through the first connection management module and the second connection management module. For example, page number information sent from the first directory task to the second task module can be forwarded through the first connection management module and the second connection management module. Subsequent steps will not be elaborated further.

[0339] The second task module can receive page number information through the second directory task.

[0340] In step S924, the second task module determines the information of page i through the second directory task.

[0341] In step S925, the second task module sends the information of page i to the first task module through the second directory task.

[0342] Step S926: The first task module sends the information of page i to the first application through the first directory task.

[0343] Step S927: The first task module sends the information of page i to the first application through the first directory task.

[0344] Therefore, the first application can display the information on page i.

[0345] When the first electronic device displays the information on page i through the application interface of the first application, the user can also adjust the sorting method of the file information.

[0346] In step S931, the first application detects the user's update sorting operation.

[0347] Step S932: The first application sends sorting information to the first task module.

[0348] The sorting information indicates the new sorting method specified by the user's update sorting operation. The first task module can receive the sorting information through the first directory task.

[0349] In step S933, the first task module sends sorting information to the second task module through the first directory task.

[0350] The second task module can receive sorting information through the second directory task.

[0351] After receiving the sorting information, the second directory task can proceed to step S907 again to redetermine the information on page 1 according to the sorting information. Furthermore, after the second directory task determines the information on page 1, the first electronic device and the second electronic device can continue with steps S908 to S911, so that the first application can display the information on page 1 determined according to the new sorting method to the user.

[0352] When the first electronic device displays the information on page i through the application interface of the first application, the user can also adjust the target path.

[0353] When the first application detects a user's path adjustment operation, it can send a path instruction to the first task module, the path instruction including the new target path indicated by the path adjustment operation. The first task module can receive the path instruction through the first directory task. The first task module can send the path instruction to the second directory task through the first directory task. The second task module can receive the path instruction through the second directory task. The second directory task can then proceed to steps S907 to S911 based on the new target path in the path instruction. Consequently, the first electronic device can display file information of files under the new target path indicated by the user's path adjustment operation.

[0354] pass Figure 9 The method described involves the first application, upon receiving a successful connection message, actively calling the interface to query the file directory of the second electronic device, initiating a request for the file directory. The first electronic device sends a second directory request to the second electronic device. This second directory request can also be called a directory request frame. Upon receiving the second directory request, the second electronic device retrieves the file information under the target path indicated by the second directory request, sorts it according to the sorting method indicated by the second directory request, and returns file information as needed based on the display quantity threshold indicated by the second directory request. When the user scrolls down the list, the first electronic device requests file information for the next page, sending page number information. This page number information can also be called a directory continuation frame. Upon receiving the page number information, the second electronic device sends the file information corresponding to the page number to the first electronic device. If the user changes the sorting method, the first electronic device informs the second electronic device of the new sorting method, and the second electronic device re-sorts and returns the homepage file list as needed.

[0355] File information for files at the target path on the second electronic device can be transmitted to the first electronic device according to the currently displayed page number, enabling on-demand return of file information. By transmitting file information according to page number, after the user sets the target path or the sorting method, the second electronic device does not need to send all file information for the target path to the first electronic device at once. This reduces the amount of data to be sent, shortens the transmission time, and allows the first electronic device to display the received file information more quickly, reducing the latency between the first electronic device's display and user operation, thus improving the user experience.

[0356] exist Figure 9 In the method shown, steps S907 and S924 involve determining the file information of a certain page; for details, please refer to [link to relevant documentation]. Figure 10 Explanation.

[0357] Figure 10 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application. The second directory task in the second electronic device can be performed. Figure 10 The data processing method shown.

[0358] Step S1001: Obtain file information for n candidate files under the target path.

[0359] Step S1002: Sort the candidate files according to the target sorting method.

[0360] The target sorting method refers to the sorting method in the transmission parameters corresponding to the characters in the second directory. The target sorting method can be based on any one of the following in the file information: filename, file size, or file update time, in ascending or descending order. Ascending order can be in ascending order, and descending order can be in descending order.

[0361] Step S1003: Determine whether n-(i-1)×m is less than or equal to m.

[0362] When performing step S907, i is 1. When performing step S924, i is the page number indicated by the user's page number adjustment operation.

[0363] If n-(i-1)×m≤m, proceed to step S1004. If n-(i-1)×m>m, proceed to step S1005.

[0364] Step S1004: Determine that the information on page i includes the file information after the i×mth digit in the sorting results.

[0365] Step S1005: Determine that the information on page i includes the information of the first m files after the i×mth in the sorting results.

[0366] When the first application displays the file information of the target file at the target path, the user can select the target file and download it.

[0367] In other words, the first electronic device can display a maximum of m file information. When the number of files n in the target path is greater than m, the second electronic device will package the file information of the files in the target path into pages, with each page containing m file information, and transmit the file information to the first electronic device page by page.

[0368] When the first electronic device displays file information of files stored in the second electronic device, the user can determine the file they need to download based on that information. Figure 11 The method shown allows files in the second electronic device to be downloaded to the first electronic device.

[0369] Figure 11This is a schematic flowchart of a communication method provided in an embodiment of this application.

[0370] Step S1101: The first application obtains the user's download operation.

[0371] In step S1102, the first application sends a download request to the first task management module.

[0372] The download request includes download information. This download information includes the filename of the file the user indicates to download and the download path of that file on the second electronic device. The user's download operation can be performed while the second application interface is displayed on the first electronic device. The second application interface may include file information of the file located at the target path on the second electronic device. The download path of the file indicated by the download operation is the target path.

[0373] Step S1103: The first task management module creates the first download task in the first task module.

[0374] The first download task is used to download the file specified in the download path of the second electronic device. During the creation of the first download task, the first task management module can transmit download information to the first download task.

[0375] In step S1104, the first task module sends a download request to the first connection management module through the first download task.

[0376] The download request includes download information.

[0377] In step S1105, the first connection management module sends a download request to the second connection management module.

[0378] Step S1106: The second connection management module sends a download request to the second task management module.

[0379] Step S1107: The second task management module creates a second download task in the second task module.

[0380] During the creation of the second download task, the second task management module can transmit download information to the second download task.

[0381] In step S1108, the second task module sends transmission unit information to the first task management module through the second download task.

[0382] After step S1107, the second task module can read the file represented by the download information from the second disk and determine the transmission unit information.

[0383] The transmission unit information may include the filename, file identifier, and file size of the file specified by the user's download operation. The second task module can assign a number to the file specified by the download operation through the second download task; the file number can serve as a file identifier. The second electronic device can encapsulate the transmission unit information into a frame and send it to the first electronic device.

[0384] The number of files indicated by the user's download operation can be one or more. The transfer unit information may include the filename, file identifier, and file size of each file indicated by the download operation.

[0385] The transmission unit information can be forwarded through the second connection management module and the first connection management module. Alternatively, the transmission information unit can be sent from the first connection management module to the first task management module, and then from the first task management module to the first task module.

[0386] The first task module can receive transmission unit information through the first download task.

[0387] After step S1108, the second electronic device can divide the file indicated by the download operation into blocks according to the file block size indicated by the transmission unit information through the second download task. The file block size transmitted through the communication connection between the first and second electronic devices can be preset. Based on the preset file block size, the number of file blocks into which the file to be transmitted is divided can be determined.

[0388] In step S1109, the first task module sends a transmission unit confirmation message to the second task module through the first download task.

[0389] The transmission unit confirmation information may include the file identifier from the transmission unit information.

[0390] The second task module can receive confirmation information from the transmission unit through the second download task.

[0391] In step S1109, the sending electronic device confirms that the receiving electronic device has received the transmission unit information. After step S1109, the second electronic device, i.e., the sending electronic device, can send the file indicated by the download operation to the first electronic device in blocks through the second download task.

[0392] In step S1111, the second task module sends the i-th file block to the first task module through the second download task.

[0393] After step S1109, when step S1111 is performed for the first time, i = 1.

[0394] The information sent by the second download task to the first task module, including the information about the i-th file block, may also include the file block identifier of the i-th file block. The file block identifier of the i-th file block may include the file identifier of the file to which it belongs, and the file block number of the i-th file block within the file to which it belongs.

[0395] The information sent by the second download task to the first task module, including the information of the i-th file block, may also include the verification information of the i-th file block.

[0396] After the second download task sends the i-th file block to the first task module, the second download task can set i = i + 1 and perform step S1111 again until all file blocks of the file for which the download operation instruction is sent to the second download task are completed.

[0397] The first task module can receive information including the i-th file block through the first download task.

[0398] In step S1112, the first task module sends file block confirmation information to the second task module through the first download task.

[0399] File block confirmation information may include the file block identifier of the received file block.

[0400] The second task module can receive file block confirmation information through the second download task.

[0401] In some embodiments, the first download task may send a file block acknowledgment message for each i-th file block to the second download task after receiving the file block acknowledgment message for the i-th file block. The second download task may, after receiving the file block acknowledgment message for the i-th file block, set i = i + 1 and perform step S1111 again. If the second download task does not receive the file block acknowledgment message for the i-th file block, the second download task may send the i-th file block to the first download task again.

[0402] The first download task can verify the i-th file block based on the verification information of the i-th file block in the information where the i-th file block is located. If the verification passes, the first download task can send the file block confirmation information of the i-th file block to the second download task.

[0403] In other embodiments, file block acknowledgment information may be sent periodically. Each sent file block acknowledgment information may include the file block identifier of the file blocks received within the time period between the current time and the time of the last sent file block acknowledgment information. The file block identifier in the file block acknowledgment information may be the file block identifier of the file blocks that have passed verification.

[0404] The first download task, after receiving confirmation information for each file block, determines the retransmission file block identifier for the file blocks that need to be retransmitted, based on the sent file block identifier of the already sent file blocks and the confirmation file block identifier carried in all received file block confirmation information. The retransmission file block identifier belongs to the sent file block identifier of the already sent file blocks, but is not part of the confirmation file block identifier carried in all file block confirmation information.

[0405] After step S1112, the first task module can proceed to step S1113, and the second task module can proceed to step S1114.

[0406] In step S1113, the first task module sends transmission progress information to the first application through the first download task.

[0407] In step S1114, the second task module sends transmission progress information to the second application through the second download task.

[0408] The transmission progress information may include the number of file blocks that the first download task has acknowledged receiving. The number of file blocks that the first download task has acknowledged receiving may be the number of file block identifiers in all the reception completion messages sent by the first download task.

[0409] In step S1113, the first electronic device can display the transmission progress. In step S1114, the second electronic device can display the transmission progress.

[0410] Each data frame carrying a file block should include checksum information generated based on the current file block. Upon receiving the data frame, the receiving end can verify the file blocks based on the checksum information and record the verification information. This recorded checksum information can be used to determine the file blocks to be transmitted after a transmission interruption and resumption; see [link to relevant documentation] for details. Figure 13 Explanation.

[0411] When the first task management module creates a first download task in the first task module, the first download task is assigned a first task identifier. The download request sent by the first download task and transmitted through the first connection management module and the second connection management module may carry the first download task identifier. When the second task management module creates a second download task in the second task module, the second download task is assigned a task identifier. The transmission unit information sent by the second download task may carry the second download task identifier.

[0412] The first task management module can record the correspondence between the first download task identifier and the second download task identifier. When the transmission unit information is transmitted to the first task management module, the first task management module can record the correspondence between the first download task identifier and the second download task identifier.

[0413] During the communication between the first download task in the first task module and the second download task in the second task module, the first download task identifier and / or the second download task identifier can be carried.

[0414] If the first download task receives all file blocks of the file for the download operation instruction, step S1115 can be performed.

[0415] In step S1115, the first task module sends a reception completion message to the second task module through the first download task.

[0416] The second task module can receive the completion information through the second download task and proceed to steps S1116 and S1117.

[0417] In step S1116, the second task module can send a completion message to the second task management module through the second download task.

[0418] In step S1117, the second task module can send task completion information to the first task management module through the second download task.

[0419] Step S1118: The second task management module releases the second download task.

[0420] The release of the second download task by the second task management module can be understood as the second task management module sending a release message to the second task module. After the second download task sends a task completion message, the second task module can release the second download task.

[0421] If the first task management module receives the task completion information, step S1119 can be performed.

[0422] Step S1119: The first task management module releases the first download task.

[0423] The receiving end determines whether file reception is complete based on the total number of file blocks into which the user's download instruction was divided and the number of file blocks already received. If file reception is complete, the receiving end sends a reception completion frame to the sending end. The reception completion frame carries reception completion confirmation information. Upon receiving the reception completion frame, both ends close the download task, and the transmission is complete.

[0424] pass Figure 11 The method shown allows a first electronic device to download files from a second electronic device upon receiving a download command from a user. The user's command can also instruct the upload of files, allowing files from the first electronic device to be uploaded to the second electronic device. Figure 12 The method shown illustrates the process of uploading a file from a first electronic device to a second electronic device.

[0425] Figure 12 This is a schematic flowchart of a communication method provided in an embodiment of this application.

[0426] Step S1201: The first application obtains the user's upload operation.

[0427] If the upload operation of the first application is obtained, the first application can proceed to step S1202.

[0428] In step S1202, the first application sends an upload request to the first task management module.

[0429] The upload request may include upload information. The upload information may include the file path and filename of the file indicated by the upload operation, as well as the save path on the second electronic device. The upload operation may be performed while the first electronic device displays the second application interface. The second application interface may include file information of the file located at the target path on the second electronic device. The save path of the file indicated by the upload operation is the target path.

[0430] Step S1203: The first task management module creates the first upload task in the first task module.

[0431] The first task management module can create a first upload task in response to an upload request. The first upload task is used to transfer the file specified by the user's upload operation to the storage path of the second electronic device.

[0432] During the creation of the first upload task, the first task management module can transmit upload information to the first upload task.

[0433] In step S1204, the first task module sends transmission unit information to the first connection management module through the first upload task.

[0434] After step S1203, the first upload task can read the file represented by the combination of file path and filename in the upload information from the first disk. The file represented by the combination of file path and filename in the upload information, i.e., the file indicated by the user's upload operation, can be understood as the file to be uploaded. After step S1203, the first upload task can also determine the transmission unit information.

[0435] The transmission unit information includes the filename, file identifier, and file size of the file to be uploaded, as shown in the upload information. The first upload task can read the file identifier and file size from the file system. The file identifier can be a file number representing a combination of the file path and filename from the upload information, as provided by the first upload task.

[0436] The transmission unit information also includes the save path in the received uploaded information.

[0437] In step S1205, the first connection management module sends transmission unit information to the second connection management module.

[0438] Step S1206: The second connection management module sends transmission unit information to the second task management module.

[0439] Step S1207: The second task management module creates a second upload task in the second task module.

[0440] The second upload task is used to store the file received from the first upload task to the save path of the second electronic device. During the creation of the second upload task, the second task management module can transmit transmission unit information to the second upload task. For example, during the creation of the second upload task, the second task management module can transmit transmission unit information to the second task module. After the second upload task is created, the second upload task can obtain the transmission unit information from the second task management module.

[0441] In step S1208, the second task module sends transmission unit confirmation information to the first task management module through the second upload task.

[0442] The first task module can receive confirmation information from the transmission unit through the second upload task.

[0443] After step S1208, the first electronic device can send the file indicated by the upload operation to the second electronic device in blocks via the first upload task. For example, after step S1204, such as after step S1208, the first upload task can divide the target file into multiple file blocks. Figure 11 Steps S1111 to S1119 in the method shown are similar. After step S1208, the communication system can perform steps S1211 to S1219.

[0444] Step S1211: The first task module sends the i-th file block to the first task module through the second upload task.

[0445] After step S1208, when step S1211 is performed for the first time, i = 1. After the first upload task sends the i-th file block to the first task module, the first upload task can set i = i + 1 and perform step S1111 again until all file blocks of the file to be uploaded are sent to the first upload task.

[0446] In step S1212, the second task module periodically sends file block confirmation information to the first task module through the second upload task.

[0447] The file block confirmation information includes the file block identifier of the file block that the second upload task has confirmed as received.

[0448] After step S1212, the first task module can proceed to step S1213, and the second task module can proceed to step S1214.

[0449] In step S1213, the first task module sends transmission progress information to the first application through the first upload task.

[0450] In step S1214, the second task module sends transmission progress information to the second application through the second upload task.

[0451] The transmission progress information can represent the number of file block identifiers in the confirmation information of all file blocks sent by the second upload task.

[0452] After step S1207, the second upload task can determine the number of file blocks of the file to be uploaded based on the file size in the transmission unit information. If the number of received file blocks reaches the number of file blocks of the file to be uploaded, the second upload task determines that all file blocks of the file to be uploaded have been received. If the second upload task has received all file blocks of the file to be uploaded, step S1115 can be performed.

[0453] In step S1215, the second task module sends a receiving completion message to the first task module through the second upload task.

[0454] In step S1216, the first task module can send a receiving completion message to the first task management module through the first upload task.

[0455] In step S1217, the first task module can send task completion information to the second task management module through the first upload task.

[0456] Step S1218: The first task management module releases the first upload task.

[0457] Step S1219: The second task management module releases the second upload task.

[0458] File transfer between the first electronic device and the second electronic device can be either uploading or downloading files. During file upload, the first electronic device sends one or more files to the remote second electronic device. During file download, the first electronic device downloads one or more files from the remote second electronic device to its local storage. In terms of roles, during upload, the first electronic device is the sender and the second electronic device is the receiver; during download, the first electronic device is the receiver and the second electronic device is the sender.

[0459] In practice, downloading a file requires the first electronic device to initiate a file download request and send the file path to a remote second electronic device. Afterward, the file transfer process is largely the same as the upload process, involving negotiation of transmission unit information, file content transmission, and confirmation of receipt.

[0460] During the process of a first electronic device downloading a file from a second electronic device, or vice versa, file transfer may be interrupted. After an interruption, the file transfer may resume. This process of resuming file transfer after an interruption is called resuming interrupted transfer.

[0461] There are two triggering methods for resuming interrupted file transfers. The first method involves reconnecting after an abnormal disconnection, restoring the communication connection. Transfer is paused when the connection is abnormally broken and automatically resumes once the channel is successfully reconnected. The second method allows user control over the interruption and resumption of file transfers. For example, users can pause file transfers on the interface displaying the transfer progress. Users can also resume file transfers on the same interface.

[0462] In the event of a file transfer interruption, both the sending and receiving ends can record the identifiers of the completed file blocks. Upon resuming transfer, the file transfer can be resumed based on these identifiers. For example, while the file transfer continues, the first electronic device and the second electronic device can... Figure 13 The method shown.

[0463] Figure 13 This is a schematic flowchart of a communication method implemented in an embodiment of this application. Figure 13 The method illustrated involves a sender and a receiver. The sender can be a first electronic device or a second electronic device. The receiver can be an electronic device that is different from the sender, either the first or the second electronic device. The sender includes a sender task management module, a sender task module, and a sender connection management module. The receiver includes a receiver task management module, a receiver task module, and a receiver connection management module.

[0464] Step S1311: The sending end task module receives the instruction to resume transmission.

[0465] When a user actively resumes data transmission at the sending end, upon receiving the user's transmission resumption operation from the sending end application interface, the sending end application can send a resumption instruction to the sending end task management module. The sending end task management module can then send a resumption instruction to the sending end task module.

[0466] If a user actively pauses data transmission, the user can actively resume data transmission. For example, if the sending application detects that a user has paused a transmission task on the sending application interface, the sending application can send a pause instruction to the sending task module.

[0467] The sending task module can send a pause transmission indication to the receiving task module. Based on the received pause transmission indication, the sending task module can store the transmission progress of a specific transmission task and release the corresponding sending-end transmission task at the sending end. The receiving task module can also store the transmission progress of a specific transmission task and release the corresponding receiving-end transmission task at the receiving end based on the received pause transmission indication. The pause transmission indication may include the task identifier of the sending-end transmission task and / or the task identifier of the receiving-end transmission task. After receiving a resume transmission indication, the sending task module can resume the sending-end transmission task indicated by the resume transmission indication. After resuming the sending-end transmission task, the sending task module can proceed to step S1312.

[0468] If a user initiates a transmission resumption operation at the receiving end, the receiving end application, upon detecting this operation, can send a resumption instruction to the sending end's task management module. This resumption instruction can be forwarded by the receiving end's task management module. It should be understood that pausing transmission can also be an operation performed by the user at the receiving end.

[0469] In the event of a communication connection failure leading to transmission interruption, the sending end transmission task in the sending end task module is not released. Therefore, after receiving the transmission recovery instruction, the sending end task module can proceed to step S1312.

[0470] In step S1312, the sending task module transmits the task through the sending end and performs modification detection to determine the identifier of the first modified file block.

[0471] The first modified file block identifier represents the file block identifier of the modified file block within the file blocks already sent by the sender. The file blocks already sent by the sender can be those sent from the sender's transmission task to the receiver's transmission task before the transmission interruption. The file block represented by the first modified file block identifier can be a file block that was modified at the sender after the transmission interruption.

[0472] File block identifiers can be represented by a file number and a block number. In the first modified file block identifier, the file number indicates the file number within the sending end's transmission task to which the file block corresponding to the first modified file block identifier belongs. In the first modified file block identifier, the block number indicates the file number within its respective file.

[0473] In step S1313, the sending task module sends a transmission recovery request to the receiving task management module through the sending task.

[0474] The transmission recovery request includes a first modified file block identifier. The transmission recovery request may also include file block status information. The file block status information indicates that the file block corresponding to the first modified file block identifier in the transmission recovery request was modified at the sending end.

[0475] The transmission recovery request may also include the task identifier of the sending end's transmission task and / or the task identifier of the receiving end's transmission task.

[0476] Step S1314: The receiving end task management module sends a transmission recovery request to the receiving end task module.

[0477] If the transmission interruption is caused by user operation, the receiving end transmission task in the receiving end task module has been released. After receiving a transmission recovery request, the receiving end task module can resume the receiving end transmission task indicated by the transmission recovery request. After resuming the receiving end transmission task, the receiving end task module can proceed to step S1315.

[0478] In the event of a communication connection failure leading to transmission interruption, the receiving end transmission task in the receiving end task module is not released. Therefore, after receiving a transmission recovery request, the receiving end task module can proceed to step S1315.

[0479] In step S1315, the receiving end task module performs modification detection through the receiving end transmission task to determine the second modified file block identifier.

[0480] The second modified file block identifier represents the file block identifier of the modified file block among the file blocks already received by the receiving end. The file block already sent by the receiving end can be a file block received from the sending end's transmission task by the receiving end's transmission task before the transmission was interrupted. The file block represented by the first modified file block identifier can be a file block that was modified at the sending end after the transmission was interrupted, or a file block that was modified after being received by the receiving end's transmission task.

[0481] In step S1316, the receiving task module sends a transmission recovery response to the sending task module through the receiving end transmission task.

[0482] The transmission recovery response includes a second modified file block identifier. The transmission recovery response may also include a task identifier for the sending transmission task and / or a task identifier for the receiving transmission task.

[0483] The sending task module can receive a transmission recovery response through the sending transmission task. After receiving the transmission recovery response, the sending transmission task can determine the file block to be sent based on the second modified file block identifier. Determining the file block to be sent based on the second modified file block identifier can also be understood as updating the file block to be sent. The file block to be sent includes the file block represented by the first modified file block identifier, the file block represented by the second modified file block identifier, and the file block that had not been transmitted before the transmission interruption.

[0484] After determining the file block to be sent, the sending task module can proceed to step S1321.

[0485] Step S1321: The sending task module sends the file block to be sent to the receiving task module through the sending transmission task.

[0486] The receiving task module can transmit task receiving file blocks through the receiving end.

[0487] For details on the transmission process of file blocks in a communication system, please refer to [link / reference needed]. Figure 11 For a description of steps S1111 to S1114, or see the following: Figure 12 Explanation of steps S1211 to S1214.

[0488] After the receiving end transmits the last file block, step S1322 can be performed.

[0489] In step S1322, the receiving task module sends a reception completion confirmation message to the sending task module through the receiving task.

[0490] Afterwards, the sending end can release its transmission task, and the receiving end can release its transmission task. The process of releasing the transmission task can be found in [link to documentation]. Figure 11 For a description of steps S1116 to S1119, or see the following: Figure 12 Explanation of steps S1216 to S1219.

[0491] pass Figure 13The method described above involves the sending end first verifying the transmitted file blocks to check if they were modified during the transmission pause. After verification, the sender sends the identifier of the modified file blocks back to the sending end. The receiving end can also verify the transmitted file blocks to identify any modified ones. Upon receiving the file block identifier of the modified file blocks from the receiving end, the sending end can update the file transmission status. For example, if a file block in a completed transmission file has been modified, the file status is corrected to "transmitting". If the file is already stored on a disk or other storage unit, it can be deleted from that disk or storage unit. The sending end updates the transmission list, which includes the modified file blocks in the sending end, the file blocks corresponding to the file block identifiers of the modified file blocks in the receiving end, and the untransmitted file blocks. Thus, the sending end sends the file blocks that need to be retransmitted and the untransmitted file blocks to the receiving end.

[0492] During steps S1312 and S1315, a modification check is required. The modification check process can be found in [link to documentation]. Figure 14 Explanation.

[0493] Figure 14 This is a schematic flowchart of a data processing method provided in an embodiment of this application.

[0494] Step S1401: Read the modification time of the file from the file system.

[0495] Step S1402: Determine whether the file modification time is later than the time of the transmission interruption.

[0496] If the file modification time is not later than the time of the transmission interruption, step S1403 can be performed.

[0497] Step S1403: Determine that the file blocks in the file have not been modified.

[0498] If the file modification time is later than the transmission interruption time, step S1404 can be performed.

[0499] Step S1404: Verify the file blocks according to the verification information of each file block in the file.

[0500] If the verification passes, proceed to step S1405.

[0501] Step S1405: Determine that the file block has not been modified.

[0502] If the verification fails, proceed to step S1406.

[0503] Step S1406: Determine that the file block has been modified.

[0504] pass Figure 14 The method shown assumes that file blocks in a file whose update time is earlier than the transmission interruption time have not been modified. For files whose update time is later than the transmission interruption time, the method can determine whether a file block has been modified based on the checksum information corresponding to each file block.

[0505] The file block is verified based on the verification information, which can be calculated from the file block's information. If the new verification information matches the original verification information, the verification passes, confirming that the file block has not been modified. Conversely, if the new verification information does not match the original verification information, the verification fails, confirming that the file block has been modified. For modified file blocks, retransmission is possible.

[0506] For the receiving end of the file, in step S1402, the file's update time can also be compared with the file's save time. If the file was received before the transmission was interrupted, the file's save time can be the time when the file was received. If the file was not received before the transmission was interrupted, and the received file blocks include a portion of the file's blocks, the file's save time can be the time of the transmission interruption. If the file's update time is not later than the save time, it is determined that the file has not been modified, that is, none of the file blocks in the file have been modified. If the file's update time is later than the save time, step S1404 can be performed, whereby for each file block in the file, the file block is verified according to the file block's verification information to determine the modified file blocks in the file.

[0507] It should be understood that the above examples are provided to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of this application to the specific values ​​or scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of this application.

[0508] The above text combined Figures 1 to 14 The present application describes in detail the state of charge display method according to its embodiments. The following will be combined with... Figure 15 This document describes in detail the device embodiments of this application. It should be understood that the device in the embodiments of this application can execute the various methods described in the foregoing embodiments of this application. That is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.

[0509] Figure 15 A hardware system for an electronic device applicable to this application is shown.

[0510] The method provided in this application can be applied to various electronic devices capable of image acquisition, such as mobile phones, tablets, wearable devices, laptops, netbooks, personal digital assistants (PDAs), and in-vehicle devices. This application does not impose any restrictions on the specific type of electronic device.

[0511] Figure 15 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 150, a power management module 151, a battery 142, 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, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0512] It is understood that the structures illustrated in the embodiments of this application 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.

[0513] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0514] The controller can serve as the nerve center and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control the reading and execution of instructions.

[0515] 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. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0516] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0517] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0518] The wireless communication function of electronic device 100 can be realized through devices such as antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0519] 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.

[0520] Touch sensor 180K, also known as a touch device, can be disposed on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a touch display. Touch sensor 180K is used to detect touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be disposed on the surface of device 100, and in a different location from display screen 194.

[0521] This application provides a communication device, including various functional units for executing the communication method provided in this application. The term "unit" here can be implemented in software and / or hardware, and is not specifically limited thereto.

[0522] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.

[0523] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0524] This application also provides a chip, which includes a data interface and one or more processors. When the one or more processors execute instructions, they read instructions stored in a memory through the data interface to implement the state of charge display method described in the above method embodiments.

[0525] The one or more processors can be general-purpose processors or special-purpose processors. For example, the one or more processors can be central processing units (CPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, such as discrete gate, transistor logic devices, or discrete hardware components.

[0526] The chip can be used as a component of a terminal device or other electronic device. For example, the chip can be located in electronic device 100.

[0527] Processors and memory can be configured separately or integrated together. For example, processors and memory can be integrated onto a system-on-a-chip (SoC) in a terminal device. That is, the chip can also include memory.

[0528] The memory can store a program, which can be run by the processor to generate instructions, causing the processor to execute the communication method described in the above method embodiments according to the instructions.

[0529] Optionally, the memory may also store data. Optionally, the processor may also read data stored in the memory, which may be stored at the same memory address as the program, or the data may be stored at a different memory address than the program.

[0530] This chip can be installed in an electronic device. For example, a memory can be used to store programs related to the communication methods provided in the embodiments of this application, and a processor can be used to call programs related to the graphics processing methods stored in the memory to implement the communication methods of the embodiments of this application.

[0531] For example, in the case of receiving a connection operation, the first service module sends a first connection request to the server, so that the server sends a second connection request to the second electronic device. The second connection request is used to request the second electronic device to control the second service module to be in running state; a communication connection is established between the first service module and the second service module of the second electronic device; after the communication connection is successfully established, after receiving a file transfer operation, file transfer is performed with the second electronic device through the communication connection.

[0532] For example, in response to a second connection request sent by the receiving server, the second service module is controlled to be in a running state. The second connection request is sent by the server in response to receiving a first connection request sent by the first electronic device. The first connection request is sent by the first service module in the first electronic device in response to the first electronic device detecting a connection operation. A communication connection is established between the second service module and the first service module of the first electronic device. File transfer is performed with the first electronic device through the communication connection.

[0533] This application also provides a communication system, including a first electronic device, a second electronic device, and a server.

[0534] This application also provides a computer program product that, when executed by a processor, implements the state of charge display method described in any of the method embodiments of this application.

[0535] The computer program product can be stored in memory, for example, it is a program. The program is eventually converted into an executable object file that can be executed by the processor after processes such as preprocessing, compilation, assembly and linking.

[0536] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the state of charge display method described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0537] The computer-readable storage medium is, for example, memory. Memory can be volatile or non-volatile, or it can include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0538] In the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance, or a specific order or sequence. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0539] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0540] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0541] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0542] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0543] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0544] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0545] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A communication method, characterized in that, Applied to a first electronic device, the first electronic device including a first service module, the method includes: Upon receiving a connection operation, the first service module sends a first connection request to the server, so that the server sends a second connection request to the second electronic device. The second connection request is used to request the second electronic device to control the second service module to be in a running state. Establish a communication connection between the first service module and the second service module of the second electronic device; After the communication connection is successfully established, and after receiving the file transfer operation, file transfer is performed with the second electronic device through the communication connection.

2. The method according to claim 1, characterized in that, The method further includes: Through the communication connection, a first file list request is sent to the second electronic device, the first file list request including a display quantity threshold and the target path of the second electronic device; The device receives first file list information sent by the second electronic device in response to the first file list request. The first file list information includes file information of at least one first target file. If the number of at least one candidate file stored under the target path is greater than or equal to the display quantity threshold, the number of the at least one first target file is equal to the display quantity threshold. The second application interface is displayed, which includes the first file list information.

3. The method according to claim 2, characterized in that, The number of at least one candidate file stored under the target path is greater than the display quantity threshold, and the at least one first target file is the file corresponding to the first page number information; The method further includes: After receiving a page jump operation in the second application interface, a second file list request is sent to the second electronic device through the communication connection. The second file list request includes the second page number information indicated by the page jump operation. Through the communication connection, the second electronic device receives second file list information sent in response to the second file list request. The second file list information includes file information of at least one second target file corresponding to the second page number information. The number of the at least one second target file is less than or equal to the display quantity threshold. The second file list information is displayed in the second application interface.

4. The method according to claim 2 or 3, characterized in that, The method further includes: When the sorting method adjustment operation is received in the second application interface, a third file list request is sent to the second electronic device through the communication connection. The third file list request includes the target sorting method indicated by the sorting method adjustment operation. Through the communication connection, the third file list information sent by the second electronic device in response to the third file list request is received. The third file list information includes file information of at least one third target file, which is the first candidate file in the sorting result of the at least one candidate file according to the target sorting method.

5. The method according to any one of claims 2-4, characterized in that, The file transfer operation is an upload operation. After receiving the file transfer operation, the step of transferring the file with the second electronic device through the communication connection includes: After receiving the upload operation in the second application interface, the first file in the first electronic device that was indicated by the upload operation is transmitted to the second electronic device through the communication connection, so that the first file is stored in the target path.

6. The method according to any one of claims 1-5, characterized in that, The second electronic device transfers files to the first electronic device at the file block level, and the method further includes: If the transmission is interrupted during the reception of file blocks, the transmission will resume and it will be determined whether there are any file blocks that have been modified after the reception. If a modified file block exists, a first transmission request is sent to the second electronic device, the first transmission request carrying the first file block identifier of the modified file block; The device receives file data sent by the second electronic device in response to the first transmission request, the file data including a first target file block, the first target file block being determined based on the first file block identifier.

7. The method according to claim 6, characterized in that, Determining whether any received file blocks have been modified after receipt includes: If a first file exists, each file block is verified according to the verification information corresponding to each file block of the first file. The update time of the first file is later than the time of the transmission interruption. The first file includes at least one of the received file blocks. The verification information corresponding to each file block is the information sent by the second electronic device received through the communication connection before the transmission interruption. Based on the verification results, determine whether any of the received file blocks have been modified after receipt.

8. The method according to claim 6 or 7, characterized in that, The file data also includes a second target file block that has been modified by the second electronic device, indicated by a second file block identifier, wherein the original file block indicated by the second file block identifier is included in the received file block.

9. The method according to any one of claims 1-8, characterized in that, The method further includes: Displays the first application interface of the first application; After receiving the connection operation, sending a first connection request to the server through the first service module includes: After receiving the connection operation in the first application interface, the first connection request is sent to the server through the first service module. The first connection request and the second connection request include the application identifier of the second application in the second electronic device. The second application is used to display the progress of the file transfer.

10. A communication method, characterized in that, Applied to a second electronic device, the method includes: In response to a second connection request sent by a receiving server, the second service module is controlled to be in a running state. The second connection request is sent by the server in response to receiving a first connection request sent by the first electronic device. The first connection request is sent by the first service module in the first electronic device in response to the first electronic device detecting a connection operation. Establish a communication connection between the second service module and the first service module of the first electronic device; File transfer is performed with the first electronic device via the communication connection.

11. A communication system, characterized in that, A first electronic device, a second electronic device, and a server, wherein the first electronic device is used to perform the method of any one of claims 1-9, and the second electronic device is used to perform the method of claim 10.

12. An electronic device, characterized in that, The device includes a processor and a memory, the memory being used to store a computer program, and the processor being used to retrieve and run the computer program from the memory, causing the electronic device to perform the method of any one of claims 1 to 10.

13. A chip, characterized in that, It includes a processor and a data interface, wherein the processor reads instructions stored in memory through the data interface to implement the method as described in any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for implementing the method of any one of claims 1 to 10.

15. A computer program product, characterized in that, When the computer program product is run on an electronic device, the electronic device is used to perform the method of any one of claims 1 to 10.