File sharing method, device, electronic device and readable storage medium

By establishing a point-to-point file sharing link based on wireless fidelity WIFI between electronic devices and mounting the other party's file directory in the virtual storage area, the problem of inefficient one-way file sharing in the existing technology is solved, efficient two-way file sharing is achieved, and user experience is improved.

CN114567871BActive Publication Date: 2025-02-28NOKIA TECHNOLOGIES OY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011368290.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2025-02-28
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

The existing file sharing technology can only realize one-way file sharing, which is inefficient and affects the user experience.

Method used

Through the near field communication module of the first electronic device, a point-to-point file sharing link based on wireless fidelity WIFI is established with the second electronic device, and in the process of establishing the file sharing link, the other party's file directory is mounted in the preset virtual storage area to realize two-way file sharing.

Benefits of technology

Two-way file sharing is realized, the efficiency of file sharing is improved, the user experience is improved, and the original WIFI communication module is not occupied, and the continuity of the original connection of the device is maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of device communication technology, and provides a method, apparatus, electronic device and readable storage medium for file sharing, the method comprising: a first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with a second electronic device through a near field communication module; in the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; and the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area. The technical solution provided by the present application can solve the problem that the existing file sharing technology can only realize one-way file sharing and the file sharing efficiency is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of device communication technology, and in particular, relates to a file sharing method, device, electronic device and readable storage medium. Background Art

[0002] With the continuous development of electronic device technology, the number of electronic devices owned by users is also increasing. A user can use multiple electronic devices at the same time, and different electronic devices can store files and data generated by user operations. When a user operates on one electronic device, if he needs to operate files stored in other electronic devices, he needs to use file sharing technology between electronic devices.

[0003] Existing file sharing methods often only support one-way file sharing. For example, electronic device A and electronic device B establish a communication link to achieve file sharing. Electronic device A can browse files on electronic device B through the communication link, but electronic device B cannot browse files on electronic device A locally through the communication link, such as a file sharing link established based on a Universal Serial Bus (USB). It can be seen that the existing file sharing method can only achieve one-way file sharing, and the efficiency of file sharing is low, which affects the user experience. Summary of the invention

[0004] The embodiments of the present application provide a file sharing method, device, electronic device and computer-readable storage medium, which can solve the problem that the existing file sharing technology can only realize one-way file sharing and has low file sharing efficiency.

[0005] In a first aspect, an embodiment of the present application provides a method for sharing a file, including:

[0006] The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module;

[0007] In the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; and the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area;

[0008] The second file directory is used by the first electronic device to access files of the second electronic device;

[0009] The first file directory is used for the second electronic device to access files of the first electronic device.

[0010] The implementation of the embodiment of the present application has the following beneficial effects: a file sharing link is established with a second electronic device through a near field communication module of a first electronic device, and in the process of establishing the file sharing link, a second file directory for storing local files of the second electronic device can be created in a first virtual storage area preset by the first electronic device, and correspondingly, a second file directory for storing local files of the first electronic device is created in a second virtual storage area preset by the second electronic device. After the establishment of the above-mentioned file sharing link, the first electronic device can browse the local files of the second electronic device through the second file directory, and similarly, the second electronic device can also browse the local files of the first electronic device through the first file directory, thereby realizing two-way file sharing, thereby improving the efficiency of file sharing. On the other hand, the above-mentioned file sharing link is established between the first electronic device and the second electronic device based on the near field communication module, and the near field communication module has the advantages of fast response and simple access operation, and can also further improve the efficiency of establishing the file sharing link and improve the user experience. Furthermore, a WIFI point-to-point file sharing link is established between the first electronic device and the second electronic device based on the near field communication module, without occupying the WIFI communication module, maintaining the continuity of the original WIFI communication link between the first electronic device and the second electronic device, and avoiding the impact of the file sharing process on the original connection of the device.

[0011] In a possible implementation of the first aspect, the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through a near field communication module, including:

[0012] The first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0013] The second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device;

[0014] The first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number;

[0015] The second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port;

[0016] The first electronic device mounts the second file directory in the first virtual storage area in response to the second mounting instruction;

[0017] The first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0018] In a possible implementation manner of the first aspect, after the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through the near field communication module, the method further includes:

[0019] The second electronic device sends a first acquisition instruction of the first file to the first electronic device in response to a first operation request on the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0020] The first electronic device obtains first file data of the first file based on the first attribute information of the received first obtaining instruction, and sends the first file data to the second electronic device.

[0021] In a possible implementation manner of the first aspect, the first acquisition instruction further includes second status information of a second file directory of the second electronic device; and the first electronic device acquires first file data of the first file based on the first attribute information received in the first acquisition instruction, including:

[0022] The first electronic device extracts the second state information of the first acquisition instruction and updates the second file directory of the first virtual storage area;

[0023] The first electronic device acquires the first file data of the first file based on the first attribute information.

[0024] In a possible implementation manner of the first aspect, after the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through the near field communication module, the method further includes:

[0025] The first electronic device sends a second acquisition instruction of the second file to the second electronic device in response to a second operation request on the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0026] The second electronic device obtains second file data of the second file based on the second attribute information of the received second obtaining instruction, and sends the second file data to the first electronic device.

[0027] In a possible implementation manner of the first aspect, the second acquisition instruction further includes first status information of a first file directory of the first electronic device; and the second electronic device acquires second file data of the second file based on the received second attribute information of the second acquisition instruction, including:

[0028] The second electronic device extracts the first state information of the second acquisition instruction and updates the first file directory of the second virtual storage area;

[0029] The second electronic device acquires the second file data of the second file based on the second attribute information.

[0030] In a possible implementation of the first aspect, the near field communication module of the first electronic device is configured with the communication address of the first electronic device based on the WIFI point-to-point; the process communication module of the second electronic device is configured with the communication address of the second electronic device based on the WIFI point-to-point.

[0031] In a second aspect, an embodiment of the present application provides a file sharing method, applied to a first electronic device, comprising:

[0032] The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module;

[0033] In the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; the second file directory is used by the first electronic device to access files of the second electronic device.

[0034] In a possible implementation of the second aspect, the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through a near field communication module, including:

[0035] The first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0036] The first electronic device receives the port response information sent by the second electronic device; the port response information includes the second communication port number of the second electronic device;

[0037] The first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number;

[0038] The first electronic device receives a second mount instruction fed back by the second electronic device based on the first mount instruction; the second mount instruction includes the first communication port;

[0039] The first electronic device mounts the second file directory in the first virtual storage area in response to the second mounting instruction;

[0040] The first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0041] In a possible implementation manner of the second aspect, after the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through the near field communication module, the method further includes:

[0042] The first electronic device receives a first acquisition instruction sent by the second electronic device; the first acquisition instruction is generated by the second electronic device in response to a first operation request on a first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0043] The first electronic device obtains first file data of the first file based on the first attribute information, and sends the first file data to the second electronic device.

[0044] In a possible implementation manner of the second aspect, after the first electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the second electronic device through the near field communication module, the method further includes:

[0045] The first electronic device sends a second acquisition instruction of the second file to the second electronic device in response to a second operation request on the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0046] The first electronic device receives second file data about the second file fed back by the second electronic device based on the second acquisition instruction.

[0047] In a third aspect, an embodiment of the present application provides a file sharing device, including:

[0048] A first file sharing link establishing unit, used to establish a wireless fidelity WIFI point-to-point file sharing link with a second electronic device through a near field communication module;

[0049] The second file directory mounting unit is used to mount the second file directory of the second electronic device in the preset first virtual storage area during the process of establishing the file sharing link; the second file directory is used by the first electronic device to access the files of the second electronic device.

[0050] In a possible implementation manner of the third aspect, the first file sharing chain establishing unit includes:

[0051] A first communication port number sending unit, configured to send a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0052] A second communication port number receiving unit, configured to receive port response information sent by the second electronic device; the port response information includes a second communication port number of the second electronic device;

[0053] A first mounting instruction sending unit, configured to send a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number;

[0054] A second mount instruction receiving unit, configured to receive a second mount instruction fed back by the second electronic device based on the first mount instruction; the second mount instruction includes the first communication port;

[0055] a second mount instruction response unit, configured to mount the second file directory in the first virtual storage area in response to the second mount instruction;

[0056] The mount completion information sending unit is used to send the mount completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0057] In a possible implementation manner of the third aspect, the file sharing device further includes:

[0058] a first acquisition instruction receiving unit, configured to receive a first acquisition instruction sent by the second electronic device; the first acquisition instruction is generated by the second electronic device in response to a first operation request on a first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0059] A first file data sending unit is configured to obtain first file data of the first file based on the first attribute information, and send the first file data to the second electronic device.

[0060] In a possible implementation manner of the third aspect, the file sharing device further includes:

[0061] A second acquisition instruction sending unit, configured to send a second acquisition instruction of the second file to the second electronic device in response to a second operation request regarding the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0062] The second file data receiving unit is configured to receive second file data about the second file fed back by the second electronic device based on the second acquisition instruction.

[0063] In a fourth aspect, an embodiment of the present application provides a file sharing method, which is applied to a second electronic device, including:

[0064] The second electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the first electronic device through the near field communication module in response to a connection operation initiated by the first electronic device;

[0065] In the process of establishing the file sharing link, the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area; the first file directory is used by the second electronic device to access files of the first electronic device.

[0066] In a possible implementation manner of the fourth aspect, the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through a near field communication module in response to a connection operation initiated by the first electronic device, including:

[0067] The second electronic device receives the port acquisition request sent by the first electronic device through the near field communication module; the port acquisition request includes the first communication port number of the first electronic device;

[0068] The second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device;

[0069] The second electronic device receives a first mounting instruction sent by the first electronic device; the first mounting instruction includes the second communication port number;

[0070] The second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port;

[0071] The second electronic device receives the mounting completion information sent by the first electronic device, and recognizes that the file sharing link between the second electronic device and the first electronic device has been established.

[0072] In a possible implementation manner of the fourth aspect, after the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through the near field communication module in response to a connection operation initiated by the first electronic device, the method further includes:

[0073] The second electronic device sends a first acquisition instruction of the first file to the first electronic device in response to a first operation request on the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0074] The second electronic device receives the first file data about the first file fed back by the first electronic device based on the first acquisition instruction.

[0075] In a possible implementation manner of the fourth aspect, after the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through the near field communication module in response to a connection operation initiated by the first electronic device, the method further includes:

[0076] The second electronic device receives a second acquisition instruction sent by the first electronic device; the second acquisition instruction is generated by the first electronic device in response to a second operation request on a second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0077] The second electronic device obtains second file data of the second file based on the second attribute information, and sends the second file data to the first electronic device.

[0078] In a fifth aspect, an embodiment of the present application provides a file sharing device, including:

[0079] A second file sharing link establishing unit, configured for the second electronic device to establish a wireless fidelity WIFI point-to-point file sharing link with the first electronic device via a near field communication module in response to a connection operation initiated by the first electronic device;

[0080] The first file directory mounting unit is used for mounting the first file directory of the first electronic device in a preset second virtual storage area when the second electronic device is establishing the file sharing link; the first file directory is used by the second electronic device to access files of the first electronic device.

[0081] In a possible implementation manner of the fifth aspect, the second file sharing link establishing unit includes:

[0082] A first communication port number receiving unit, configured to receive a port acquisition request sent by the first electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0083] A second communication port number sending unit, configured to send port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device;

[0084] A first mounting instruction receiving unit, configured to receive a first mounting instruction sent by the first electronic device; the first mounting instruction includes the second communication port number;

[0085] a second mount instruction sending unit, configured to mount the first file directory in the second virtual storage area in response to the first mount instruction, and send a second mount instruction to the first electronic device; the second mount instruction includes the first communication port;

[0086] The mount completion information receiving unit is used to receive the mount completion information sent by the first electronic device, and identify that the file sharing link with the first electronic device has been established.

[0087] In a possible implementation manner of the fifth aspect, the file sharing device further includes:

[0088] A first operation request response unit, configured to send a first acquisition instruction for the first file to the first electronic device in response to a first operation request for the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0089] The first file data receiving unit is configured to receive the first file data about the first file fed back by the first electronic device based on the first acquisition instruction.

[0090] In a possible implementation manner of the fifth aspect, the file sharing device further includes:

[0091] a second acquisition instruction receiving unit, configured to receive a second acquisition instruction sent by the first electronic device; the second acquisition instruction is generated by the first electronic device in response to a second operation request on a second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0092] A second file data sending unit is configured to obtain second file data of the second file based on the second attribute information, and send the second file data to the first electronic device.

[0093] In a sixth aspect, an embodiment of the present application provides an electronic device, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the file sharing method described in any one of the second aspect or the file sharing method described in any one of the fourth aspect is implemented.

[0094] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and is characterized in that when the computer program is executed by a processor, it implements the file sharing method described in any one of the second aspect or the file sharing method described in any one of the fourth aspect.

[0095] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the file sharing method described in any one of the second aspect or the file sharing method described in any one of the fourth aspect.

[0096] In the ninth aspect, an embodiment of the present application provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the file sharing method as described in any one of the second aspects or the file sharing method as described in any one of the fourth aspects.

[0097] In a tenth aspect, an embodiment of the present application provides a file sharing system, comprising the file sharing device of the second aspect and the file sharing device of the fourth aspect.

[0098] It can be understood that the beneficial effects of the second to tenth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0100] Figure 2 is a software structure block diagram of the electronic device of the embodiment of the present application;

[0101] Figure 3 It is a schematic diagram of realizing file sharing between devices based on serial interface;

[0102] Figure 4 is a schematic diagram of realizing file sharing between electronic devices based on the service information block protocol;

[0103] Figure 5 This is a schematic diagram of realizing file transfer between devices based on WIFI point-to-point direct connection;

[0104] Figure 6 is a schematic diagram of connection between a first electronic device and a second electronic device provided by an embodiment of the present application;

[0105] Figure 7 This is a flowchart of a method for file sharing provided in one embodiment of the present application;

[0106] Figure 8 is a schematic diagram of connection triggering between a first electronic device and a second electronic device provided by an embodiment of the present application;

[0107] Fig. 9 It is a schematic diagram of storage areas of a first electronic device and a second electronic device provided by an embodiment of the present application;

[0108] Fig.10 is a schematic diagram of an operation interface of a first electronic device provided by an embodiment of the present application;

[0109] Fig.11 It is a schematic diagram of a mounting structure of a first electronic device and a second electronic device provided in an embodiment of the present application;

[0110] Fig.12 is a specific interaction flow chart of S701 in a method for file sharing provided in another embodiment of the present application;

[0111] Fig.13 This is a schematic diagram of the format of a request data packet provided in an embodiment of the present application;

[0112] Fig.14 This is a schematic diagram of the format of a response data packet provided in an embodiment of the present application;

[0113] Fig.15 is a flowchart of a method for file sharing on a first electronic device side provided in an embodiment of the present application;

[0114] Fig.16 is a flowchart of a method for sharing files on a second electronic device provided by an embodiment of the present application;

[0115] Fig.17 It is a structural block diagram of a file sharing device provided in an embodiment of the present application;

[0116] Fig.18 It is a structural block diagram of a file sharing device provided in an embodiment of the present application;

[0117] Fig.19 It is a structural block diagram of a file sharing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0118] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0119] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0120] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0121] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0122] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0123] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0124] The file sharing method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0125] For example, the electronic device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.

[0126] Figure 1 A schematic structural diagram of an electronic device 100 is shown.

[0127] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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.

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

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

[0130] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

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

[0133] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0134] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0135] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0136] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0137] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0138] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0139] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

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

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

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

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

[0144] 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 a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0145] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0146] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0147] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module, and in particular, the wireless communication module 160 at least includes a near field communication NFC module to establish a file sharing link through the NFC module.

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

[0149] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. The display screen 194 may include a touch panel and other input devices.

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

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

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

[0153] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0154] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

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

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

[0157] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

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

[0159] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0160] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0161] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0162] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

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

[0164] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0165] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0166] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0167] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0168] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0169] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0170] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0171] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0172] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0173] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0174] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass 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 the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0175] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0176] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0177] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0178] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0179] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0180] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0181] Figure 2 It is a software structure block diagram of the electronic device of the embodiment of the present application.

[0182] The layered architecture divides the software into several layers, each with clear roles and division of labor. The 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, the application framework layer, the Android runtime and system library, and the kernel layer.

[0183] The application layer can include a series of application packages.

[0184] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0185] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0186] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0187] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0188] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0189] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0190] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).

[0191] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0192] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0193] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

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

[0195] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0196] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0197] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0198] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0199] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0200] A 2D graphics engine is a drawing engine for 2D drawings.

[0201] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0202] With the continuous development of electronic device technology, the number and types of electronic devices are increasing. A user can hold multiple electronic devices at the same time, and the number of electronic devices held by some users can even reach dozens or even hundreds. For example, a user can hold multiple smart phones, and different smart phones are configured with different phone numbers. The user can also hold other electronic devices such as tablets, laptops, smart TVs, digital cameras, etc. Different electronic devices can generate different file data during use. For example, image data can be obtained through a built-in camera module, and document files can be generated locally and various types of files can be downloaded from the Internet, such as video files, game installation packages, etc. Electronic devices can store locally generated file data for local storage, and users can perform various operations such as browsing, editing, deleting, and copying files on the electronic devices through the file directory output by the electronic devices.

[0203] Since different electronic devices can store different files, and the same user can hold multiple electronic devices at the same time, if the user needs to obtain files stored locally on another electronic device B when operating on one electronic device A, it is necessary to transfer files between devices. Furthermore, if electronic device A can locally edit, copy, delete, and other operations on files on electronic device B, the communication link between electronic devices A and B needs to support file sharing technology, so that when electronic device A operates on files stored on electronic device B, the files can be updated synchronously on the storage of electronic device B.

[0204] The following is an actual usage scenario to illustrate file transfer and file sharing between devices: a user takes an image through a smartphone, and when the user edits an article through a laptop, he needs to use the previously taken image as the background image. In this case, the image taken above needs to be transferred to the laptop through the smartphone. At this time, file transfer is required, that is, transferring files from the smartphone to the laptop. If a file sharing communication link is established between the smartphone and the laptop, all images taken by the smartphone can be displayed on the laptop, and the user can edit each image stored on the smartphone on the laptop. At this time, file sharing is achieved between the laptop and the smartphone.

[0205] In the prior art, there are three ways to implement file sharing:

[0206] Method 1: See Figure 3 As shown, Figure 3 Figure 1 shows a schematic diagram of implementing file sharing between devices based on a serial interface. Figure 3As shown, the user holds at least two electronic devices, exemplarily, the two electronic devices may be a smartphone and a laptop, and the communication connection established based on the serial interface is specifically a communication connection established based on the USB interface. The smartphone may be configured with a USB Type C interface, and the laptop may be configured with a USB 2.0 interface. The smartphone and the laptop are connected via a USB Type C-USB 2.0 data cable to establish a communication link based on the serial interface between the two electronic devices. When the communication link is connected, as shown in FIG. Figure 3 As shown in (a) of FIG. 1 , a prompt box will pop up on the smartphone to authorize the data link connection. If the user agrees to establish a communication connection between the smartphone and the laptop, the user can click the control 301 to agree to the connection. In this case, the smartphone and the laptop establish a communication link. After the communication link is established, the smartphone acts as an external storage device of the laptop and adds a corresponding icon to the storage list of the laptop, such as Figure 3 The icon 302 in (b) in FIG. The user can operate the files in the file directory on the laptop, thereby realizing the one-way sharing of files of the smartphone by the laptop.

