CN113038627B - File sharing method, mobile device and computer storage medium - Google Patents

File sharing method, mobile device and computer storage medium Download PDF

Info

Publication number
CN113038627B
CN113038627B CN201911235538.XA CN201911235538A CN113038627B CN 113038627 B CN113038627 B CN 113038627B CN 201911235538 A CN201911235538 A CN 201911235538A CN 113038627 B CN113038627 B CN 113038627B
Authority
CN
China
Prior art keywords
mobile device
mobile
hotspot
connection
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911235538.XA
Other languages
Chinese (zh)
Other versions
CN113038627A (en
Inventor
刘超
董金光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201911235538.XA priority Critical patent/CN113038627B/en
Publication of CN113038627A publication Critical patent/CN113038627A/en
Application granted granted Critical
Publication of CN113038627B publication Critical patent/CN113038627B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/40Circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a file sharing method, mobile devices and a computer storage medium, wherein when two mobile devices need to share a file by using a sharing function, if a first mobile device starts a Wi-Fi hotspot and works in an AP (access point) mode, a second mobile device can access the started Wi-Fi hotspot of the first mobile device in an STA (the Wi-Fi hotspot is not started by the second mobile device) mode or an AP (the Wi-Fi hotspot is also started by the second mobile device). In the prior art, when the sharing function is used, two mobile devices are required to work in an STA mode to establish a peer-to-peer P2P connection, and when a Wi-Fi hotspot is opened, a user is required to manually close the Wi-Fi hotspot, so that a Wi-Fi module of the mobile device can be switched to the STA working mode. Compared with the prior art, the file sharing method can establish Wi-Fi connection with other mobile equipment under the condition that the Wi-Fi hotspot is not disconnected, a user does not need to manually close the Wi-Fi hotspot, and the use experience of the user is improved.

Description

File sharing method, mobile device and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of mobile equipment, in particular to a file sharing method, mobile equipment and a computer storage medium.
Background
The mobile device can communicate with other mobile devices through Wi-Fi, Bluetooth and the like, when the mobile device communicates with other mobile devices through Wi-Fi, the mobile device can serve as an Access Point (AP) and work in an AP mode to provide a signal source of a Wi-Fi network for other mobile devices, at the moment, the mobile device provides a Wi-Fi hotspot and can communicate with other mobile devices accessing the Wi-Fi hotspot, and a Wi-Fi module of the mobile device accessing the Wi-Fi hotspot works in a Station (STA) mode or a client (client) mode. Alternatively, the two mobile devices may be connected through a Peer-to-Peer (P2P) network, in which case the Wi-Fi modules of the two mobile devices operate in STA mode.
Generally, the STA mode and the AP mode of the Wi-Fi module are mutually exclusive, and if a mobile device needs to work in the STA mode and the AP mode simultaneously, it needs specific hardware and drive support, for example, the mobile device needs a Wireless Local Area Network (WLAN) chip with multiple independent hardware Access Control (MAC) layers, or, on the basis of drive support, physical channels are time-division multiplexed through hardware support. However, many current data transmission services require two mobile devices to establish a point-to-point connection shared file, such as a "space delivery" function of an IOS system and a shared file of an android system. For mobile equipment which cannot support simultaneous working in an STA mode and an AP mode, the services cannot be used when a Wi-Fi hotspot is started, a Wi-Fi hotspot network needs to be manually disconnected by a user, so that the connection between the mobile equipment and the equipment using the Wi-Fi hotspot network is interrupted, the Wi-Fi hotspot of the mobile equipment is manually started by the user after the service is used, and the experience of the user is poor when the service is used.
Disclosure of Invention
The embodiment of the application provides a file sharing method, mobile equipment and a computer storage medium, which can establish Wi-Fi connection with other mobile equipment under the condition of not disconnecting a Wi-Fi hotspot, so that a user does not need to close the Wi-Fi hotspot, and the use experience of the user is improved.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
a first aspect provides a file sharing method, including: the wireless fidelity Wi-Fi module of the first mobile device is turned on and provides a Wi-Fi hotspot for a third mobile device, the method comprising: the method comprises the steps that a first mobile device detects that a user starts a first operation of a sharing function; responding to the first operation, the first mobile equipment starts a short-distance wireless communication module; the first mobile equipment searches for the second mobile equipment by using the short-distance wireless communication module; the first mobile equipment detects a second operation that the user determines that the second mobile equipment is a target object using the sharing function; the method comprises the steps that the first mobile equipment sends Wi-Fi connection information to the second mobile equipment by using a short-distance wireless communication module, wherein the Wi-Fi connection information at least comprises the Wi-Fi hotspot opened by the first mobile equipment and the identity authentication information of the Wi-Fi hotspot connected with the first mobile equipment; the method comprises the steps that a first mobile device receives a Wi-Fi connection request of a second mobile device and identity authentication information sent by the second mobile device through a Wi-Fi module, wherein the Wi-Fi connection request of the second mobile device is used for requesting to access a Wi-Fi hotspot of the first mobile device in a station STA mode under the condition that the Wi-Fi hotspot of the second mobile device is not started, and the Wi-Fi connection request of the second mobile device is used for requesting to bridge the Wi-Fi hotspot of the first mobile device in an AP mode under the condition that the Wi-Fi hotspot of the second mobile device is started; the first mobile equipment verifies the identity authentication information sent by the second mobile equipment; after the first mobile device successfully verifies, establishing Wi-Fi connection with the second mobile device; the first mobile device shares the file with the second mobile device using a sharing function through a Wi-Fi connection.
The sharing function is a function that two mobile devices transmit Wi-Fi connection information through a short-range wireless communication module to establish Wi-Fi connection and then mutually transmit files by using the Wi-Fi connection, the sharing function can be a service provided by the mobile devices, and the shared files can be photos, documents, business cards, characters and the like. The sharing function requires the use of a Wi-Fi module and a short range wireless communication module (e.g., a near field communication NFC module, a bluetooth module, etc.) other than the Wi-Fi module, and thus, after detecting the first operation to enable the sharing function, the Wi-Fi module and the short range wireless communication module need to be turned on. In this embodiment, before the first operation is detected, the Wi-Fi module of the first mobile device is turned on, and the Wi-Fi hotspot is turned on, that is, the Wi-Fi module of the first mobile device operates in the AP mode. After a target object with a sharing function (namely, a target mobile device sharing a file) is confirmed to be a second mobile device, the short-range wireless communication module is used for informing the second mobile device that the first mobile device opens the Wi-Fi hotspot and identity authentication information of the Wi-Fi hotspot connected with the first mobile device, and further the second mobile device can access the hotspot opened by the first mobile device by using the identity authentication information, wherein under the condition that the Wi-Fi hotspot is not opened by the second mobile device, the Wi-Fi hotspot of the first mobile device is accessed by the second mobile device in a site STA mode, and under the condition that the Wi-Fi hotspot is also opened by the second mobile device, the Wi-Fi hotspot of the first mobile device is bridged by the second mobile device in an AP mode.
In one possible implementation, the third mobile device is in a second subnet established by the first mobile device, and after the first mobile device detects the second operation, the method further includes: the first mobile device allocates a network segment of a first subnet to a second mobile device, wherein the first subnet and the second subnet are isolated from each other. The first mobile device may configure whether the first subnet and the second subnet are isolated from each other. The established Wi-Fi connection and sharing function data transmission networks are isolated from each other by establishing the second subnet which is independent from the first subnet existing in the opened Wi-Fi hotspot, and the data transmission of the second mobile equipment and the third mobile equipment is isolated from each other, so that the data security is improved.
In one possible implementation, after the successful verification, the first mobile device establishes a Wi-Fi connection with the second mobile device, including: after the first mobile equipment is successfully verified, using a Dynamic Host Configuration Protocol (DHCP) service to allocate an Internet Protocol (IP) address belonging to a network segment of a first subnet to the second mobile equipment; and the first mobile equipment and the second mobile equipment establish Wi-Fi connection according to the allocated IP addresses, so that the second mobile equipment is in the first subnet.
In one possible implementation manner, after the first mobile device detects that the user enables the first operation of the sharing function, the method further includes: the method comprises the steps that a first mobile device detects whether a Wi-Fi hotspot is started or not; the first mobile equipment sets a first parameter according to the detection result, wherein the first parameter is used for indicating whether the first mobile equipment opens the Wi-Fi hotspot.
In one possible implementation manner, after the first mobile device and the second mobile device share the file, the first mobile device disconnects the Wi-Fi connection with the second mobile device.
In one possible implementation, a first mobile device searches for a second mobile device using a short-range wireless communication module, including: a first mobile device searches for other mobile devices enabling a short-range wireless communication module using a short-range wireless communication module; the first mobile device displays a search result list; the first mobile device detects a second operation used by the user to determine that the second mobile device is a target object using the sharing function, and the second operation comprises the following steps: the first mobile device detects a second operation of the user to select a second mobile device as a target object in the search result list.
In one possible implementation manner, the first operation is further configured to indicate a target file to be shared using a sharing function, and the sharing function is used by the first mobile device to share the file with the second mobile device through a Wi-Fi connection, including: the first mobile device sends the target file to the second mobile device through Wi-Fi connection by using a sharing function. For example, the first operation includes that the user clicks and selects a target file to be shared, and then selects to use a "sharing" function, that is, the first operation designates the target file to be shared and opens the "sharing function", and since the first mobile device has already opened the Wi-Fi module, after the first mobile device detects the first operation, the short-range wireless communication module is opened. After the short-range wireless communication module is started, the first mobile device searches a list of nearby devices by using the short-range wireless communication module and displays the list on a touch display screen of the first mobile device, the user executes a second operation, namely, selects a second mobile device from a search result list displayed on the touch display screen, and the first mobile device determines that the second mobile device selected by the user is a sharing object (file sending object) of the target file.
In one possible implementation manner, after the first mobile device detects the first operation and before the first mobile device searches for the second mobile device using the short-range wireless communication module, the first mobile device detects a third operation of the user specifying the target file, and the first mobile device shares the file with the second mobile device using a sharing function through a Wi-Fi connection, including: the first mobile device sends the target file to the second mobile device through Wi-Fi connection by using a sharing function. For example, the first operation is that the user lights up an icon of the "share function" in the pull-down function icon option, and since the first mobile device has already turned on the Wi-Fi module, the short-range wireless communication module is turned on after the first mobile device detects the first operation. After the user performs the first operation, a third operation may be performed to select one of the files in the first mobile device and select "share" to designate a target file to be shared. After detecting the third operation, the first mobile device searches a list of nearby devices using the short-range wireless communication module and displays the list on the display screen of the first mobile device, and then the user may perform the third operation to select the second mobile device in the displayed search result list to designate a sharing object (file transmission object) of the target file.
In one possible implementation, a first mobile device searches for a second mobile device using a short-range wireless communication module, including: the method comprises the steps that a first mobile device searches a sharing file request sent by a second mobile device by using a short-distance wireless communication module, wherein the sharing file request is used for requesting to share a target file by using a sharing function; the first mobile equipment displays a file sharing request, wherein the second operation is an operation that the user agrees to the file sharing request; the first mobile device shares a file with the second mobile device through a Wi-Fi connection using a sharing function, comprising: and the first mobile equipment receives the target file sent by the second mobile equipment by using a sharing function through Wi-Fi connection.
Optionally, the short-range wireless communication module in this embodiment may be a Near Field Communication (NFC) module, or a bluetooth module, or a Radio Frequency Identification (RFID) module, or an infrared module.
In a second aspect, an embodiment of the present application further provides a file sharing method, where a Wi-Fi module of a first mobile device is not turned on, a Wi-Fi module of a second mobile device is turned on, and a Wi-Fi hotspot is provided for a third mobile device, the method including: the method comprises the steps that a first mobile device detects that a user starts a first operation of a sharing function; responding to the first operation, the first mobile equipment starts the Wi-Fi module and the short-distance wireless communication module; the first mobile equipment searches for the second mobile equipment by using the short-distance wireless communication module; the first mobile equipment detects a second operation that the user determines that the second mobile equipment is a target object using the sharing function; the method comprises the steps that a first mobile device receives Wi-Fi connection information sent by a second mobile device through a short-distance wireless communication module, wherein the Wi-Fi connection information at least comprises identity authentication information of a Wi-Fi hotspot opened by the second mobile device and a Wi-Fi hotspot connected with the second mobile device; the method comprises the steps that a first mobile device sends a Wi-Fi connection request and identity authentication information of a Wi-Fi hotspot accessed to a second mobile device in a station STA mode to the second mobile device by using a Wi-Fi module; the method comprises the steps that a first mobile device and a second mobile device establish Wi-Fi connection; the first mobile device shares the file with the second mobile device using a sharing function through a Wi-Fi connection.
In a third aspect, an embodiment of the present application further provides a file sharing method, where a Wi-Fi module of a first mobile device is already turned on and provides a Wi-Fi hotspot for a third mobile device, and a Wi-Fi module of a second mobile device is already turned on and provides a Wi-Fi hotspot for a fourth mobile device, the method including: the method comprises the steps that a first mobile device detects that a user starts a first operation of a sharing function; responding to the first operation, the first mobile equipment starts a short-distance wireless communication module; the first mobile equipment searches for the second mobile equipment by using the short-distance wireless communication module; the first mobile equipment detects a second operation used by the user for determining that the second mobile equipment is a target object using the sharing function; the method comprises the steps that the first mobile equipment receives Wi-Fi connection information sent by the second mobile equipment by using a short-distance wireless communication module, wherein the Wi-Fi connection information at least comprises identity authentication information of a Wi-Fi hotspot opened by the second mobile equipment and connected with the second mobile equipment; the method comprises the steps that a first mobile device uses a Wi-Fi module to send a Wi-Fi connection request and identity authentication information which bridge Wi-Fi hotspots of a second mobile device in an access point AP mode to the second mobile device; the method comprises the steps that a first mobile device and a second mobile device establish Wi-Fi connection; the first mobile device shares the file with the second mobile device using a sharing function through a Wi-Fi connection.
In a fourth aspect, an embodiment of the present application provides a mobile device, including: a touchscreen, a short-range wireless communication module, a Wi-Fi module, one or more processors, one or more memories, and one or more computer programs; the processor is coupled with the touch screen, the communication module and the memory, the one or more computer programs are stored in the memory, and when the mobile device runs, the processor executes the one or more computer programs stored in the memory, so that the mobile device executes any one of the file sharing methods.
In a fifth aspect, an embodiment of the present application provides a computer storage medium, which includes computer instructions, and when the computer instructions are executed on a mobile device, the mobile device is caused to execute the file sharing method according to any one of the first aspect.
In a sixth aspect, an embodiment of the present application provides a computer program product, which when run on a mobile device, causes the mobile device to execute the file sharing method according to any one of the first aspect.
In any possible implementation scheme provided by any one of the above aspects, when two mobile devices need to share a file using a sharing function, if a first mobile device has already opened a Wi-Fi hotspot and operates in an AP mode of an access point, a second mobile device may access the Wi-Fi hotspot already opened by the first mobile device in an STA mode (the Wi-Fi hotspot is not opened by the second mobile device) or an AP mode (the Wi-Fi hotspot is also opened by the second mobile device). In the prior art, when the sharing function is used, two mobile devices are required to work in an STA mode to establish a peer-to-peer P2P connection, and when a Wi-Fi hotspot is opened, a user is required to manually close the Wi-Fi hotspot, so that a Wi-Fi module of the mobile device can be switched to the STA working mode. Compared with the prior art, the file sharing method provided by the embodiment of the application can establish Wi-Fi connection with other mobile equipment to share the file by using the sharing function without disconnecting the Wi-Fi hotspot, a user does not need to manually close the Wi-Fi hotspot, and the use experience of the user is improved.
It is understood that the mobile device, the computer storage medium, and the computer program product provided above are all configured to execute the corresponding method provided above, and therefore, the beneficial effects achieved by the mobile device, the computer storage medium, and the computer program product may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Drawings
Fig. 1 is a schematic view of an application scenario of a file sharing method according to an embodiment of the present application;
fig. 2 is a first interaction diagram of a file sharing method according to an embodiment of the present disclosure;
fig. 3 is a second interaction diagram of a file sharing method according to an embodiment of the present application;
fig. 4 is a third interaction diagram of a file sharing method according to an embodiment of the present application;
fig. 5 is a fourth interaction schematic diagram of a file sharing method according to an embodiment of the present application;
fig. 6 is a fifth interaction diagram of a file sharing method according to an embodiment of the present application;
fig. 7 is a schematic view of an application scenario of another file sharing method according to an embodiment of the present application;
fig. 8 is a schematic view of an application scenario of another file sharing method according to an embodiment of the present application;
fig. 9 is a first schematic structural diagram of a mobile device according to an embodiment of the present application;
fig. 10 is a schematic flowchart of a file sharing method according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a mobile device according to an embodiment of the present application.
Detailed Description
Embodiments of the present embodiment will be described in detail below with reference to the accompanying drawings.
The file sharing method provided by the embodiment of the application can be applied to mobile equipment, such as mobile phones, tablet computers, personal computers and other mobile equipment.
As shown in fig. 1, an application scenario of the file sharing method provided in the embodiment of the present application is described by taking a mobile phone as an example. In the application scenario shown in fig. 1, the mobile phone a101 operates in an AP (access point) mode, and provides a Wi-Fi (wireless fidelity) hotspot network for the computer 103, and the mobile phone a101 may convert a signal based on a mobile communication standard such as 3G, 4G, or 5G received by the mobile phone a101 into a Wi-Fi signal to send out by using the Wi-Fi hotspot network, and provide mobile data for the computer 103, so that the computer 103 may connect to the internet. Optionally, the mobile phone a101 may also access a wireless router, communicate with the internet via the wireless router, forward a signal received from the wireless router through a hot spot, and send data sent by a mobile device accessing the hot spot of the mobile phone a101 through the wireless router.
When the mobile phone a101 and the mobile phone B102 need to share data using the sharing function, for example, the mobile phone a101 shares a picture in the mobile phone a101 with the mobile phone B102, and the mobile phone a101 and the mobile phone B102 first need to open the "sharing" function. It should be understood that: the sharing function is used for one device to send document files, pictures, audio files, video files, installation files and the like to one or more other devices in a wireless communication mode. For example, the sharing function may be an air drop of the apple IOS system, a fast share of the google android system (fast share). Two examples of opening a "share" feature shared file in a handset are provided below:
(1) as shown in fig. 2, to open an example of the "share" function, the user performs the following operations to open the "share" function of the mobile phone: and clicking an icon corresponding to the sharing function displayed in a pull-down control panel of the mobile phone. After the mobile phone opens the sharing function, it starts its own short-range wireless communication module (such as a bluetooth module, an NFC module, an infrared module, and other wireless communication modules, which will be described below with reference to the bluetooth module as an example) and Wi-Fi module. It should be understood that turning on the Wi-Fi module is different from turning on the Wi-Fi connection function in the mobile phone, where the Wi-Fi connection function in the mobile phone is to access an Access Point (AP) in a STA (station) mode, and turning on the Wi-Fi module in this embodiment of the present application is to enable the Wi-Fi module.
After the mobile phone starts the sharing function, the mobile phone starts the Wi-Fi module and the Bluetooth module and starts the search function of the Bluetooth module to search for a device which starts the Bluetooth module in a nearby preset range (the radius distance of the preset range is limited by the performance of the Bluetooth module). If the user needs to share a file, such as a picture, the user can select the file to be shared, open an "option" function card of the file (as shown in fig. 3), select "share" the picture (as shown in fig. 4), further display the name of the device searched through the bluetooth module (as shown in fig. 5), and optionally, if only one device is searched, the user does not need to be displayed on an interface of a mobile phone to select the device, and the searched device is automatically selected by default.
Alternatively, in this example, the bluetooth module may not search immediately after being turned on, but search after the user performs the operations shown in fig. 3 and 4 with respect to the file to be transmitted.
(2) Optionally, for a mobile phone that needs to send data to an opposite end, a manner of opening a "sharing" function may also be as shown in fig. 3 and 4: the user selects a file to be shared, opens an "option" function card of the file (as shown in fig. 3), selects "share" the photo (as shown in fig. 4), and can also trigger the function of opening the share through the above operation performed by the user. After the sharing function is turned on in the manner shown in fig. 3 and 4, the mobile phone turns on the Wi-Fi module and the bluetooth module, and starts the search function of the bluetooth module to search for a device in a nearby preset range (the radius distance of the preset range is limited by the performance of the bluetooth module) to turn on the bluetooth module, and further displays the name of the device searched by the bluetooth module (as shown in fig. 5).
The above description is merely two exemplary descriptions, and the embodiment of the present application does not limit the specific operation manner of enabling the sharing function. In addition, the sharing function may specifically be an application installed in the mobile device, and may also be an extended service provided by an operating system of the mobile device, which is also not specifically limited in this embodiment of the present application.
In the scenario shown in fig. 1, if taking an example that the mobile phone a101 shares one picture in the mobile phone a101 with the mobile phone B102, after the mobile phone a101 starts the sharing function in the manner of the above example (2) and the mobile phone B102 starts the sharing function in the manner of the above example (1), both the mobile phone a101 and the mobile phone B102 start their own Wi-Fi module and bluetooth module. After the mobile phone a101 or the mobile phone B102 starts the Wi-Fi module, it may detect whether the Wi-Fi module itself has started the Wi-Fi hotspot, and in order to indicate the detection result, a parameter (a first parameter) may be set to indicate whether the Wi-Fi hotspot itself has started, for example, if the Wi-Fi hotspot itself has been detected to have started, the first parameter is set to 1 to indicate that the Wi-Fi hotspot itself has started, and if the Wi-Fi hotspot has not been detected to have not started, the first parameter is set to 0 to indicate that the Wi-Fi hotspot itself has not started.
After the bluetooth module is turned on by the mobile phone a101, the search function can be immediately activated to search for surrounding devices which turn on the bluetooth module, including the mobile phone B102. At this time, the user wants to send a picture to the mobile phone B102, the operations shown in fig. 3 to fig. 5 may be executed for the picture (see the above description for the specific operation steps), after the searched device for opening the bluetooth module is displayed as shown in fig. 5, the user may click and select "mobile phone B102" in the interface shown in fig. 5, further, the mobile phone B102 may receive a request for sharing a file sent by the bluetooth module sent by the mobile phone a101, where the request is used to request to send a file to the mobile phone B102 with a "sharing" function, for example, as shown in fig. 6, the prompt content of the request displayed on the interface of the mobile phone B102 may be a request for asking the user whether to accept the request that the mobile phone a101 sends "picture 1", and after the user selects "accept" on the mobile phone B102, the mobile phone a101 and the mobile phone B102 start to interact-Fi connection information through the bluetooth module.
The Wi-Fi connection information is data needed by the two ends to establish Wi-Fi connection. For example, the Wi-Fi connection information sent by the cell phone a101 to the cell phone B102 may include information that the cell phone a101 has opened a Wi-Fi hotspot, and identity authentication information required to access the cell phone a 101. Optionally, the mobile phone B102 may also notify the mobile phone a101 of the current working mode of its Wi-Fi module through the bluetooth module, for example, the mobile phone B102 sends the first parameter to the mobile phone a101 through the bluetooth module, so as to notify the mobile phone a101 of whether it is working in a Wi-Fi hotspot mode. For the application scenario shown in fig. 1, the mobile phone a101 has already started the Wi-Fi hotspot and operates in the AP mode, and the mobile phone a101 notifies the mobile phone B102 that the Wi-Fi hotspot has already been started by itself by sending the first parameter, and similarly, the mobile phone B102 also sends the first parameter value of itself to the mobile phone a 101. Because the mobile phone a101 has already opened the Wi-Fi hotspot and the mobile phone B102 has not opened the Wi-Fi hotspot, the mobile phone a101 still sets itself to work in the AP mode and remains unchanged, and the mobile phone B102 sets itself to work in the STA mode.
The mobile phone a101 needs to verify the authentication information for the mobile device accessing the Wi-Fi hotspot, and therefore, the Wi-Fi connection information sent by the mobile phone a101 to the mobile phone B102 further includes the authentication information, for example, the authentication information may be an authentication token, that is, the authentication token may be included in the bluetooth information of the mobile phone a101 interacting with the mobile phone B102 through the bluetooth module. Optionally, the Wi-Fi connection information may be transmitted once or multiple times, for example, the mobile phone a101 may transmit the first parameter to the mobile phone B102 first, and after the mobile phone B102 feeds back and confirms that the first parameter is received, the mobile phone a101 sends a token to the mobile phone B102. After the mobile phone B102 receives the token sent by the mobile phone a101 through the bluetooth module, the mobile phone B102 may access the Wi-Fi hotspot of the mobile phone a101 according to the token.
In order to isolate the subnet where the Wi-Fi connection between the mobile phone a101 and the mobile phone B102 is located from the subnet where the Wi-Fi connection between the mobile phone a101 and the computer 103 is located, an independent subnet is newly established for the mobile phone B102, and correspondingly, the Wi-Fi connection information interacted through the bluetooth module further includes a network segment of the isolated subnet divided by the mobile phone a101 for the mobile phone B102, and optionally, the Wi-Fi connection information may be transmitted once or many times. For example, handset a101 creates an independent subnet, and sends the network segment information (e.g., subnet mask) of the created subnet to handset B102. By establishing the isolation sub-network, the user group containing sensitive data can be isolated from the rest part of the network, so that the possibility of revealing confidential information is reduced, if the mobile phone B102 and the computer 103 are in the same sub-network, the data of the computer 103 can be checked by the mobile phone B102, and under the condition that the mobile phone B102 and the computer 103 are in different sub-networks which are isolated from each other, the data of the mobile phone B102 and the computer 103 are invisible from each other, so that the security of the data is improved.
After the mobile phone A101 and the mobile phone B102 interact Wi-Fi connection information through the Bluetooth module, the Wi-Fi connection is established based on the Wi-Fi connection information. In an application scenario shown in fig. 1, the mobile phone a101 and the mobile phone B102 determine a connection manner for establishing a Wi-Fi connection according to whether an opposite terminal and the mobile phone B102 start a Wi-Fi hotspot, the mobile phone a101 operates in an AP mode, the mobile phone B102 operates in an STA mode (or referred to as a Client mode), the mobile phone B102 accesses the Wi-Fi hotspot of the mobile phone a101 according to token, and after the mobile phone B102 accesses the Wi-Fi hotspot of the mobile phone a101, the mobile phone a101 allocates an IP address of a newly-built isolated subnet to the mobile phone B102, where a specific allocation manner may be an automatic allocation manner using a DHCP protocol. After the above-mentioned process, the handset a101 and the handset B102 have established the Wi-Fi connection, and the handset a101 and the handset B102 transmit data through the established Wi-Fi connection.
After the Wi-Fi connection is established between the mobile phone a101 and the mobile phone B102, the Wi-Fi connection may be used to share files with each other, where the files may be sent from the mobile phone a101 to the mobile phone B102, or from the mobile phone B102 to the mobile phone a 101. After the file is sent, the Wi-Fi connection can be disconnected, and when the file needs to be shared again, the file sharing method provided by the embodiment of the application is executed again.
In the application scenario shown in fig. 7, the mobile phone a101 operates in the AP mode to provide a Wi-Fi hotspot network for the computer 103, and the mobile phone B102 provides a Wi-Fi hotspot network for the computer 104. If the mobile phone a101 and the mobile phone B102 need to share data, the sharing function "share data" may be started with reference to a data sharing method in an application scenario as shown in fig. 1, and the first parameter is transmitted through the bluetooth module to know that the Wi-Fi hotspot is started at the opposite end, and since the mobile phone a101 and the mobile phone B102 both work in the AP mode, the mobile phone a101 and the mobile phone B102 may establish Wi-Fi connection to a bridge network. When the bridge network is established, an independent subnet is established by a party needing to use the sharing function to send data, and the newly established subnet is accessed by a party receiving the data. For example, if a photo needs to be shared with the mobile phone B102 by using the mobile phone a101, the mobile phone a101 creates an independent subnet, and sends the network segment information (e.g., subnet mask) of the subnet to the mobile phone B102.
The bridge connection established between the mobile phone a101 and the mobile phone B102 can be isolated (independent) from the existing subnet, taking the example that the mobile phone B102 accesses the bridge network of the mobile phone a101, the Wi-Fi connection between the mobile phone a101 and the computer 103 is in the subnet a, the mobile phone a101 creates an independent subnet B for the mobile phone B102, the network segment of the subnet B is sent to the mobile phone B102, and the mobile phone B102 bridges into the subnet B in an AP mode. Since the mobile phone B102 is accessed to the isolated subnet established by the mobile phone a101, the Wi-Fi connection between the mobile phone a101 and the computer 103 is not disconnected, and the Wi-Fi connection between the mobile phone B102 and the computer 104 is not disconnected.
The application scenario shown in fig. 7 is a scenario in which both the cell phone a101 and the cell phone B102 start a Wi-Fi hotspot, the cell phone a101 and the cell phone B102 may establish a Wi-Fi connection in a bridge connection manner, and both the two bridge-connected parties operate in an AP mode. The bridge connection established between the mobile phone a101 and the mobile phone B102 is in a subnet isolated (independent) from the existing subnet of the mobile phone where the bridge connection is established, taking the example that the mobile phone B102 accesses the bridge network of the mobile phone a101, if the Wi-Fi connection between the mobile phone a101 and the computer 103 is in the subnet a, the mobile phone a101 creates an independent subnet B and sends the network segment of the subnet B to the mobile phone B102, the mobile phone B102 bridges into the subnet B of the mobile phone a101 that also works in the AP mode, and after the mobile phone a101 and the mobile phone B102 establish the Wi-Fi connection in the bridge mode, the Wi-Fi connection between the mobile phone a101 and the computer 103 is not disconnected due to the connection established in the independent subnet.
In the application scenario shown in fig. 8, neither the cell phone a101 nor the cell phone B102 opens the Wi-Fi hotspot, and there is no device accessing the Wi-Fi hotspot. After the mobile phone a101 and the mobile phone B102 interact with Wi-Fi connection information through the bluetooth module, the mobile phone a101 and the mobile phone B102 may establish a connection using a connection mode of a Peer-to-Peer network (P2P), that is, a Wi-Fi Direct connection (Wi-Fi Direct), and both the mobile phone a101 and the mobile phone B102 operate in an STA mode.
For example, any one of the mobile devices described in the embodiments of the present application may be a communication device such as a mobile phone, a tablet computer, and a personal computer. Specifically, the mobile phone can be used.
As shown in fig. 9, the mobile phone 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 camera 193, a display screen 194, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention is not to be specifically limited to a mobile phone. In other embodiments of the present application, the handset may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (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. The different processing units may be separate devices or may be integrated into one or more processors.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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.
The charging management module 140 is configured to receive a 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 via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the cell phone. The charging management module 140 may also supply power to the mobile phone through the power management module 141 while charging the battery 142.
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 may receive input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like.
The power management module 141 may be configured to monitor performance parameters such as battery capacity, battery cycle count, battery charging voltage, battery discharging voltage, battery state of health (e.g., leakage, impedance), and the like. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.
The wireless communication function of the mobile phone can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to a mobile phone. The mobile communication module 150 may include one or more filters, switches, power amplifiers, Low Noise Amplifiers (LNAs), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to a mobile phone, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices that integrate one or more communication processing modules. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the handset antenna 1 is coupled to the mobile communication module 150 and the handset antenna 2 is coupled to the wireless communication module 160 so that the handset can communicate with the network and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The mobile phone realizes the display function through the GPU, the display screen 194, the application processor and the like. The GPU is a microprocessor for image processing, connected to 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 alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the cell phone may include 1 or N display screens 194, N being a positive integer greater than 1.
The mobile phone can realize shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. In some embodiments, the handset 100 may include 1 or N cameras, N being a positive integer greater than 1. The camera 193 may be a front camera or a rear camera.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the mobile phone selects the frequency point, the digital signal processor is used for performing fourier transform and the like on the frequency point energy.
Video codecs are used to compress or decompress digital video. The handset may support one or more video codecs. Thus, the mobile phone can play or record videos in various encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 can execute the above instructions stored in the internal memory 121, so as to enable the mobile phone to perform the method for intelligently recommending contacts, as well as various functional applications and data processing, etc. provided in some embodiments of the present application. The internal memory 121 may include a program storage area and a data storage area. Wherein, the storage program area can store an operating system; the storage area may also store one or more application programs (e.g., gallery, contacts, etc.), etc. The data storage area can store data (such as photos, contacts and the like) created during the use of the mobile phone 101 and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a nonvolatile memory, such as one or more magnetic disk storage devices, flash memory devices, Universal Flash Storage (UFS), and the like. In other embodiments, the processor 110 causes the handset to perform the methods provided in the embodiments of the present application, as well as various functional applications and data processing, by executing instructions stored in the internal memory 121, and/or instructions stored in a memory disposed in the processor.
The mobile phone can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The handset can listen to music through the speaker 170A or listen to a hands-free conversation.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the mobile phone receives a call or voice information, the receiver 170B can be close to the ear to receive voice.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The handset may be provided with one or more microphones 170C. In other embodiments, the mobile phone may be provided with two microphones 170C to achieve the noise reduction function in addition to collecting the sound signal. In other embodiments, the mobile phone may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
The headphone interface 170D is used to connect a wired headphone. The earphone interface 170D may be the USB interface 130, or may be an open mobile platform (OMTP) standard interface of 3.5mm, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like, which is not limited in this embodiment.
Of course, the mobile phone provided in the embodiment of the present application may further include one or more devices such as a key 190, a motor 191, an indicator 192, and a SIM card interface 195, which is not limited in this embodiment of the present application.
A file sharing method provided in an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
As shown in fig. 10, a file sharing method provided in an embodiment of the present application includes:
for a first mobile device side:
step 1, the first mobile device detects that a user opens the sharing function.
And 2, after the sharing function is opened, the first mobile equipment starts the Wi-Fi module and the Bluetooth module.
And 3, after the first mobile device starts the Wi-Fi module, detecting whether the first mobile device starts the Wi-Fi hotspot.
And 4, setting a first parameter for indicating whether the Wi-Fi hotspot is started or not according to the detection result. The first parameter is used for indicating whether the transmitting end opens the Wi-Fi hotspot. For example, the first parameter may be an identification bit flag in the transmitted data, and if the flag is 0, it indicates that the Wi-Fi hotspot is not turned on, and if the flag is 1, it indicates that the Wi-Fi hotspot is turned on.
And 5, searching nearby Bluetooth equipment after the Bluetooth module is started.
And 6, after the second mobile equipment is searched, performing Bluetooth handshake with the second mobile equipment to transfer the first parameters and other Wi-Fi connection information.
And 7, selecting a Wi-Fi connection mode according to the first parameter.
Step 8, if the Wi-Fi hotspot is not opened by the first mobile device and the second mobile device, establishing a P2P connection, wherein the first mobile device and the second mobile device both work in an STA mode; if the first mobile device and the second mobile device both open the Wi-Fi connection, establishing a bridge connection, and enabling the first mobile device and the second mobile device to work in an AP mode; if the first mobile device already opens the Wi-Fi hotspot and the second mobile device does not open the Wi-Fi hotspot, the second mobile device accesses the Wi-Fi hotspot of the first mobile device; if the Wi-Fi hotspot is opened by the second mobile device and not opened by the first mobile device, the first mobile device accesses the Wi-Fi hotspot of the second mobile device. When the bridge connection is established or the Wi-Fi hotspot is accessed, the connection can be established through the independent isolated sub-network.
And 9, establishing the Wi-Fi connection in a selected mode. After the connection is established, the two mobile devices may share data over the established Wi-Fi connection.
Correspondingly, the steps executed by the second mobile device side are similar to the steps executed by the first mobile device side, and are not described herein again.
The sharing function uses a Wi-Fi connection to transmit data with other mobile devices, for example, the sharing function may be a shared file (such as a photo, a document, a business card, a character, an audio file, a video file, etc.) service provided by the mobile device, and the file is transmitted between the two mobile devices through the Wi-Fi connection. In order to enable two mobile devices to share data, an embodiment of the application provides a method for establishing a connection, after a sharing function is started, whether a Wi-Fi hotspot is started or not is detected, a short-range wireless communication module (such as near field communication NFC, a bluetooth module and the like) outside a Wi-Fi module is used for negotiating with an opposite terminal to confirm enabling states of the Wi-Fi hotspots of the two mobile devices, if the Wi-Fi hotspot is started at one end, the two mobile devices can establish a network through the Wi-Fi hotspot provided at the end where the Wi-Fi hotspot is started, and if the Wi-Fi hotspot is started at both ends, the two mobile devices can establish a bridge network to avoid an operation of closing the Wi-Fi hotspot, so that user experience is improved.
The Wi-Fi connection information at least includes a first parameter, for example, the first parameter may be an identification bit flag in the transmission data, and if the flag is 0, it is determined that the Wi-Fi hotspot is not turned on, and if the flag is 1, it is determined that the Wi-Fi hotspot is turned on.
Optionally, the Wi-Fi connection information may further include an authentication key of the Wi-Fi connection. For example, the authentication key may be a token, which is provided to the other end by the end that has opened the Wi-Fi hotspot, and after the token is provided to the other end by the end that has opened the Wi-Fi hotspot using the short-range wireless communication module, the other end may access to the end that has opened the Wi-Fi hotspot using the token. Alternatively, the authentication key may be a pre-shared key PSK, or the like. The embodiments of the present application do not specifically limit this. In addition to the examples mentioned above, the Wi-Fi connection information can also include a media access control layer MAC address, a Wi-Fi connection key, and so on.
In order to make other devices (e.g., computers) accessing one end of the open Wi-Fi hotspot (e.g., a first mobile device) invisible to another mobile device (e.g., a second mobile device), a separate subnet may be used to separate the different devices accessing the first mobile device. In one possible implementation, after the first mobile device establishes a Wi-Fi connection with the second mobile device using the Wi-Fi hotspot, the first mobile device and the second mobile device are in a first subnet, wherein the first subnet is at least isolated from a second subnet, and the second subnet is a subnet in which the Wi-Fi connection established by the first mobile device with the third mobile device using the Wi-Fi hotspot is located. The two subnetworks isolated from each other may be implemented by establishing isolated subnetworks and/or by dividing virtual local area networks, VLANs. The isolation subnet is established by setting network segments of a plurality of subnets by using one Wi-Fi module. The VLAN is divided, actual subnets are not established, and the mutual isolation and shielding of devices of different subnets are realized in a mode of establishing virtual subnets. VLAN is a logical subnet built on a physical network to enhance security of the lan, and user groups containing sensitive data can be isolated from the rest of the network to reduce the possibility of revealing confidential information.
In one possible implementation, in a case where the first mobile device turns on a Wi-Fi hotspot and the second mobile device does not turn on the Wi-Fi hotspot, after the first mobile device establishes a Wi-Fi connection with the second mobile device using the Wi-Fi hotspot, the method further includes: the first mobile equipment divides the network segment of the first subnet; and the first mobile equipment allocates the IP address belonging to the first subnet to the second mobile equipment according to the division result. That is, under the condition that the first mobile device starts the Wi-Fi hotspot and the second mobile device does not start the Wi-Fi hotspot, the first mobile device may establish a newly added subnet for the second mobile device after the second mobile device accesses the Wi-Fi hotspot of the first mobile device, divide a network segment of the subnet, and allocate an IP address belonging to the network segment of the newly added subnet to the second mobile device. For example, the network segment of the isolated subnet allocated and set by the first mobile device to the second mobile device is 192.168.2.X, or the network segment of the VLAN network allocated and set by the first mobile device to the second mobile device is 10.0.0.X, and the network segment allocated by the first mobile device to the second mobile device is isolated from the first mobile device and the third mobile device (for example, the computer in fig. 1). Optionally, the first mobile device allocates an IP address to the second mobile device using a dynamic host configuration protocol, DHCP, service.
In one possible implementation, in a case that the second mobile device opens the Wi-Fi hotspot, and the first mobile device does not open the Wi-Fi hotspot, after the first mobile device establishes a Wi-Fi connection with the second mobile device using the Wi-Fi hotspot, the method further includes: the first mobile device controls other components in the first mobile device (e.g., other services that may be an operating system or other applications installed in the mobile device) other than the shared functionality to disable the Wi-Fi connection. By limiting the use of Wi-Fi connection for other components in the second mobile device, the file in the first mobile device is made invisible to other components in the second mobile device, improving the security of data in the first mobile device.
In one possible implementation, in a case where the first mobile device and the second mobile device both have opened the Wi-Fi hotspot, after the first mobile device or the second mobile device closes the Wi-Fi hotspot, the first mobile device establishes a Wi-Fi connection with the second mobile device using the Wi-Fi hotspot that still exists. For example, a user of a first mobile device may close a Wi-Fi hotspot, and interact with a second mobile device after closing the Wi-Fi hotspot to mutually confirm whether an opposite terminal enables the Wi-Fi hotspot, and since only the second mobile device opens the Wi-Fi hotspot at this time, the first mobile device may access the Wi-Fi hotspot of the second mobile device to establish a Wi-Fi connection.
Optionally, the short-range wireless communication module may be a near field communication NFC module or a bluetooth module. Alternatively, the short-range wireless communication module may be a Radio Frequency IDentification (RFID) module, an infrared module, or the like.
According to the file sharing method, the drive layer does not need to be modified, the working state of WIFI is controlled and monitored in a unified mode on the service layer, the two ends negotiate the Wi-Fi connection mode through other communication technologies except Wi-Fi, connection is established, the Wi-Fi hotspot does not need to be closed by a user in the opening state of the Wi-Fi hotspot, the Wi-Fi hotspot does not flow out, complex network control and protocol switching on the drive layer are not needed, system complexity and operation convenience are reduced, and the problems of user interaction inconsistency and inconvenience of multiple switching are solved.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and other operations or variations of various operations may be performed by the embodiments of the present application. Further, the various steps may be performed in a different order presented in the above-described embodiments, and it is possible that not all of the operations in the above-described embodiments are performed.
As shown in fig. 11, an embodiment of the present application discloses a mobile device, including: a touch screen 901, the touch screen 901 comprising a touch sensor 906 and a display 907; one or more processors 902; a memory 903; a Wi-Fi communication module 908; a first type of communication module 909, and one or more computer programs 904. The various devices described above may be connected by one or more communication buses 905. Wherein the one or more computer programs 904 are stored in the memory 903 and configured to be executed by the one or more processors 902, the one or more computer programs 904 comprising instructions that can be used to perform the steps performed by the mobile device in the embodiments described above.
For example, the processor 902 may specifically be the processor 110 shown in fig. 9, the memory 903 may specifically be the internal memory 121 shown in fig. 9, the display 907 may specifically be the display 194 shown in fig. 9, the communication module 908 may specifically be the mobile communication module 150 and/or the wireless communication module 160 shown in fig. 9, and the touch sensor 906 may specifically be a touch sensor in the sensor module 180 shown in fig. 9, which is not limited in this embodiment of the present invention.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (23)

1. A file sharing method is characterized in that a wireless fidelity (Wi-Fi) module of a first mobile device is started and provides a Wi-Fi hotspot for a third mobile device, and the method comprises the following steps:
the first mobile equipment detects that a user starts a first operation of a sharing function;
in response to the first operation, the first mobile device turns on a short-range wireless communication module;
the first mobile device searches for a second mobile device by using the short-range wireless communication module;
the first mobile device detects a second operation of the user for determining that the second mobile device is a target object using the sharing function;
the first mobile device sends Wi-Fi connection information to the second mobile device by using the short-range wireless communication module, wherein the Wi-Fi connection information at least comprises the Wi-Fi hotspot opened by the first mobile device and identity authentication information of the Wi-Fi hotspot connected with the first mobile device;
the first mobile device receives a Wi-Fi connection request of the second mobile device and the identity authentication information sent by the second mobile device by using the Wi-Fi module, wherein the Wi-Fi connection request of the second mobile device is used for requesting to access the Wi-Fi hotspot of the first mobile device in a site STA mode under the condition that the Wi-Fi hotspot of the second mobile device is not started, and the Wi-Fi connection request of the second mobile device is used for requesting to bridge the Wi-Fi hotspot of the first mobile device in an AP mode under the condition that the Wi-Fi hotspot of the second mobile device is started;
the first mobile equipment verifies the identity authentication information sent by the second mobile equipment;
the first mobile equipment establishes Wi-Fi connection with the second mobile equipment after successful verification;
the first mobile device shares a file with the second mobile device using the sharing function through the Wi-Fi connection.
2. The method of claim 1, wherein the third mobile device is in a second subnet established by the first mobile device, and wherein after the first mobile device detects the second operation, the method further comprises:
and the first mobile equipment allocates a network segment of a first subnet to the second mobile equipment, wherein the first subnet and the second subnet are isolated from each other.
3. The method of claim 2, wherein the first mobile device establishing a Wi-Fi connection with the second mobile device after successful authentication comprises:
after the first mobile equipment is successfully verified, using a Dynamic Host Configuration Protocol (DHCP) service to allocate an Internet Protocol (IP) address belonging to the network segment of the first subnet to the second mobile equipment;
the first mobile device and the second mobile device establish the Wi-Fi connection according to the allocated IP addresses, so that the second mobile device is in the first subnet.
4. The method of any of claims 1-3, wherein after the first mobile device detects a first operation of a user to enable a sharing function, the method further comprises:
the first mobile device detects whether the Wi-Fi hotspot is started or not;
the first mobile equipment sets a first parameter according to a detection result, wherein the first parameter is used for indicating whether the first mobile equipment opens the Wi-Fi hotspot.
5. The method of any of claims 1-3, wherein the first mobile device disconnects the Wi-Fi connection with the second mobile device after the first mobile device and the second mobile device have shared a file.
6. The method of claim 4, wherein the first mobile device disconnects the Wi-Fi connection with the second mobile device after the first mobile device and the second mobile device share a file.
7. The method according to any one of claims 1 to 3,
the first mobile device searching for the second mobile device using the short-range wireless communication module, comprising: the first mobile device searching for other mobile devices that enable the short-range wireless communication module using the short-range wireless communication module; the first mobile device displays a search result list;
the first mobile device detects a second operation used by the user to determine that the second mobile device is a target object using the sharing function, and the second operation comprises the following steps: the first mobile device detects the second operation of the user selecting the second mobile device as the target object in the search result list.
8. The method of claim 4,
the first mobile device searches the second mobile device by using the short-range wireless communication module, and the method comprises the following steps: the first mobile device searching for other mobile devices that enable the short-range wireless communication module using the short-range wireless communication module; the first mobile device displays a search result list;
the first mobile device detects a second operation used by the user to determine that the second mobile device is a target object using the sharing function, and the second operation comprises: the first mobile device detects the second operation of the user selecting the second mobile device as the target object in the search result list.
9. The method of claim 5,
the first mobile device searching for the second mobile device using the short-range wireless communication module, comprising: the first mobile device searching for other mobile devices that enable the short-range wireless communication module using the short-range wireless communication module; the first mobile device displays a search result list;
the first mobile device detects a second operation used by the user to determine that the second mobile device is a target object using the sharing function, and the second operation comprises: the first mobile device detects the second operation of the user selecting the second mobile device as the target object in the search result list.
10. The method of claim 7, wherein the first operation is further configured to indicate a target file to be shared using the sharing function,
the first mobile device sharing files with the second mobile device through the Wi-Fi connection using the sharing function, including:
and the first mobile equipment uses the sharing function to send the target file to the second mobile equipment through the Wi-Fi connection.
11. The method of claim 7, wherein after the first mobile device detects the first operation, the first mobile device detects a third operation of a user specifying a target file before the first mobile device searches for the second mobile device using the short-range wireless communication module, and wherein the first mobile device shares a file with the second mobile device using the sharing function through the Wi-Fi connection, comprising:
and the first mobile equipment uses the sharing function to send the target file to the second mobile equipment through the Wi-Fi connection.
12. The method according to any one of claims 1 to 3,
the first mobile device searching for the second mobile device using the short-range wireless communication module, comprising: the first mobile device searches for a sharing file request sent by the second mobile device by using the short-distance wireless communication module, wherein the sharing file request is used for requesting to share a target file by using the sharing function; the first mobile equipment displays the file sharing request, wherein the second operation is an operation that a user approves the file sharing request;
the first mobile device sharing files with the second mobile device through the Wi-Fi connection using the sharing function, including: and the first mobile equipment receives the target file sent by the second mobile equipment by using the sharing function through the Wi-Fi connection.
13. The method of claim 4,
the first mobile device searching for the second mobile device using the short-range wireless communication module, comprising: the first mobile device searches for a sharing file request sent by the second mobile device by using the short-distance wireless communication module, wherein the sharing file request is used for requesting to share a target file by using the sharing function; the first mobile device displays the shared file request, wherein the second operation is an operation that a user agrees to the shared file request;
the first mobile device sharing files with the second mobile device through the Wi-Fi connection using the sharing function, including: and the first mobile equipment receives the target file sent by the second mobile equipment by using the sharing function through the Wi-Fi connection.
14. The method of claim 5,
the first mobile device searching for the second mobile device using the short-range wireless communication module, comprising: the first mobile device searches for a sharing file request sent by the second mobile device by using the short-distance wireless communication module, wherein the sharing file request is used for requesting to share a target file by using the sharing function; the first mobile equipment displays the file sharing request, wherein the second operation is an operation that a user approves the file sharing request;
the first mobile device sharing files with the second mobile device through the Wi-Fi connection using the sharing function, including: and the first mobile equipment receives the target file sent by the second mobile equipment by using the sharing function through the Wi-Fi connection.
15. The method of any of claims 1-3, 6, 8-11, 13-14, wherein the short-range wireless communication module comprises a bluetooth module, an NFC module, or an infrared module.
16. The method of claim 4, wherein the short-range wireless communication module comprises a Bluetooth module, an NFC module, or an infrared module.
17. The method of claim 5, wherein the short-range wireless communication module comprises a Bluetooth module, an NFC module, or an infrared module.
18. The method of claim 7, wherein the short-range wireless communication module comprises a Bluetooth module, an NFC module, or an infrared module.
19. The method of claim 12, wherein the short-range wireless communication module comprises a bluetooth module, an NFC module, or an infrared module.
20. A method of file sharing, wherein a wireless fidelity, Wi-Fi, module of a first mobile device is not turned on, the Wi-Fi module of a second mobile device is turned on and provides a Wi-Fi hotspot for a third mobile device, the method comprising:
the first mobile equipment detects that a user starts a first operation of a sharing function;
in response to the first operation, the first mobile device turns on the Wi-Fi module and a short-range wireless communication module;
the first mobile device searches for the second mobile device using the short-range wireless communication module;
the first mobile device detects a second operation of the user for determining that the second mobile device is a target object using the sharing function;
the first mobile equipment uses the short-distance wireless communication module to receive Wi-Fi connection information sent by the second mobile equipment, wherein the Wi-Fi connection information at least comprises identity authentication information of a Wi-Fi hotspot opened by the second mobile equipment and a Wi-Fi hotspot connected with the second mobile equipment;
the first mobile equipment uses the Wi-Fi module to send a Wi-Fi connection request and the identity authentication information of a Wi-Fi hotspot accessed to the second mobile equipment in a Station (STA) mode to the second mobile equipment;
the first mobile device establishes a Wi-Fi connection with the second mobile device;
the first mobile device shares a file with the second mobile device using the sharing function through the Wi-Fi connection.
21. A file sharing method, wherein a Wi-Fi module of a first mobile device is turned on and provides a Wi-Fi hotspot for a third mobile device, and a Wi-Fi module of a second mobile device is turned on and provides a Wi-Fi hotspot for a fourth mobile device, the method comprising:
the first mobile equipment detects that a user starts a first operation of a sharing function;
in response to the first operation, the first mobile device turns on a short-range wireless communication module;
the first mobile device searches for the second mobile device using the short-range wireless communication module;
the first mobile device detects a second operation used by the user to determine that the second mobile device is a target object using the sharing function;
the first mobile device receives Wi-Fi connection information sent by the second mobile device by using the short-range wireless communication module, wherein the Wi-Fi connection information at least comprises identity authentication information of a Wi-Fi hotspot opened by the second mobile device and connected with the second mobile device;
the first mobile device sends a Wi-Fi connection request and the identity authentication information which are bridged with a Wi-Fi hotspot of the second mobile device in an AP mode to the second mobile device by using the Wi-Fi module;
the first mobile device establishes a Wi-Fi connection with the second mobile device;
the first mobile device shares a file with the second mobile device using the sharing function through the Wi-Fi connection.
22. A mobile device, characterized in that the mobile device comprises:
a short-range wireless communication module;
a Wi-Fi module;
one or more processors;
one or more memories;
and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs comprising instructions that, when executed by the mobile device, cause the mobile device to perform the file sharing method of any of claims 1-21.
23. A computer storage medium comprising computer instructions that, when executed on a mobile device, cause the mobile device to perform the file sharing method of any of claims 1-21.
CN201911235538.XA 2019-12-05 2019-12-05 File sharing method, mobile device and computer storage medium Active CN113038627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911235538.XA CN113038627B (en) 2019-12-05 2019-12-05 File sharing method, mobile device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911235538.XA CN113038627B (en) 2019-12-05 2019-12-05 File sharing method, mobile device and computer storage medium

Publications (2)

Publication Number Publication Date
CN113038627A CN113038627A (en) 2021-06-25
CN113038627B true CN113038627B (en) 2022-09-16

Family

ID=76450731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911235538.XA Active CN113038627B (en) 2019-12-05 2019-12-05 File sharing method, mobile device and computer storage medium

Country Status (1)

Country Link
CN (1) CN113038627B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765682B (en) * 2021-09-13 2024-05-24 三星电子(中国)研发中心 Method and system for performing group functions
CN113873447A (en) * 2021-09-26 2021-12-31 展讯通信(天津)有限公司 Fast transmission method and device, electronic equipment and storage medium
CN115022849B (en) * 2021-10-29 2023-04-14 荣耀终端有限公司 Data transmission method based on Wi-Fi P2P and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107466055A (en) * 2016-06-06 2017-12-12 美的集团股份有限公司 Household electrical appliance match somebody with somebody network method, mobile terminal and household electrical appliance
CN107801185A (en) * 2016-09-05 2018-03-13 中兴通讯股份有限公司 A kind of quick method and apparatus for sharing focus
CN108601063A (en) * 2018-03-09 2018-09-28 广东欧珀移动通信有限公司 Personal hot spot implementation method and Related product
WO2019223441A1 (en) * 2018-05-24 2019-11-28 奇酷互联网络科技(深圳)有限公司 File sharing method, apparatus, readable storage medium, and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107466055A (en) * 2016-06-06 2017-12-12 美的集团股份有限公司 Household electrical appliance match somebody with somebody network method, mobile terminal and household electrical appliance
CN107801185A (en) * 2016-09-05 2018-03-13 中兴通讯股份有限公司 A kind of quick method and apparatus for sharing focus
CN108601063A (en) * 2018-03-09 2018-09-28 广东欧珀移动通信有限公司 Personal hot spot implementation method and Related product
WO2019223441A1 (en) * 2018-05-24 2019-11-28 奇酷互联网络科技(深圳)有限公司 File sharing method, apparatus, readable storage medium, and mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Wi-Fi无处不在 无线局域网在手机中的应用;葛月;《数字通信》;20080715(第14期);96-99 *

Also Published As

Publication number Publication date
CN113038627A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN110519131B (en) Method for controlling equipment and terminal
CN110320811B (en) Access method of intelligent household equipment and electronic equipment
JP7378576B2 (en) Terminal device, method and system for implementing one-touch screen projection using remote control device
US20220039179A1 (en) Bluetooth Connection Method and Device
WO2021052178A1 (en) Wi-fi connection method and device
CN111373713B (en) Message transmission method and device
CN111010693B (en) Method for providing wireless fidelity network access service and electronic equipment
CN113038627B (en) File sharing method, mobile device and computer storage medium
WO2022068513A1 (en) Wireless communication method and terminal device
CN114499587B (en) Audio synchronization communication method, system, wireless earphone, terminal and storage medium
WO2021104448A1 (en) Method for synchronizing key information, system and device
CN112469011A (en) Bluetooth pairing method and related device
CN114697929A (en) Connection establishing method and electronic equipment
EP4102927A1 (en) Dual wifi connection method and electronic device
CN113365274B (en) Network access method and electronic equipment
US20240022469A1 (en) Method for determining edge configuration server and apparatus
CN113676902B (en) System, method and electronic equipment for providing wireless internet surfing
CN112399628B (en) Random access method, electronic equipment and network equipment
CN114827687A (en) Communication method, mobile device, electronic device, and computer-readable storage medium
CN114980238B (en) Wi-Fi access method and related equipment
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
US20230337147A1 (en) Device Configuration Method and Device
WO2023124258A1 (en) Method and apparatus for remotely accessing subscriber identity module (sim) card
CN117098253A (en) Networking method and device
CN118175555A (en) Cellular communication method, one-key login method and communication equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant