| CPC H04L 67/06 (2013.01) [H04L 67/141 (2013.01)] | 20 Claims |

|
1. A file sharing method, wherein the method is applied to a first electronic device, and comprises:
displaying a first interface comprising an identifier of a second electronic device;
establishing a communication connection to the second electronic device when receiving a first operation that is on the first interface and that is performed by a user on the identifier of the second electronic device, wherein the second electronic device is configured to receive multiple to-be-shared files sent by the first electronic device;
creating a first thread and a second thread;
calling the first thread to sequentially compress a first-type file in the multiple to-be-shared files to obtain a compressed file; and
calling the second thread to send a second-type file in the multiple to-be-shared files and the obtained compressed file to the second electronic device through a data channel corresponding to the communication connection, wherein the first-type file and the second-type file are obtained by classifying the multiple to-be-shared files according to a preset classification policy, the first-type file is a file that needs to be compressed, and the second-type file is a file to be directly sent to the second electronic device;
wherein execution by the first thread and the second thread is concurrent.
|