[0207] However, file sharing based on the serial interface requires connecting the two electronic devices through a serial interface line, which is more complicated and reduces the efficiency of file sharing and the convenience of operation. In addition, when establishing a communication link based on a serial interface, the electronic device is required to support the installation of USB and removable hard disk drivers, while some portable products do not support the installation of USB interface drivers, such as tablets and smart phones. The file analysis is more restricted, thereby reducing the sharing efficiency of electronic devices. Furthermore, the communication connection established based on the serial interface only supports one-way file sharing, such as Figure 3 In the usage scenario, the laptop can unidirectionally share the files stored locally on the smartphone, but the smartphone cannot obtain the files on the laptop, which greatly reduces the sharing efficiency and affects the user experience.

[0208] Method 2: See Figure 4 As shown, Figure 4 A schematic diagram of implementing file sharing between electronic devices based on the Service Message Block (Samba) protocol is shown. Figure 4As shown, the two electronic devices mentioned above can be a laptop computer and a computer. The computer computer and the laptop computer are in the same local area network. The computer computer and the laptop computer can both install the Samba protocol. After installing the Samba protocol, the electronic devices are role-configured. The role configuration includes client role configuration and server role configuration. Among them, the files of the electronic device that assumes the server role can be shared on other electronic devices, and the electronic device that assumes the client role can locally operate the files shared by the electronic device that assumes the server role. Exemplarily, the laptop computer can be configured as a client, and the computer computer can be configured as a server. In this case, the laptop computer can access the server (i.e., the computer computer) by configuring the server's network address, such as the IP address (such as 192.168.1.15) or the device name (LocalCOM), and display the files stored in the computer computer on the laptop computer, such as Figure 4 As shown, the one-way sharing of computer files by the laptop is achieved.

[0209] However, file sharing based on the Samba protocol requires that multiple devices for file sharing be in the same local area network, and in a large number of outdoor scenes or public places, such as outdoor scenic spots or coffee shops, it is impossible to connect multiple electronic devices to the same local area network, which increases the sharing difficulty of the above-mentioned file sharing method. On the other hand, since the protocol stack of the Samba protocol is relatively large, most electronic devices do not support the installation of the Samba protocol, such as smart watches, smart phones, etc., which further limits the applicability of the above-mentioned sharing method. On the other hand, since electronic devices with the Samba protocol installed need to be configured with corresponding roles, electronic devices that assume the server role cannot assume the client role at the same time, so that the above-mentioned file sharing method is also one-way sharing, that is, electronic devices that assume the server role can share local files, but cannot operate the files of electronic devices that assume the client role, which greatly reduces the efficiency of sharing and affects the user experience.

[0210] Method 3: See Figure 5 As shown, Figure 5 The schematic diagram shows the file transfer between devices based on WIFI point-to-point direct connection. Figure 5As shown, the two electronic devices that realize file transfer between devices can be a smart phone and a smart watch. Both the smart phone and the smart watch are equipped with a WIFI communication module, which can transmit WIFI signals. For example, the smart phone can click the function button of hotspot sharing, and at this time, the smart phone generates a corresponding WIFI signal, such as SmartPhone. In this case, the smart phone acts as a service group manager (Group owner, GO), and the smart watch can search for the WIFI signal contained in the current scene through the built-in WIFI communication module, and click "SmartPhone" to access the WIFI signal generated by the smart phone to establish a direct communication link based on WIFI point-to-point between the smart phone and the smart watch. In this case, the smart phone can select the files to be transmitted from the local files and send them to the smart watch; correspondingly, the smart watch can also select the files to be sent from the local files and send them to the smart phone through the direct communication link established above, realizing the mutual transmission of files between electronic devices.

[0211] However, the communication link established based on the WIFI point-to-point direct connection can only realize data transmission between electronic devices, and the electronic device cannot operate the local files of another electronic device locally. It can only passively receive files sent by the other end and can only share specific files in one direction. It is impossible to share all files, and the file sharing experience is poor and the sharing efficiency is low. On the other hand, the WIFI point-to-point direct connection communication link established based on the WIFI module has a long connection time. Usually, the above connection process exceeds 5 seconds, thereby reducing the response efficiency of file sharing and further reducing the user experience.

[0212] Embodiment 1:

[0213] In order to solve the defects of existing file sharing technologies, the present application provides a file sharing method to achieve file sharing between two electronic devices, where the two electronic devices may be a first electronic device and a second electronic device. The first electronic device and the second electronic device may be two electronic devices of the same model, or may be electronic devices of different models. "First" and "second" are only used to distinguish two different electronic devices, and do not limit whether the functions and models of the electronic devices are the same. For example, Figure 6 A schematic diagram showing a connection between a first electronic device and a second electronic device provided in an embodiment of the present application is shown. Figure 6 As shown, the device initiating file sharing is called a first electronic device, and the first electronic device is configured with a near field communication module. Figure 6 The first electronic device in the example may be a smart phone. The device for the corresponding file sharing operation is called a second electronic device, which is also equipped with a near field communication module. Figure 6 The second electronic device in the example may be a laptop computer. Since both the first electronic device and the second electronic device are equipped with a near field communication module, when the distance between the first electronic device and the second electronic device is less than a preset trigger distance value (the trigger distance value is specifically a connection distance that satisfies the near field communication module, such as 5 cm for example), the two electronic devices can establish a file sharing link between the first electronic device and the second electronic device through the near field communication module, and realize file sharing between the two electronic devices based on the file sharing link.

[0214] Figure 7 The following is a flowchart of a method for sharing files according to an embodiment of the present invention, which is described in detail as follows:

[0215] In S701, the first electronic device establishes a point-to-point file sharing link based on Wireless Fidelity WIFI with the second electronic device through a near field communication module.

[0216] In S702, during the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; and the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area. The second file directory is used by the first electronic device to access files of the second electronic device; and the first file directory is used by the second electronic device to access files of the first electronic device.

[0217] In this embodiment, the first electronic device is equipped with a near field communication module, which can broadcast an NFC signal externally, and the NFC signal can carry the device identification of the first electronic device. In the process of the near field communication module of the first electronic device broadcasting the NFC signal externally, it can also determine whether the NFC signal broadcast by another near field communication module is detected in the current scene according to the preset detection cycle, and determine the distance value between the near field communication module and the near field communication module according to the strength of the NFC signal. In this case, if the first electronic device obtains the NFC signal sent by the near field communication module of another electronic device (i.e., the second electronic device) through the near field communication module, and determines that the distance value between the first electronic device and the second electronic device is less than the trigger distance value based on the signal strength of the NFC signal, the first electronic device can send a connection request to the second electronic device through the near field communication module, and the second electronic device can receive the connection request sent by the first electronic device through the local near field communication module, and trigger the connection process of the file sharing link.

[0218] For example, Figure 8 FIG. 1 shows a schematic diagram of a connection trigger between a first electronic device and a second electronic device provided by an embodiment of the present application. Figure 8As shown in (a), in the initial state, the distance between the first electronic device and the second electronic device is far. Since the longer the NFC signal distance is, the greater the signal attenuation is, therefore, when the first electronic device and the second electronic device are far apart, neither the first electronic device nor the second electronic device can detect the other's NFC signal, or the signal strength of the detected NFC signal is weak, and it is determined that the current distance between the two is greater than the preset trigger distance threshold. In this case, the first electronic device and the second electronic device will not perform the above connection process. The user holds the first electronic device and gradually approaches the second electronic device until it reaches Figure 8 In the state shown in (b), the near field communication module of the first electronic device detects the NFC signal sent by the second electronic device, and determines based on the signal strength of the NFC signal that the distance between the two is less than a preset trigger distance threshold. A connection request can be sent to the second electronic device through the near field communication module, and the above-mentioned connection process is triggered.

[0219] In this embodiment, the near field communication module of the first electronic device may carry the device identification of the first electronic device, and the NFC signal sent by the first electronic device may carry the device identification so that the second electronic device can determine the identity of the file sharing peer.

[0220] In one possible implementation, the second electronic device may be configured with a whitelist or a blacklist to perform a legitimacy check on the communication counterpart. In this case, when the second electronic device receives the NFC signal sent by the first electronic device, it may extract the device identifier carried in the NFC signal to determine whether the device identifier is in the whitelist or the blacklist, so as to identify the legitimacy of the first electronic device. If the second electronic device detects that the first electronic device is a legal device, it responds to the connection request; otherwise, if the second electronic device detects that the first electronic device is an illegal device, it does not respond to the connection request. Correspondingly, the first electronic device may also perform a legitimacy check on the NFC signal sent by the second electronic device, and when it is determined that the second electronic device is a legal device, it sends the above-mentioned connection request to the second electronic device.

[0221] In this embodiment, the first electronic device and the second electronic device establish a file sharing link based on WIFI point-to-point. In general, when an electronic device establishes a communication connection through a near field communication module, a data link based on NFC is established, and the module identification, transmission rate and other information of the near field communication module are exchanged. However, in the embodiment of the present application, when the first electronic device and the second electronic device establish a communication connection (i.e., the above-mentioned file sharing link), the network address, port number and other information are exchanged, so that a communication connection of a simulated "wireless local area network" between two devices can be realized based on the near field communication module. Since when establishing a data link based on NFC, the identities of the two connected electronic devices are equal; and when establishing a file sharing link based on WIFI point-to-point, it is necessary to include two types of roles, namely, a service group manager (Group owner, GO) and a service group client (Group Client, GC), therefore, one of the first electronic device and the second electronic device needs to be used as a GO when connected, and the other device is used as a GC when connected, and the corresponding connection operation is performed based on the corresponding role, so that a WIFI point-to-point communication connection can be established. Therefore, although the near field communication module is used to transmit data when establishing a communication connection between the first electronic device and the second electronic device, the entire connection process is different from the NFC connection process. Instead, a WIFI point-to-point connection process is used, thereby establishing a WIFI point-to-point file sharing link.

[0222] In a possible implementation, the electronic device that actively approaches can be used as the GC role in the WIFI point-to-point connection process, and the other electronic device that passively approaches can be used as the GO role in the WIFI point-to-point connection process. Figure 8 In the connection process shown in , the user holds the first electronic device and actively approaches the second electronic device. Therefore, during the connection process, the first electronic device will act as the GC role in the WIFI point-to-point connection process, that is, it will actively send a connection request to another electronic device (i.e., the second electronic device), and the second electronic device will act as the GO role in the WIFI point-to-point connection process, that is, passively respond to the connection request sent by the other electronic device. Therefore, in other scenarios, if the second electronic device actively moves toward the first electronic device, then in this case, the second electronic device can act as the GC role in the WIFI point-to-point connection, and the first electronic device can act as the GO role in the WIFI point-to-point connection.

[0223] In a possible implementation, the communication address for establishing a WIFI point-to-point communication connection can be pre-written in the near-field communication module of the first electronic device. In particular, the communication address can be a communication address based on WIFI point-to-point, and the above communication address includes a network address, a network identifier, an identity type (i.e., as a GO role or a GC role), a device identifier, and the like. Among them, the first electronic device can adjust the value of the above identity type according to the different states during the connection process. For example, if the first electronic device actively approaches the second electronic device, the first electronic device can configure the identity type in the near-field communication module as GC, and if the first electronic device detects that the second electronic device actively approaches, the first electronic device can configure the identity type in the near-field communication module as GO, so that in different connection scenarios, the first electronic device can be configured to the corresponding connection state. Correspondingly, the near-field communication module of the second electronic device can also be configured according to the above method.

[0224] In this embodiment, the first electronic device and the second electronic device establish a WIFI-based point-to-point communication connection through the near-field communication module, which can realize file sharing without affecting the existing network connection state of the electronic device and does not occupy the local WIFI communication module. Therefore, if the first electronic device and the second electronic device are connected to a wireless local area network before sharing, after the file sharing link between the devices is established, the above-mentioned established wireless connection local area network will not be interrupted (because the file sharing link is established based on the near-field communication module, not the WIFI module, it will not affect the established WIFI connection), reducing the impact on the established connection.

[0225] In a possible implementation, when the second electronic device acts as a GO when establishing a WIFI point-to-point communication connection, the near field communication module can pre-configure the network identity code of the second electronic device, i.e., SSID, and the corresponding access password PWD when accessing the network. If the second electronic device is configured with an access password, when the first electronic device establishes a WIFI point-to-point file sharing link with the second electronic device through the near field communication module, the corresponding access password needs to be carried in the connection request. If the access password in the connection request is empty or incorrect, the second electronic device can send a password input prompt box to the first electronic device, so that the user can enter the corresponding access password in the prompt box displayed by the first electronic device. After detecting that the access password in the connection request is correct, the above-mentioned file sharing link is established.

[0226] In this embodiment, the first electronic device and the second electronic device may be pre-installed with a virtual network disk application, so as to create corresponding virtual storage areas in the first electronic device and the second electronic device. For example, Fig. 9A schematic diagram showing the storage areas of a first electronic device and a second electronic device provided in an embodiment of the present application is shown. Fig. 9 As shown, the first electronic device and the second electronic device both include two types of storage areas, namely, a physical storage area constructed based on the actual storage memory, and a virtual storage area constructed based on the application of the virtual network disk. The following is an example of the first virtual storage area of ​​the first electronic device: the first virtual storage area does not actually occupy the storage resources of the memory of the first electronic device, that is, the first electronic device does not need to divide the corresponding area from the memory for use as a virtual storage area. When the first virtual storage area is not mounted with the file directory of other electronic devices, the storage capacity of the first virtual storage area is 0, that is, the virtual storage area cannot store locally generated files and data. When it is not mounted, the virtual storage area is in an unavailable state. If the first electronic device mounts the second file directory of the second electronic device on the first virtual storage area when establishing a file sharing link, the first virtual storage area of ​​the first electronic device will be displayed as the second file directory, and the user can operate the second file of the second electronic device by the second file directory mounted on the first virtual storage area, thereby achieving the purpose of file sharing between the two devices. The files stored in the second file directory are specifically files stored locally on the second electronic device. After the mounting is completed, the actual storage capacity of the first virtual storage area is the same as the total file capacity contained in the second file directory.

[0227] It should be noted that if a user needs to operate a file locally stored on a second electronic device on a first electronic device, the first electronic device needs to retrieve the file to be operated from the second electronic device to the memory of the first electronic device. Therefore, in the actual process of file sharing, the above-mentioned first virtual storage area can occupy part of the storage resources of the memory of the first electronic device.

[0228] In a possible implementation, the first electronic device and the second electronic device can both share the locally stored files. For example, each file can be configured with a corresponding sharing identifier. If the sharing identifier is a valid identifier, it means that the corresponding file can be shared with other devices. If the sharing identifier is an invalid identifier, the file corresponding to the identifier is a non-shared file. When generating the first file directory and the second file directory, the sharing identifiers corresponding to each file can be identified respectively, and the files with the sharing identifier as a valid identifier are displayed in the first file directory or the second file directory. Take the files stored in the first electronic device as an example to illustrate: the first electronic device contains multiple files, namely file 1, file 2, file 3 and file 4, wherein the sharing identifiers of file 1, file 2 and file 4 are all valid identifiers, and the sharing identifier of file 3 is an invalid identifier. Therefore, after the first electronic device and the second electronic device establish a file sharing link, the second virtual storage area of ​​the second electronic device can be hung in the first file directory of the first electronic device, and the first file directory can also contain files 1, file 2 and file 4. Since the sharing identifier in file 3 is an invalid identifier, it means that the file is not shared, so it will not appear in the first file directory. Optionally, files with an invalid sharing mark in the first electronic device may also appear in the first file directory mounted on the second electronic device. If a user initiates an operation request for sharing files with an invalid sharing mark on the second electronic device, the second electronic device may generate an unauthorized prompt message, thereby avoiding remote operations on non-shared files.

[0229] Exemplarily, the first electronic device is taken as an example to illustrate the difference between the virtual storage area before and after mounting. The mounting situation of the second electronic device is the same as that of the first electronic device, so it will not be described in detail later. For details, please refer to the relevant description of the first electronic device. Fig.10 FIG. 1 is a schematic diagram showing an operation interface of a first electronic device provided by an embodiment of the present application. Fig.10 As shown in (a), before the first electronic device mounts the second file directory of the second electronic device, the storage partitions of the first electronic device include three, namely "C drive", "D drive" and "virtual hard disk", among which the storage area marked with "virtual hard disk" is the first virtual storage area preset by the first electronic device. Before mounting the shared storage area of ​​any other device, if the first electronic device receives an access request to the first virtual storage area, such as clicking the icon corresponding to "virtual hard disk", a prompt message of "cannot access" will pop up, such as Fig.10(b) in the figure. Because the first virtual storage area does not store any files and data before mounting, and does not occupy the local storage resources of the first electronic device, it is in an inaccessible state. After mounting the second directory of the second electronic device, the icon of the first virtual storage area of ​​the first electronic device can be changed from "virtual hard disk" to "Mate40", where "Mate40" can be the device identifier of the second electronic device, that is, the second file directory mentioned above, such as Fig.10 If the first electronic device receives an access request to the second file directory, such as clicking the icon corresponding to "Mate40", the files stored in the second file can be displayed, such as Fig.10 (d) in order to achieve the purpose of file sharing.

[0230] In a possible implementation, the first electronic device and the second electronic device can divide the memory into a shared storage area and a non-shared storage area. The following is an explanation using the first electronic device as an example: the first electronic device can divide the memory into multiple storage areas, and different storage areas can be configured with corresponding sharing identifiers. If the sharing identifier is a valid identifier, the storage area is a shared storage area. If the sharing identifier is an invalid identifier, the storage area is a non-shared storage area, and the above storage area can store corresponding files. When the first electronic device mounts the first file directory in the virtual storage area of ​​the second electronic device, the first file directory can specifically include all files in the shared storage area, and the files in the non-shared storage area will not be included in the above-mentioned first file directory. Optionally, similar to the above-mentioned file-based sharing identifier, the first file directory can also include files in the non-shared storage area, but the second electronic device does not have the authority to perform remote operations on the files in the non-shared storage area.

[0231] In this embodiment, the mounting operation of the first electronic device and the second electronic device will occur in the process of establishing the above-mentioned file sharing link. When the file sharing link between the first electronic device and the second electronic device is established, the first electronic device will mount the second file directory of the second electronic device in the first virtual storage area, and the second electronic device will mount the first file directory of the first electronic device in the second virtual storage area.

[0232] For example, Fig.11 FIG. 1 shows a schematic diagram of a mounting structure of a first electronic device and a second electronic device provided by an embodiment of the present application. Fig.11As shown, a WIFI point-to-point file sharing link is established between the first electronic device and the second electronic device through a near field communication module. Therefore, the physical layer of the above file sharing link is a communication link established based on the near field communication module. At the network layer, the first electronic device and the second electronic device are connected based on the IP protocol, that is, when transmitting data, it is necessary to carry the corresponding IP address and encapsulate the IP header; at the data transmission layer, the first electronic device and the second electronic device establish a communication connection based on the TCP / UDP protocol, that is, when transmitting data, it is necessary to encapsulate the corresponding TCP header or UDP header; at the presentation layer and the session layer, in order to mount the second file directory of the second electronic device, the first electronic device needs to start the corresponding storage mounting service, and correspondingly, the second electronic device also needs to start the storage mounting service, so as to realize the mounting function; at the application layer, the first electronic device will run the application of the virtual network disk, thereby creating a corresponding virtual storage area on the first electronic device, and according to the data fed back by the second electronic device, the second file directory can be mounted on the first virtual storage area, and correspondingly, the second electronic device can also run the application of the virtual network disk to mount the first file directory on the second virtual storage area. For example, if the first electronic device needs to operate a file in the second file directory, it can send a file acquisition request to the second electronic device through the file sharing link established above, where the transmission process is as follows: a file acquisition request is generated through the application of the virtual network disk of the first electronic device, and the file acquisition request is packaged by storing the mounting service, TCP protocol, IP protocol and NFC protocol of the data link layer, and is sent to the second electronic device through the near field communication module. The second electronic device can receive the above-mentioned packaged file acquisition request through the local near field communication module, and unpack the packaged file acquisition request in sequence through the storage mounting service, TCP protocol, IP protocol and NFC protocol of the data link layer, and transmit the file acquisition request to the application of the virtual network disk of the second electronic device. The application of the virtual network disk obtains the file data of the file corresponding to the above-mentioned file acquisition request from the local storage through the local file access service, and encapsulates the file data through the application of the virtual network disk to generate a response data packet. Similarly, the above-mentioned response data packet is packaged through multiple network layers and sent to the first electronic device. The first electronic device unpacks the packaged response data packet through multiple network layers and transmits it to the application of the virtual network disk of the first electronic device, thereby achieving the purpose of remote access to files. Correspondingly, if the second electronic device accesses the files in the first file directory of the first electronic device, it can also be implemented by referring to the above process, which will not be described in detail here.

[0233] In a possible implementation, the first electronic device and the second electronic device establish the above-mentioned file sharing link in a specific manner: the first electronic device can generate a sharing request carrying the network address and the information of the mounted first file directory, and send the above-mentioned sharing request to the second electronic device through the near field communication module. After receiving the above-mentioned sharing request, the second electronic device can add the first electronic device to the local area network corresponding to the second electronic device according to the network address in the sharing request, thereby constructing a WIFI point-to-point local area network between the first electronic device and the second electronic device. Then, the second electronic device can mount the first file directory on the second virtual storage area of ​​the second electronic device according to the information of the first file directory in the sharing request, so that the files stored on the first electronic device can be browsed locally on the second electronic device through the first file directory. Correspondingly, after mounting the first file directory of the first electronic device, the second electronic device can generate sharing response information according to the communication address of the second electronic device and the relevant information of the second file directory, and send the above-mentioned sharing response information to the first electronic device through the established WIFI point-to-point communication channel. After receiving the sharing response information, the first electronic device can mount the second file directory on the first virtual storage area of ​​the first electronic device according to the relevant information of the second file directory in the sharing response information, so that the files stored on the second electronic device can be browsed locally on the first electronic device through the second file directory, thereby realizing two-way file sharing between the two electronic devices. After mounting the second file directory, the first electronic device can generate a link completion message according to the communication address of the second electronic device in the sharing response information, and send the above link completion message to the second electronic device through the established WIFI point-to-point communication channel. At this time, the first electronic device side will recognize that the file sharing link has been created. When the second electronic device receives the above link completion message, the second electronic device side will also recognize that the file sharing link has been created.

[0234] In this embodiment, after the first electronic device mounts the second file directory of the second electronic device, the user can operate the local files of the second electronic device on the first electronic device side, and correspondingly, the user can also operate the local files of the first electronic device on the second electronic device side, thereby achieving the purpose of file sharing.

[0235] Further, Fig.12 FIG. 5 shows a specific interaction flow chart of S701 in a method for providing file sharing in another embodiment of the present application. Fig.12 As shown, compared with S701, the first electronic device in this embodiment establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, specifically including: S1201-S1206, which are detailed as follows:

[0236] In S1201, the first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device.

[0237] In this embodiment, when the first electronic device detects the presence of NFC signals generated by other electronic devices in the current environment, such as the near-field communication module of the second electronic device generates an NFC signal within a preset range, the first electronic device can receive the NFC signal through the locally configured near-field communication module, determine signal parameters of the NFC signal, such as data transmission rate and signal frequency, and determine communication rules for near-field communication with the second electronic device.

[0238] In this embodiment, the first electronic device determines its own preconfigured first communication port number, and optionally, the first communication port number can be pre-written in the register of the near field communication module. The first electronic device generates a port acquisition request to obtain the port number used by the opposite end (i.e., the second electronic device) when communicating with the second electronic device, and encapsulates the local port number (i.e., the first communication port number) in the above port acquisition request to notify the opposite end (i.e., the second electronic device) of the port number to be used when feeding back the response information.

[0239] In this embodiment, after generating a port acquisition request, the first electronic device can modulate the signal parameters obtained above through the near field communication module of the first electronic device to generate an NFC signal corresponding to the port acquisition request. The signal parameters such as the transmission rate and signal frequency of the NFC signal corresponding to the port acquisition request are consistent with the NFC signal generated by the second electronic device, so that the NFC signal sent by the first electronic device can be received by the second electronic device.

[0240] In one possible implementation, Fig.13 FIG. 1 shows a schematic diagram of the format of a request data packet provided by an embodiment of the present application. Fig.13As shown, the request data packet may include data packet headers of each network layer, namely, the Ethernet header of the data link layer, the network address IP header of the network layer, the TCP header of the transport layer, and the header of the remote procedure call (RPC) service of the application layer. In addition to the above headers, its data field can be used to carry the data required to carry in the process of establishing the file sharing link, that is, the data field. The data field may include the following parts: the request message sequence number ReqSeqNum, the number of request commands ReqNum, and the request command parameters op+args. Among them, ReqSeqNum is used as the request identifier of the request data packet to distinguish different request data packets. Optionally, the length of the ReqSeqNum can be two bytes; ReqNum is used to indicate the number of request commands carried in the request data packet. Since a request data packet can contain multiple different requests, different requests can be encapsulated in one request data packet. For example, if multiple files need to be accessed at the same time, multiple files can be directly selected through multiple selection methods such as box selection. At this time, each file corresponds to a request, and multiple requests can be encapsulated in one request data packet. Therefore, ReqNum can be used to notify the other party of the number of requests contained in the request data packet. Optionally, the length of the ReqNum can be two bytes; op+args is used to carry corresponding request commands and parameters. If the number of requests contained in the request data packet is multiple, there can be multiple op+args in one data packet. The length of this field is uncertain and is determined according to the specific content carried. This field can be data based on the type-length-value (TLV) format. Based on this, when the first electronic device generates a first port acquisition request, it can encapsulate the first communication port number and the corresponding request command in the op+args field based on the format of the above-mentioned request data packet, and configure the values ​​of other fields accordingly, and encapsulate the request data to obtain a request data packet corresponding to the port acquisition request, and send it to the second electronic device.

[0241] In S1202, the second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device.

[0242] In this embodiment, the second electronic device can receive the port acquisition request sent by the first electronic device through the near field communication module, extract the first communication port number of the first electronic device from the port acquisition request, and store the first communication port number.

[0243] In this embodiment, after receiving the port acquisition request sent by the first electronic device, the second electronic device can start the connection process of the file sharing link. In this case, the second electronic device can respond to the port acquisition request, generate corresponding port response information, and encapsulate the local second communication port number into the port response information.

[0244] In a possible implementation, if the second electronic device is in an occupied state, a response message for refusing the connection can be generated and sent to the first electronic device. Alternatively, if the first electronic device does not receive the port response message fed back by the second electronic device within the preset effective response time, the second electronic device is identified as being in an occupied state. In this case, the second electronic device may not need to respond to the port acquisition request. Among them, the second electronic device being in an occupied state may include: the second electronic device has established a file sharing link with other electronic devices other than the first electronic device, that is, the second electronic device is sharing files with other electronic devices and cannot establish file sharing with the first electronic device; or the second electronic device is in an abnormal state such as downtime or abnormal communication module, at which time the second electronic device is in an occupied state; or the second electronic device does not have available computing resources and storage resources, etc., and the second electronic device can also be identified as being in an occupied state. If the first electronic device determines that the second electronic device is in an occupied state, it can generate information that cannot be shared to notify the user that the second electronic device is unavailable.

[0245] In one possible implementation, Fig.14 FIG. 1 shows a schematic diagram of the format of a response data packet provided by an embodiment of the present application. Fig.14 As shown, the response data packet can also contain data packet headers at each network layer. For details, see Fig.13The data field can be used to carry the specific content of this response, that is, the data field. The data field can include the following parts: status code Status, response message sequence number ACKSeqNum, response number ACKNum, response command parameter op+results. Among them, Status is used to determine the response status to the request, and can also be used to identify the current occupancy status of the second electronic device; ACKSeqNum is used as the request identifier of the response data packet to distinguish different response data packets. It should be noted that the value of ACKSeqNum is the same as that of ReqSeqNum to determine which request data packet to respond to. Optionally, the length of ACKSeqNum can be specifically two bytes; ACKNum is used to indicate the number of response requests carried in the response data packet. Since a request data packet can contain multiple different requests, correspondingly, a response data packet can respond to multiple different requests. Therefore, the number of response requests contained in the response data packet can be determined by ACKNum. Optionally, the length of ACKNum can be specifically two bytes; op+results is used to carry corresponding response commands and parameters. If the response data packet specifically responds to multiple requests, there can be multiple op+results in a response data packet. The length of this field is uncertain and is determined according to the specific content carried. This field can be data based on the type-length-value (TLV) format. Based on this, the second electronic device can configure the data fields in the response data packet according to the values ​​corresponding to each field in the port acquisition request, and load the second communication port number as the response parameter corresponding to the port acquisition request into the op+results field, thereby generating corresponding port response information and sending it to the first electronic device.

[0246] In S1203, the first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number.

[0247] In this embodiment, after receiving the port response information sent by the second electronic device, the first electronic device can determine that the second electronic device is available and can share files with the second electronic device, so the mounting process of the virtual storage area is executed. Before mounting the second file directory, the first virtual storage area of ​​the first electronic device is in a state to be configured, as described above, and does not occupy actual storage resources and cannot be accessed.

[0248] In this embodiment, after receiving the port response information from the second electronic device, the first electronic device may extract the second communication port number included in the port response information and store the second communication port number in the local memory.

[0249] In this embodiment, in order to implement the mount operation of the virtual storage area, the first electronic device can generate a first mount instruction. It should be noted that the first mount instruction can be encapsulated through the request data packet in S1201. Correspondingly, the content of the op+args field is set based on the first mount instruction, and the values ​​of other fields can be adjusted accordingly according to the actual use process. The first electronic device can add the second communication port number extracted above to the first mount instruction, specifically, it can be written into the op+args field. It should be noted that the first electronic device can generate an NFC signal corresponding to the first mount instruction through the near-field communication module to send it to the second electronic device. Among them, the signal parameters of the NFC signal corresponding to the first mount instruction are determined based on the step S1201, that is, the first mount instruction is also sent to the second electronic device through the near-field communication module.

[0250] In this embodiment, the first mount instruction includes the second communication port number, which can be used by the second electronic device to authenticate the first mount instruction, that is, to determine whether it is a mount instruction sent by a device that is authorized to share.

[0251] In S1204, the second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port.

[0252] In this embodiment, after the second electronic device receives the first mount instruction, it can extract the second communication port number carried in the instruction and compare it with the locally preset port number. If the second communication port number carried in the first mount instruction is consistent with the communication port number preset locally by the second electronic device, the first mount instruction is identified as a legal instruction and the operation of S1204 is executed; conversely, if the second communication port number in the first mount instruction is inconsistent with the locally preset port number, the mount instruction is identified as an invalid instruction and the first mount instruction may not be responded to. Optionally, the second electronic device can return to execute the operation of S1202, that is, resend the locally preset second communication port number to the first electronic device, so that the first electronic device resends the above-mentioned first mount instruction based on the updated second communication port number.

[0253] In this embodiment, the second electronic device stores the first communication port number of the first electronic device and the first mount instruction sent by the first electronic device. The second electronic device can mount the local second virtual storage area based on the above two parameters, so that the access operation to the second storage area generates a file acquisition request pointing to the first communication port number, thereby enabling remote operation of the files stored on the first electronic device. Optionally, the first mount instruction can carry the directory name of the first file directory, and the second electronic device can adjust the name of the second virtual storage area according to the directory name contained in the first mount instruction.

[0254] In this embodiment, after the second electronic device mounts the first file directory of the first electronic device, a second mount instruction can be generated, and correspondingly, the second mount instruction can include the first communication port number of the first electronic device so that the first electronic device can authenticate the second mount instruction. Optionally, the second mount instruction can be encapsulated by the response data packet described in S1202, that is, the response instruction of the second mount instruction is encapsulated in the op+results field, wherein the ACKSeqNum in the response data packet can be determined according to the ReqSeqNum in the first response instruction, that is, the second mount instruction is a response instruction to the first mount instruction.

[0255] In S1205, the first electronic device mounts the second file directory in the first virtual storage area in response to the second mount instruction.

[0256] In this embodiment, after receiving the second mount instruction, the first electronic device can also compare the first communication port number in the second mount instruction with the local communication port number of the first electronic device to determine whether to respond to the second mount instruction. For specific description, please refer to S1024, which will not be repeated here.

[0257] In this embodiment, if the first communication port number in the second mount instruction matches the local communication port number of the first electronic device, the local first virtual storage area can be mounted and set according to the first communication port number and the second mount instruction sent by the second electronic device, so that the access operation to the first storage area generates a file acquisition request pointing to the second communication port number, thereby enabling remote operation of the file stored on the second electronic device. Optionally, the second mount instruction can carry the directory name of the second file directory, and the first electronic device can adjust the name of the first virtual storage area according to the directory name contained in the second mount instruction.

[0258] In S1206, the first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0259] In this embodiment, since the first electronic device and the second electronic device have completed the mounting operation, that is, the first electronic device can obtain local files of the second electronic device, and the second electronic device can also obtain local files of the first electronic device, thereby realizing two-way file sharing. In this case, the first electronic device can send a mounting completion message to the second electronic device to notify the second electronic device that the file sharing link has been established and the file sharing operation can be performed.

[0260] Optionally, the mount completion information may be encapsulated in the request data packet. Specifically, the mount completion information may be encapsulated in the op+args field.

[0261] In an embodiment of the present application, two handshakes are performed between the first electronic device and the second electronic device to establish a file sharing link. During the first handshake, it is determined that the second electronic device is available, and a communication connection is established between the first electronic device and the second electronic device. During the second handshake, mounting operations are performed on both sides, and the corresponding file directory is mounted in the virtual storage area of ​​the other end, thereby enabling file sharing. Establishing a file sharing link in the above manner can ensure that both parties of file sharing are in an available state, thereby improving the accuracy and success rate of establishing the file sharing link.

[0262] Further, as another embodiment of the present application, this embodiment may further include S1207 to S1208 and / or S1209 to S1210 after S701, which are specifically described as follows:

[0263] Optionally, after the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes:

[0264] In S1207, the second electronic device sends a first acquisition instruction for the first file in the first file directory to the first electronic device in response to the first operation request for the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file.

[0265] In this embodiment, if the user needs to operate a file on the first electronic device on the second electronic device, the second electronic device will obtain a first operation request for the first file in the first file directory. For example, the second electronic device receives a double-click of the user. Fig.10The icon of "File 1" in (d) indicates that the user needs to open "File 1" on the second electronic device, and an opening operation request for "File 1" is generated, that is, the first operation request mentioned above, and "File 1" is the first file mentioned above. The first operation request includes different types of operation requests for the first file, such as a copy operation request, an open operation request, a delete operation request, and an edit operation request.

[0266] In this embodiment, after detecting the first operation request initiated by the user, the second electronic device can identify the file identifier of the first file corresponding to the first operation request. The file identifier is used to indicate the first file of the required operation, and the file identifier can be a file name or a file access address, etc.

[0267] In this embodiment, the second electronic device can obtain first attribute information about the first file, and the first attribute information may include the file identifier of the above-mentioned first file, and may also include the file type, access rights, file size, last access time and other information of the first file. The second electronic device generates the above-mentioned first acquisition instruction according to the first attribute information, and sends the above-mentioned first acquisition instruction to the first electronic device through the near field communication module. Among them, the first acquisition instruction can be encapsulated in the format of the above-mentioned request data packet, and the first acquisition instruction is added to the op+args field. It should be noted that if the user initiates a first operation request for multiple first files at the same time, the value of ReqNum in the request data packet can be adjusted accordingly, and the op+args field equal to the number of first files can be added.

[0268] In S1208, the first electronic device obtains first file data of the first file based on the first attribute information of the received first acquisition instruction, and sends the first file data to the second electronic device.

[0269] In this embodiment, after receiving the first acquisition instruction, the first electronic device can determine the first file stored on the first electronic device according to the values ​​of each attribute item recorded in the first attribute information. For example, if the first attribute information includes a file identifier of the first file, the first file can be searched according to the file identifier. For example, if the first attribute information includes a storage path of the first file, the first file can be jumped to the directory corresponding to the first file according to the storage path of the first file, thereby obtaining the file data of the first file.

[0270] In this embodiment, after acquiring the first file data corresponding to the first file, the first electronic device may encapsulate the first file data through the above-mentioned response data packet, and send the encapsulated response data packet to the second electronic device through the near field communication module.

[0271] In this embodiment, after receiving the first file data, the second electronic device can perform a corresponding operation on the first file. For example, if the first operation request is a browsing operation on the first file, the first file data can include the file content of the first file, and the second electronic device can generate a preview page of the first file based on the file content carried in the first file data; if the first operation request is a deletion request for the first file, the first file data can include a deletion certificate for the first file, and the second electronic device can generate a deletion result for the first file based on the above deletion certificate.

[0272] In this embodiment, if the operation type of the first operation request is an editing request, that is, editing operations such as modification, addition or deletion are required on the content of the first file, then the data packet of the first file stored locally on the first electronic device needs to be adjusted to update the first file stored locally on the first electronic device.

[0273] In an embodiment of the present application, the second electronic device can locally respond to the user's operation on storing files on the first electronic device, that is, the above-mentioned first operation request, and perform corresponding operation processing on the first file, and receive the first file data fed back by the first electronic device, thereby achieving the purpose of file sharing.

[0274] Further, as another embodiment of the present application, the first acquisition instruction further includes second status information of a second file directory of the second electronic device; and the above S1208 further includes the following steps:

[0275] The first electronic device extracts the second status information of the first acquisition instruction and updates the second file directory of the first virtual storage area.

[0276] In this embodiment, when the second electronic device sends the first acquisition instruction to the first electronic device, it can also carry status information about the local file directory, that is, the above-mentioned second status information. For example, the second electronic device stores the first file of the first electronic device locally on the second electronic device, and the local file directory of the second electronic device will add the first file. In order to achieve synchronization of the file directory, the second electronic device can encapsulate the second status information of the local file directory into the above-mentioned first acquisition instruction, and the first electronic device can update the mounted second file directory according to the second status information.

[0277] In an embodiment of the present application, when the second electronic device needs to obtain the first file of the communication counterpart, the second electronic device can also encapsulate the state of the local directory into the first file acquisition request to update the second file directory mounted by the first electronic device, thereby achieving the purpose of directory synchronization update and maintaining the consistency of the file sharing status.

[0278] In S1209, the first electronic device sends a second acquisition instruction for the second file to the second electronic device in response to a second operation request for the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file.

[0279] In this embodiment, since the implementation process of S1209 is similar to the implementation process of S1207, except that S1207 is that the second electronic device needs to operate the first file of the first electronic device, while S1209 is that the first electronic device needs to operate the second file of the second electronic device, the specific description can be found in the relevant description of S1207, which will not be repeated here.

[0280] In S1210, the second electronic device obtains second file data of the second file based on the second attribute information of the received second obtaining instruction, and sends the second file data to the first electronic device.

[0281] In this embodiment, since the implementation process of S1210 is similar to the implementation process of S1208, except that S1208 is that the second electronic device needs to operate the first file of the first electronic device, while S1210 is that the first electronic device needs to operate the second file of the second electronic device, the specific description can be found in the relevant description of S1208, which will not be repeated here.

[0282] Furthermore, the second acquisition instruction further includes first status information of a first file directory of the first electronic device; and the second electronic device acquires second file data of the second file based on the second attribute information of the received second acquisition instruction, including:

[0283] The second electronic device extracts the first status information of the second acquisition instruction and updates the first file directory of the second virtual storage area.

[0284] Similarly, the second electronic device may also update the first file directory mounted on the second electronic device according to the first status information carried in the second acquisition instruction fed back by the first electronic device, so as to keep the status of the file sharing area between the two electronic devices synchronized.

[0285] As can be seen from the above, a file sharing method provided by the embodiment of the present application can establish a file sharing link with a second electronic device through a near field communication module of a first electronic device, and in the process of establishing the file sharing link, a second file directory for storing local files of the second electronic device can be created in a first virtual storage area preset by the first electronic device, and correspondingly, a second file directory for storing local files of the first electronic device can be created in a second virtual storage area preset by the second electronic device. After the above file sharing link is established, the first electronic device can browse the local files of the second electronic device through the second file directory, and similarly, the second electronic device can also browse the local files of the first electronic device through the first file directory, thereby realizing two-way file sharing, thereby improving the efficiency of file sharing. On the other hand, the above file sharing link is established between the first electronic device and the second electronic device based on the near field communication module, and the near field communication module has the advantages of fast response and simple access operation, and can also further improve the efficiency of establishing the file sharing link and improve the user experience. Furthermore, a WIFI point-to-point file sharing link is established between the first electronic device and the second electronic device based on the near field communication module, without occupying the WIFI communication module, maintaining the continuity of the original WIFI communication link between the first electronic device and the second electronic device, and avoiding the impact of the file sharing process on the original connection of the device.

[0286] Embodiment 2:

[0287] The first embodiment describes the implementation process of the file sharing method from the perspective of interaction between the first electronic device and the second electronic device, while the second embodiment describes the implementation process of the file sharing method with the first electronic device as the execution subject of the process. Fig.15 A flowchart of a method for sharing files on a first electronic device provided by an embodiment of the present application is shown, and the details are as follows:

[0288] In S1501, the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module;

[0289] In S1502, during the process of establishing the file sharing link, the first electronic device mounts a second file directory of the second electronic device in a preset first virtual storage area; the second file directory is used by the first electronic device to access files of the second electronic device.

[0290] Optionally, the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module, including:

[0291] The first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0292] The first electronic device receives the port response information sent by the second electronic device; the port response information includes the second communication port number of the second electronic device;

[0293] The first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number;

[0294] The first electronic device receives a second mount instruction fed back by the second electronic device based on the first mount instruction; the second mount instruction includes the first communication port;

[0295] The first electronic device mounts the second file directory in the first virtual storage area in response to the second mounting instruction;

[0296] The first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0297] Optionally, after the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes:

[0298] The first electronic device receives a first acquisition instruction sent by the second electronic device; the first acquisition instruction is generated by the second electronic device in response to a first operation request on a first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0299] The first electronic device obtains first file data of the first file based on the first attribute information, and sends the first file data to the second electronic device.

[0300] Optionally, after the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes:

[0301] The first electronic device sends a second acquisition instruction of the second file to the second electronic device in response to a second operation request on the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0302] The first electronic device receives second file data about the second file fed back by the second electronic device based on the second acquisition instruction.

[0303] Embodiment three:

[0304] The first embodiment describes the implementation process of the file sharing method from the perspective of interaction between the first electronic device and the second electronic device, while the third embodiment describes the implementation process of the file sharing method with the second electronic device as the execution subject of the process. Fig.16 A flowchart of a method for sharing files on a second electronic device provided by an embodiment of the present application is shown, and the details are as follows:

[0305] In S1601, the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through a near field communication module in response to a connection operation initiated by the first electronic device;

[0306] In S1602, during the process of establishing the file sharing link, the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area; the first file directory is used by the second electronic device to access files of the first electronic device.

[0307] Optionally, the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through a near field communication module in response to a connection operation initiated by the first electronic device, including:

[0308] The second electronic device receives the port acquisition request sent by the first electronic device through the near field communication module; the port acquisition request includes the first communication port number of the first electronic device;

[0309] The second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device;

[0310] The second electronic device receives a first mounting instruction sent by the first electronic device; the first mounting instruction includes the second communication port number;

[0311] The second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port;

[0312] The second electronic device receives the mounting completion information sent by the first electronic device, and recognizes that the file sharing link between the second electronic device and the first electronic device has been established.

[0313] Optionally, after the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device in response to a connection operation initiated by the first electronic device through the near field communication module, the method further includes:

[0314] The second electronic device sends a first acquisition instruction of the first file to the first electronic device in response to a first operation request on the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0315] The second electronic device receives the first file data about the first file fed back by the first electronic device based on the first acquisition instruction.

[0316] Optionally, after the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device in response to a connection operation initiated by the first electronic device through the near field communication module, the method further includes:

[0317] The second electronic device receives a second acquisition instruction sent by the first electronic device; the second acquisition instruction is generated by the first electronic device in response to a second operation request on a second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0318] The second electronic device obtains second file data of the second file based on the second attribute information, and sends the second file data to the first electronic device.

[0319] Embodiment 4:

[0320] Corresponding to the file sharing method described in the second embodiment above, Fig.17 A structural block diagram of a file sharing device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0321] Reference Fig.17 , the file sharing devices include:

[0322] The first file sharing link establishing unit 171 is used to establish a file sharing link based on wireless fidelity WIFI point-to-point with the second electronic device through a near field communication module;

[0323] The second file directory mounting unit 172 is used to mount the second file directory of the second electronic device in the preset first virtual storage area during the process of establishing the file sharing link; the second file directory is used for the first electronic device to access the files of the second electronic device.

[0324] Optionally, the first file sharing chain establishing unit includes:

[0325] A first communication port number sending unit, configured to send a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0326] A second communication port number receiving unit, configured to receive port response information sent by the second electronic device; the port response information includes a second communication port number of the second electronic device;

[0327] A first mounting instruction sending unit, configured to send a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number;

[0328] A second mount instruction receiving unit, configured to receive a second mount instruction fed back by the second electronic device based on the first mount instruction; the second mount instruction includes the first communication port;

[0329] a second mount instruction response unit, configured to mount the second file directory in the first virtual storage area in response to the second mount instruction;

[0330] The mount completion information sending unit is used to send the mount completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

[0331] Optionally, the file sharing device further includes:

[0332] a first acquisition instruction receiving unit, configured to receive a first acquisition instruction sent by the second electronic device; the first acquisition instruction is generated by the second electronic device in response to a first operation request on a first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0333] A first file data sending unit is configured to obtain first file data of the first file based on the first attribute information, and send the first file data to the second electronic device.

[0334] Optionally, the file sharing device further includes:

[0335] A second acquisition instruction sending unit, configured to send a second acquisition instruction of the second file to the second electronic device in response to a second operation request regarding the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0336] The second file data receiving unit is configured to receive second file data about the second file fed back by the second electronic device based on the second acquisition instruction.

[0337] Therefore, the file sharing device provided in the embodiment of the present application can also establish a file sharing link with the second electronic device through the near field communication module of the first electronic device, and in the process of establishing the file sharing link, a second file directory for storing local files of the second electronic device can be created in the first virtual storage area preset by the first electronic device, and correspondingly, a second file directory for storing local files of the first electronic device is created in the second virtual storage area preset by the second electronic device. After the above-mentioned file sharing link is established, the first electronic device can browse the local files of the second electronic device through the second file directory, and similarly, the second electronic device can also browse the local files of the first electronic device through the first file directory, thereby realizing two-way file sharing, thereby improving the efficiency of file sharing. On the other hand, the above-mentioned file sharing link is established between the first electronic device and the second electronic device based on the near field communication module, and the near field communication module has the advantages of fast response and simple access operation, and can also further improve the efficiency of establishing the file sharing link and improve the user's experience. Furthermore, the first electronic device and the second electronic device establish a WIFI point-to-point file sharing link based on the near field communication module, without occupying the WIFI communication module, maintaining the continuity of the original WIFI communication link between the first electronic device and the second electronic device, and avoiding the impact of the file sharing process on the original connection of the device.

[0338] Embodiment five:

[0339] Corresponding to the page display method described in the third embodiment above, Fig.18 A structural block diagram of a file sharing device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0340] Reference Fig.18 , the file sharing devices include:

[0341] A second file sharing link establishing unit 181 is configured for the second electronic device to establish a wireless fidelity WIFI point-to-point file sharing link with the first electronic device via a near field communication module in response to a connection operation initiated by the first electronic device;

[0342] The first file directory mounting unit 182 is used for mounting the first file directory of the first electronic device in a preset second virtual storage area by the second electronic device during the process of establishing the file sharing link; the first file directory is used for the second electronic device to access the files of the first electronic device.

[0343] Optionally, the second file sharing link establishing unit 181 includes:

[0344] A first communication port number receiving unit, configured to receive a port acquisition request sent by the first electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device;

[0345] A second communication port number sending unit, configured to send port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device;

[0346] A first mounting instruction receiving unit, configured to receive a first mounting instruction sent by the first electronic device; the first mounting instruction includes the second communication port number;

[0347] a second mount instruction sending unit, configured to mount the first file directory in the second virtual storage area in response to the first mount instruction, and send a second mount instruction to the first electronic device; the second mount instruction includes the first communication port;

[0348] The mount completion information receiving unit is used to receive the mount completion information sent by the first electronic device, and identify that the file sharing link with the first electronic device has been established.

[0349] Optionally, the file sharing device further includes:

[0350] A first operation request response unit, configured to send a first acquisition instruction for the first file to the first electronic device in response to a first operation request for the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file;

[0351] The first file data receiving unit is configured to receive the first file data about the first file fed back by the first electronic device based on the first acquisition instruction.

[0352] Optionally, the file sharing device further includes:

[0353] a second acquisition instruction receiving unit, configured to receive a second acquisition instruction sent by the first electronic device; the second acquisition instruction is generated by the first electronic device in response to a second operation request on a second file in the second file directory; the second acquisition instruction includes second attribute information of the second file;

[0354] A second file data sending unit is configured to obtain second file data of the second file based on the second attribute information, and send the second file data to the first electronic device.

[0355] Fig.19 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.19 As shown, the electronic device 19 of this embodiment includes: at least one processor 190, a memory 191, and a computer program 192 stored in the memory 191 and executable on the at least one processor 190, and when the processor 190 executes the computer program 192, the steps in any of the above-mentioned file sharing method embodiments are implemented.

[0356] The electronic device 19 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 190 and a memory 191. Those skilled in the art will appreciate that Fig.19 It is only an example of the electronic device 19 and does not constitute a limitation on the electronic device 19. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0357] The processor 190 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0358] In some embodiments, the memory 191 may be an internal storage unit of the electronic device 19, such as a hard disk or memory of the electronic device 19. In other embodiments, the memory 191 may also be an external storage device of the electronic device 19, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 19. Further, the memory 191 may also include both an internal storage unit of the electronic device 19 and an external storage device. The memory 191 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 191 may also be used to temporarily store data that has been output or is to be output.

[0359] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0360] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0361] An embodiment of the present application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.

[0362] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0363] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0364] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0365] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0366] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

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

[0369] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A file sharing method, characterized in that: include: The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module; In the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; And, the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area; The second file directory is used by the first electronic device to access files of the second electronic device; The first file directory is used by the second electronic device to access files of the first electronic device; The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module, including: The first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device; the port acquisition request includes data packet headers at each network layer; The second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device; The first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number; The second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port; The first electronic device mounts the second file directory in the first virtual storage area in response to the second mounting instruction; The first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

2. The method according to claim 1, characterized in that After the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes: The second electronic device sends a first acquisition instruction of the first file to the first electronic device in response to a first operation request on the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file; The first electronic device obtains first file data of the first file based on the first attribute information of the received first obtaining instruction, and sends the first file data to the second electronic device.

3. The method according to claim 2, characterized in that The first acquisition instruction further includes second status information of a second file directory of the second electronic device; the first electronic device acquires first file data of the first file based on the first attribute information of the received first acquisition instruction, including: The first electronic device extracts the second state information of the first acquisition instruction and updates the second file directory of the first virtual storage area; The first electronic device acquires the first file data of the first file based on the first attribute information.

4. The method according to claim 1, characterized in that After the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes: The first electronic device sends a second acquisition instruction of the second file to the second electronic device in response to a second operation request on the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file; The second electronic device obtains second file data of the second file based on the second attribute information of the received second obtaining instruction, and sends the second file data to the first electronic device.

5. The method according to claim 4, characterized in that The second acquisition instruction also includes first status information of a first file directory of the first electronic device; The second electronic device acquires second file data of the second file based on the second attribute information of the received second acquisition instruction, including: The second electronic device extracts the first state information of the second acquisition instruction and updates the first file directory of the second virtual storage area; The second electronic device acquires the second file data of the second file based on the second attribute information.

6. The method according to any one of claims 1 to 5, characterized in that: The near field communication module of the first electronic device is configured with the communication address of the first electronic device based on the WIFI point-to-point communication; the process communication module of the second electronic device is configured with the communication address of the second electronic device based on the WIFI point-to-point communication.

7. A file sharing method, applied to a first electronic device, characterized in that: include: The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module; In the process of establishing the file sharing link, the first electronic device mounts the second file directory of the second electronic device in a preset first virtual storage area; The second file directory is used by the first electronic device to access files of the second electronic device; The first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through a near field communication module, including: The first electronic device sends a port acquisition request to the second electronic device through a near field communication module; the port acquisition request includes a first communication port number of the first electronic device; the port acquisition request includes data packet headers at each network layer; The first electronic device receives the port response information sent by the second electronic device; the port response information includes the second communication port number of the second electronic device; The first electronic device sends a first mounting instruction to the second electronic device; the first mounting instruction includes the second communication port number; The first electronic device receives a second mount instruction fed back by the second electronic device based on the first mount instruction; the second mount instruction includes the first communication port; The first electronic device mounts the second file directory in the first virtual storage area in response to the second mounting instruction; The first electronic device sends mounting completion information to the second electronic device to notify the second electronic device that the file sharing link has been established.

8. The method according to claim 7, characterized in that After the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes: The first electronic device receives a first acquisition instruction sent by the second electronic device; the first acquisition instruction is generated by the second electronic device in response to a first operation request on a first file in a first file directory; the first acquisition instruction includes first attribute information of the first file; The first electronic device obtains first file data of the first file based on the first attribute information, and sends the first file data to the second electronic device.

9. The method according to claim 7, characterized in that: After the first electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the second electronic device through the near field communication module, the method further includes: The first electronic device sends a second acquisition instruction of the second file to the second electronic device in response to a second operation request on the second file in the second file directory; the second acquisition instruction includes second attribute information of the second file; The first electronic device receives second file data about the second file fed back by the second electronic device based on the second acquisition instruction.

10. A file sharing method, applied to a second electronic device, characterized in that: include: The second electronic device establishes a point-to-point file sharing link based on wireless fidelity WIFI with the first electronic device through the near field communication module in response to a connection operation initiated by the first electronic device; In the process of establishing the file sharing link, the second electronic device mounts the first file directory of the first electronic device in a preset second virtual storage area; the first file directory is used by the second electronic device to access files of the first electronic device; The second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device through a near field communication module in response to a connection operation initiated by the first electronic device, including: The second electronic device receives the port acquisition request sent by the first electronic device through the near field communication module; the port acquisition request includes the first communication port number of the first electronic device; the port acquisition request includes data packet headers of each network layer; The second electronic device sends port response information to the first electronic device; the port response information includes a second communication port number of the second electronic device; The second electronic device receives a first mounting instruction sent by the first electronic device; the first mounting instruction includes the second communication port number; The second electronic device mounts the first file directory in the second virtual storage area in response to the first mount instruction, and sends a second mount instruction to the first electronic device; the second mount instruction includes the first communication port; The second electronic device receives the mounting completion information sent by the first electronic device, and recognizes that the file sharing link between the second electronic device and the first electronic device has been established.

11. The method according to claim 10, characterized in that After the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device in response to the connection operation initiated by the first electronic device through the near field communication module, the method further includes: The second electronic device sends a first acquisition instruction of the first file to the first electronic device in response to a first operation request on the first file in the first file directory; the first acquisition instruction includes first attribute information of the first file; The second electronic device receives the first file data about the first file fed back by the first electronic device based on the first acquisition instruction.

12. The method according to claim 10, characterized in that After the second electronic device establishes a wireless fidelity WIFI point-to-point file sharing link with the first electronic device in response to the connection operation initiated by the first electronic device through the near field communication module, the method further includes: The second electronic device receives a second acquisition instruction sent by the first electronic device; the second acquisition instruction is generated by the first electronic device in response to a second operation request on a second file in a second file directory; the second acquisition instruction includes second attribute information of the second file; The second electronic device obtains second file data of the second file based on the second attribute information, and sends the second file data to the first electronic device.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 7 to 9 is implemented.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 10 to 12 is implemented.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 7 to 9 and / or the method according to any one of claims 10 to 12 is implemented.

16. A file sharing system, characterized in that: The system comprises: the electronic device as claimed in claim 13 and the electronic device as claimed in claim 14.

Citation Information

Patent Citations

  • Media file sharing terminal, receiving terminal, transmission method and electronic equipment

    CN106507184A

  • Interaction method and device of mobile terminal and computer, electronic equipment and storage medium

    CN111511045A