CN115696284A - File sharing method, device, equipment and storage medium - Google Patents

File sharing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115696284A
CN115696284A CN202110865947.9A CN202110865947A CN115696284A CN 115696284 A CN115696284 A CN 115696284A CN 202110865947 A CN202110865947 A CN 202110865947A CN 115696284 A CN115696284 A CN 115696284A
Authority
CN
China
Prior art keywords
information
file sharing
network
equipment
wireless connection
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.)
Pending
Application number
CN202110865947.9A
Other languages
Chinese (zh)
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110865947.9A priority Critical patent/CN115696284A/en
Publication of CN115696284A publication Critical patent/CN115696284A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The disclosure relates to a file sharing method, a device, equipment and a storage medium, wherein the file sharing method comprises the following steps: establishing a first wireless connection with a second device; receiving file sharing request information sent by second equipment based on first wireless connection under the condition that the first equipment and the second equipment are in the same local area network; and based on the file sharing request information, the second device is hung on the first device so as to share the files of the second device through the local area network. The file sharing method is wider in application range, and based on the local area network file sharing, the file sharing speed is higher, the efficiency is higher, and the use experience of a user is better.

Description

File sharing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a file sharing method, apparatus, device, and storage medium.
Background
With the popularization of smart devices, the demand of cross-device file sharing often appears among different devices (such as televisions, tablet computers, mobile phones, and the like), but due to the different characteristics of each device, the file sharing modes among different devices are different, so that the file sharing is limited.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a file sharing method, apparatus, device, and storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a file sharing method applied to a first device, the method including:
establishing a first wireless connection with a second device;
under the condition that the first device and the second device are determined to be in the same local area network, receiving file sharing request information sent by the second device based on the first wireless connection;
and based on the file sharing request information, the second device is hung on the first device so as to share the file of the second device through the local area network.
Optionally, before determining that the first device and the second device are in the same local area network, the method further includes:
transmitting authentication information to the second device based on the first wireless connection;
receiving verification success information sent by the second device, the verification success information being generated by the second device in response to the verification information matching target information of the second device.
Optionally, the verification information includes user information of the first device, and the target information includes user information of the second device.
Optionally, after the second device is suspended from the first device, the method further comprises:
determining that the local area network is abnormal, or receiving first control information for unloading the second device;
the second device is de-loaded from the first device.
Optionally, after the un-loading the second device from the first device, the method further comprises;
and sending second control information to the second equipment based on the first wireless connection so as to enable the second equipment to close the file sharing function.
Optionally, the determining that the first device and the second device are in the same local area network includes at least one of:
determining that the first device and the second device are connected to the same wireless network;
determining a network hotspot at which the first device connects to the second device;
determining a network hotspot at which the second device connects to the first device.
Optionally, the determining that the first device and the second device are connected to the same wireless network includes at least one of:
determining, based on the first wireless connection, that the first device and the second device are currently connected to the same active wireless network;
if the first equipment and the second equipment are determined to be connected to different effective wireless networks currently based on the first wireless connection, receiving network information of the effective wireless network to which the second equipment is connected currently, and enabling the first equipment to be connected to the effective wireless network to which the second equipment is connected currently based on the network information;
if the first equipment is determined to be currently connected to the effective wireless network based on the first wireless connection and the second equipment cannot be currently connected to the effective wireless network, sending network information of the effective wireless network currently connected with the first equipment to the second equipment so that the second equipment is connected to the effective wireless network currently connected with the first equipment.
Optionally, the determining a network hotspot where the first device is connected to the second device includes:
and receiving hotspot information of the network hotspot of the second equipment so as to enable the first equipment to be connected to the network hotspot.
Optionally, the determining a network hotspot at which the second device is connected to the first device includes:
and opening a network hotspot of the first device, and sending hotspot information of the network hotspot to the second device so as to enable the second device to be connected to the network hotspot.
Optionally, the file sharing request information includes at least one of: an internet protocol address of the second device, a shared password of the second device, and an identification of the second device.
According to a second aspect of the embodiments of the present disclosure, there is provided a file sharing method applied to a second device, the method including:
establishing a first wireless connection with a first device;
generating file sharing request information;
and under the condition that the second device and the first device are in the same local area network, sending the file sharing request information to the first device based on the first wireless connection, wherein the file sharing request information is used for loading the second device on the first device so as to share files of the second device to the first device through the local area network.
Optionally, before determining that the first device and the second device are in the same local area network, the method further includes:
receiving verification information sent by the first device based on the first wireless connection;
and if the verification information is determined to be matched with the target information of the second equipment, generating verification success information, and sending the verification success information to the first equipment based on the first wireless connection.
Optionally, after the loading the second device on the first device, the method further comprises:
determining that the local area network is abnormal, or receiving third control information for canceling the second device from being hung on the first device;
sending, to the first device, first control information for offloading the second device, the first device, in response to receiving the first control information, un-loading the second device from the first device.
Optionally, after sending the first control information for offloading the second device to the first device, the method further includes;
receiving second control information sent by the first equipment based on the first wireless connection;
and controlling to close the file sharing function of the second equipment based on the second control information.
According to a third aspect of the embodiments of the present disclosure, there is provided a file sharing apparatus applied to a first device, the apparatus including:
the first connection module is used for establishing a first wireless connection with the second equipment;
a first receiving module, configured to receive, based on the first wireless connection, file sharing request information sent by the second device when it is determined that the first device and the second device are in the same local area network;
and the first sharing module is used for loading the second equipment to the first equipment based on the file sharing request information so as to share the file of the second equipment through the local area network.
Optionally, the apparatus further comprises a first sending module, wherein,
the first sending module is configured to send verification information to the second device based on the first wireless connection;
the first receiving module is further configured to receive verification success information sent by the second device, where the verification success information is generated by the second device in response to the verification information being matched with target information of the second device.
Optionally, the first receiving module is further configured to receive first control information for offloading the second device; or, the apparatus further includes a first determining module, where the first determining module is configured to determine that the local area network is abnormal;
the first sharing module is further configured to un-load the second device from the first device.
Optionally, the apparatus further comprises:
and the first sending module is used for sending second control information to the second equipment based on the first wireless connection so as to enable the second equipment to close the file sharing function.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a file sharing apparatus applied to a second device, the apparatus including:
the second connection module is used for establishing first wireless connection with the first equipment;
the second sharing module is used for generating file sharing request information;
a second sending module, configured to send, based on the first wireless connection, the file sharing request information to the first device when it is determined that the second device and the first device are in a same local area network, where the file sharing request information is used to suspend the second device on the first device, so as to share a file of the second device to the first device through the local area network.
Optionally, the apparatus further comprises a second receiving module, wherein,
the second receiving module is configured to receive, based on the first wireless connection, verification information sent by the first device;
the second sending module is further configured to generate verification success information if it is determined that the verification information matches the target information of the second device, and send the verification success information to the first device based on the first wireless connection.
Optionally, the second receiving module is further configured to receive third control information for unhooking the second device from the first device; or, the apparatus further includes a second determining module, where the second determining module is configured to determine that the local area network is abnormal;
the second sending module is further configured to send, to the first device, first control information for offloading the second device, where the first device unloads the second device from the first device in response to receiving the first control information.
Optionally, the second receiving module is further configured to receive, based on the first wireless connection, second control information sent by the first device;
the second sharing module is further configured to control to close the file sharing function of the second device based on the second control information.
According to a fifth aspect of embodiments of the present disclosure, there is provided an apparatus, further comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the file sharing method according to the first aspect and/or the second aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, wherein instructions, when executed by a processor of a device, enable the device to perform the file sharing method according to the first and/or second aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: in the method, a first wireless connection (for example, a bluetooth connection) is established between a first device and a second device, the first device and the second device are determined to be in the same local area network through the first wireless connection, and then a file of the second device is shared through the local area network, so that the first device and the second device establish file sharing.
For example, when the first wireless connection is a bluetooth connection, most of the devices have a bluetooth function and a wireless connection function, so the file sharing method has a wider application range, and is based on local area network file sharing, higher in sharing speed, higher in efficiency, and better in user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a partial flowchart illustrating a file sharing method applied between a first device and a second device according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a file sharing method applied to a first device according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a file sharing method applied to a second device according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating a file sharing apparatus applied to a first device according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating a file sharing apparatus applied to a second device according to an exemplary embodiment.
FIG. 6 is a block diagram of an apparatus shown in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In the related art, file sharing is generally implemented by using an FTP (File Transfer Protocol) method, but there are fewer devices supporting the FTP, and the efficiency of File sharing based on the FTP is relatively low, which results in a relatively low sharing speed, and when a File to be shared is relatively large, the experience is very poor. Secondly, the synchronization of the FTP is poor, when a user needs to modify a file across devices, the file to be modified needs to be stored in the current device, and the modified file needs to be shared with another device after the modification is completed, so that the operation process is complicated, and the user experience is poor.
The disclosure provides a file sharing method applied to a first device. In the method, a first wireless connection (for example, a bluetooth connection) is established between a first device and a second device, the first device and the second device are determined to be in the same local area network through the first wireless connection, and then a file of the second device is shared through the local area network, so that the first device and the second device establish file sharing.
For example, when the first wireless connection is a bluetooth connection, most devices have a bluetooth function and a wireless connection function, so the file sharing method has a wider application range, and is higher in sharing speed and efficiency and better in user experience due to file sharing based on a local area network.
In one exemplary embodiment, a file sharing method is provided and applied to a first device. Referring to fig. 1 and 3, the method includes:
s110, establishing a first wireless connection with second equipment;
s120, receiving file sharing request information sent by second equipment based on first wireless connection under the condition that the first equipment and the second equipment are in the same local area network;
and S130, based on the file sharing request information, hanging the second device on the first device so as to share the file of the second device through the local area network.
In step S110, the first wireless connection may include a bluetooth connection, and the bluetooth connection may be a classic bluetooth connection or a Bluetooth Low Energy (BLE) connection.
For example, the first wireless connection is a bluetooth low energy connection, in this step, after the first device starts the bluetooth low energy function, the first device sends a corresponding broadcast, the second device receives the broadcast and determines that the bluetooth low energy connection is established with the first device, the first device receives feedback information that the second device has determined that the connection is established, and the first device can establish the bluetooth low energy connection with the second device, so as to implement bluetooth communication between the first device and the second device.
The low power consumption Bluetooth is a personal area network technology designed and sold by the Bluetooth technical alliance; bluetooth low energy is intended to significantly reduce power consumption and cost while maintaining equivalent communication range compared to classical bluetooth.
It should be noted that the types of the first device and the second device may be the same or different. For example, the first device and the second device may both be cell phones. For another example, the first device is a computer and the second device is a mobile phone.
In step S120, it may be determined whether the first device and the second device are in the same local area network based on the first wireless connection, and if the first device and the second device are not in the same local area network, the first device and the second device may also be in the same local area network through the first wireless connection.
After determining that the first device and the second device are in the same local area network, the second device may send file sharing request information to the first device based on the first wireless connection, where the file sharing request information may include, for example, an internet protocol address of the second device, a sharing password of the second device, an identifier of the second device, and the like. The first device may receive the file sharing request message based on the first wireless connection.
In step S130, the first device may mount the second device, that is, mount the second device on the first device, based on the received file sharing request information and a mount function, so that the first device establishes file sharing with the second device. After the second device is mounted on the first device, the file of the second device can be shared through the same local area network connected with the first device and the second device.
It should be noted that, in this method, the file sharing request information is generated by the second device and then sent to the first device, and after the first device mounts the second device, the file of the second device may be generally operated at the first device, for example, the file of the second device is viewed and edited.
In the case of example 1, the following examples,
the first wireless connection is a low-power Bluetooth connection, the first device is a computer, and the second device is a mobile phone.
The user can start the low-power-consumption Bluetooth function of the computer firstly, so that the computer adds GATT (Generic Attribute Profile) service, and after the computer successfully adds the GATT service, the broadcast for realizing the low-power-consumption Bluetooth connection is sent. The broadcast may include a UUID (universal Unique Identifier).
The mobile phone can scan periodically or irregularly, when the mobile phone scans the broadcast comprising the UUID, the mobile phone can pop up a prompt window for prompting a user whether to allow the user to establish the low-power Bluetooth connection with the computer, and when the user determines that the user allows the establishment of the low-power Bluetooth connection, the mobile phone establishes the low-power Bluetooth connection with the computer and can stop scanning so as to reduce power consumption.
In addition, when the user determines that the Bluetooth low energy connection is allowed to be established, the mobile phone can generate the determined connection information and send the determined connection information to the computer. After the computer receives the determined connection information, the computer can stop sending the broadcast so as to reduce power consumption.
After the low-power Bluetooth connection is established between the mobile phone and the computer, data can be mutually transmitted through the characteristic value.
When the mobile phone and the computer are in the same local area network, the mobile phone can generate a shared password, and then the internet protocol address (IP address), the equipment identifier and the shared password of the mobile phone are sent to the computer through the low-power Bluetooth communication.
After the computer receives the internet protocol address (IP address) and the device identifier and the shared password, the mobile phone can be mounted based on the mounting function, that is, the computer and the mobile phone establish file sharing, so as to share the file of the mobile phone through the local area network. The user can operate the files on the mobile phone on the computer, so that the use experience of the user is improved.
The mobile phone and the computer can be provided with Bluetooth interaction modules to realize the low-power Bluetooth connection and transmit information through the low-power Bluetooth connection.
Because most of devices have the Bluetooth function with low power consumption and the wireless connection function, the file sharing method is wider in application range, and based on the file sharing of the local area network, the file sharing speed is higher, the efficiency is higher, and the use experience of a user is better.
It should be noted that, when the computer sends the broadcast for implementing the first wireless connection, since the mobile phone does not know the specific moment when the computer sends the broadcast, the mobile phone may scan periodically or aperiodically in the on-screen state, and compared with the classic bluetooth, the bluetooth low energy may reduce the power consumption of the mobile phone.
In the case of example 2, the following example was carried out,
the first device is a first computer, and the second device is a second computer. After the first computer and the second computer establish file sharing, a user can process files of the second computer at the first computer, using experience is improved, and the method can also realize cooperative work.
In one exemplary embodiment, a file sharing method is provided and applied to a first device. In the method, before determining that the first device and the second device are in the same local area network, the method may further include:
s210, sending verification information to the second equipment based on the first wireless connection;
and S220, receiving verification success information sent by the second equipment.
In step S210, the authentication information may include user information of the first device, that is, information of a user who logs in the first device. For example, the authentication information may be an Identification (ID) of a user logged into the first device.
In step S220, authentication success information is generated by the second device in response to the authentication information matching the target information of the second device. Wherein the target information may include user information of the second device. For example, the target information may be an identity of a user logged into the second device.
In the method, a first device sends authentication information to a second device based on a first wireless connection. The second device receives the authentication information sent by the first device based on the first wireless connection. The second device compares the received verification information with the target information of the second device, if the verification information is the same as the target information, the verification information is matched with the target information, verification success information can be generated, and then the verification success information is sent to the first device based on the first wireless connection, so that the first device and the second device are ensured to be used by the same user, and the file sharing safety is improved.
In the case of example 1, the following examples,
the first device is a computer, and the second device is a mobile phone. The first wireless connection is a bluetooth connection. The verification information is the identity of the user logging in the computer and is marked as ID1. The identity of the user with the target information of the login mobile phone is marked as ID2.
The mobile phone and the computer can be provided with user information verification modules for completing the verification of the user identity.
After the bluetooth connection is established between the mobile phone and the computer, the computer can start an Auth Server (authentication service) of the computer, and the service can acquire the identity ID1 of the user logging in the computer. Meanwhile, the mobile phone may start an Auth Server (authentication service) of the mobile phone, and the service may obtain an identity ID2 of a user who logs in the mobile phone.
The computer can then send ID1 to the handset via the bluetooth connection. After receiving the ID1 sent by the computer through the Bluetooth, the mobile phone compares the ID1 with the ID2 of the mobile phone and if the ID1 is the same as the ID2, the mobile phone and the computer are the same user, and the mobile phone can generate verification success information and then sends the verification success information to the computer through the Bluetooth connection. The computer can receive the verification success information through Bluetooth connection, so that the security of file sharing between the mobile phone and the computer is improved.
In the method, whether the user identifier of the first device is matched with the user identifier of the second device is determined through the user information checking module, and the subsequent step of establishing the file sharing can be carried out only under the condition that the user identifier of the first device is matched with the user identifier of the second device, so that the file sharing safety between the first device and the second device can be improved.
It should be noted that, regarding the verification of the user information, the second device may also send the target information to the first device based on the first wireless connection, and after receiving the target information, the first device may compare the target information with the verification information of the first device, and if the target information and the verification information are matched, may perform the subsequent step of "determining that the first device and the second device are in the same local area network".
In addition, if the first device determines that the received target information is matched with the verification information of the first device, verification success information can also be generated, and the verification success information can be sent to the second device based on the first wireless connection, so that the second device determines that the user information verification of the first device and the user information verification of the second device are successful.
In one exemplary embodiment, a file sharing method is provided and applied to a first device. In the method, after the second device is loaded on the first device, the method may further include:
s310, determining that the local area network is abnormal;
s320, the second device is unloaded from the first device.
In step S310, the first device may include a lan status detection module, which may check the link status of the lan between the first device and the second device through the ICMP packet.
The ICMP packet is a network communication packet. ICMP is an abbreviation for Internet Control Message Protocol (Internet Control Message Protocol). The ICMP control packet is a message used to detect network problems such as network failure, host availability, and available route.
For example, a first device may start a Network Status Server (Network Status service), which may establish a socket connection with a second device that establishes a file share (a long connection, in theory, once the long connection is established between the first device and the second device, the first device and the second device will not be actively disconnected), and may send an ICMP packet at a certain time, determine the connection and disconnection of the Network by whether the ICMP packet has a response, and calculate the delay by the time length of the ICMP packet response.
And when the first equipment cannot receive the response of the ICMP data packet or the response time length of the first equipment is greater than or equal to the set delay time length, determining that the local area networks where the first equipment and the second equipment are located are abnormal.
In step S320, the first device may directly uninstall the mounted second device, that is, the second device is uninstalled from the first device, so that the file sharing between the first device and the second device is disconnected, and the user cannot operate the file of the second device on the first device.
In addition, in the method, after the second device is loaded on the first device, the method may further include:
s410, receiving first control information for unloading the second equipment;
and S420, based on the first control information, the second device is off-loaded from the first device.
In step S410, the first control information may be control information that the second device transmits to the first device, or may be control information that the user directly inputs to the first device.
When the first control information is control information sent by the second device to the first device, the second device may include a lan status detection module, which may check a link status of a lan where the first device and the second device are located through an ICMP packet.
For example, the second device may start a Network Status Server and may periodically send ICMP packets. When the second device cannot receive the response of the ICMP packet, or the response duration is longer than or equal to the set delay duration, it is determined that the local area network where the first device and the second device are located is abnormal, and the second device may send, to the first device, first control information based on the first wireless connection, where the first control information is used to enable the first device to uninstall the second device, that is, the first control information is used to cancel the second device from being hung on the first device, so that the first device disconnects file sharing with the second device.
When the first control information is control information directly input to the first device by the user, the user can input the first control information to the first device through a key or a touch screen.
In step S420, after the first device receives the first control information, the mounted second device may be uninstalled based on the first control information, so as to disconnect file sharing between the first device and the second device.
It is noted that after un-loading the second device from the first device, the method further comprises;
and sending second control information to the second equipment based on the first wireless connection so as to enable the second equipment to close the file sharing function.
The second control information may be information that characterizes that the first device successfully uninstalls the second device, that is, the second control information may be information that characterizes that the first device successfully disconnects file sharing with the second device.
After the first device disconnects the file sharing with the second device, that is, after the first device unloads the second device, the first device may generate an uninstallation success information and then transmit the uninstallation success information to the second device through the first wireless connection. And after receiving the uninstalling success information, the second device can close the file sharing function of the second device.
For example, the second device may turn off the Samba service to turn off the file sharing function. Wherein, samba is free software for realizing SMB protocol, and is composed of a server and a client program. SMB (Server Messages Block, information services Block) is a communication protocol for sharing files and printers on a lan, and provides a sharing service of resources such as files and printers between different computers in the lan.
It should be noted that, in the method, when the second device cannot receive the response of the ICMP packet, or the response duration is longer than or equal to the set delay duration, the second device may directly close its file sharing function.
According to the method, whether the file sharing between the first device and the second device is disconnected or not can be determined based on the requirements of the user or whether the file sharing between the first device and the second device is abnormal or not, and the use experience of the user can be further improved.
In one exemplary embodiment, a file sharing method is provided that employs a first device. In the method, determining that the first device and the second device are in the same local area network may include at least one of:
mode 1, determining that a first device and a second device are connected to the same wireless network;
mode 2, determining a network hotspot where a first device is connected to a second device;
mode 3, a network hotspot where the second device is connected to the first device is determined.
The mode 1 may include at least one of the following cases.
In the case of the situation 1 that is,
if it is determined that the first device and the second device are currently connected to the same valid wireless network based on the first wireless connection, the same valid network may be determined to be a local area network, and it may be determined that the first device and the second device are in the same local area network.
The first device may send, to the second device, a network identifier of a valid wireless network to which the first device is connected based on the first wireless connection, where the network identifier may include, for example, a BSSID (the BSSID refers to a MAC address of the wireless network). For convenience of description, BSSID of a valid wireless network to which the first device is connected is denoted as BSSID1.
The second device may receive BSSID1 based on the first wireless connection. The BSSID of the valid wireless network to which the second device is connected is denoted as BSSID2. And the second device compares the BSSID1 with the BSSID2, and if the BSSID1 is identical with the BSSID2, the first device and the second device are currently connected with the same effective wireless network, so that the first device and the second device are determined to be in the same local area network.
In the case of 2, the first and second cases,
if the first device and the second device are determined to be connected to different effective wireless networks currently based on the first wireless connection, receiving network information of the effective wireless network currently connected with the second device, and enabling the first device to be connected to the effective wireless network currently connected with the second device based on the network information so as to determine that the first device and the second device are in the same local area network.
The second device compares the received BSSID1 sent by the first device with the BSSID2 of the second device, and if the two BSSIDs are different, it is determined that the first device and the second device are currently connected to different valid wireless networks.
The second device may send, to the first device, network information of a valid wireless network to which the second device is currently connected based on the first wireless connection, where the network information may include a BSSID (which may be BSSID 2) of the valid wireless network and a connection password (which may be passcode 2) of the valid wireless network.
After receiving the BSSID2 and the password2 based on the first wireless connection, the first device may connect to the valid wireless network to which the second device is currently connected based on the BSSID2 and the password2, so as to determine that the first device and the second device are in the same local area network.
In the case of the situation 3,
if the first equipment is determined to be currently connected to the effective wireless network based on the first wireless connection, and the second equipment cannot be currently connected to the effective wireless network, sending network information of the effective wireless network currently connected with the first equipment to the second equipment, so that the second equipment is connected to the effective wireless network currently connected with the first equipment, and the first equipment and the second equipment are determined to be in the same local area network.
When the second device cannot be connected to the valid wireless network, the first device may send, to the second device, network information of the valid wireless network to which the first device is currently connected based on the first wireless connection, where the network information may include BSSID1 and a connection password of the valid wireless network, and the connection password may be written as password1.
After receiving the BSSID1 and password1 based on the first wireless connection, the second device may connect to the valid wireless network to which the first device is currently connected, thereby determining that the first device and the second device are in the same local area network.
It should be noted that, in this manner 1, if it is determined that the first device and the second device are currently connected to different effective wireless networks based on the first wireless connection, network information of the effective wireless network to which the first device is currently connected may also be sent to the second device, so that the second device is connected to the effective wireless network to which the first device is currently connected, so as to determine that the first device and the second device are in the same local area network.
The second device compares the received BSSID1 sent by the first device with the BSSID2 of the second device, and if the two BSSIDs are different, it is determined that the first device and the second device are currently connected to different valid wireless networks.
The first device may send BSSID1 and password1 of the valid wireless network to which the first device is currently connected to the second device based on the first wireless connection.
After receiving the BSSID1 and password1 based on the first wireless connection, the first device may connect to the active wireless network to which the second device is currently connected, so as to determine that the first device and the second device are in the same local area network.
In the method, the mode 2 may include: and receiving hotspot information of the network hotspot of the second equipment so as to enable the first equipment to be connected to the network hotspot.
For example, if it is determined that neither the first device nor the second device is connected to the valid wireless network, the second device may open its own data traffic and open a network hotspot, and then send network information of the network hotspot to the first device based on the first wireless connection, where the network information may include BSSID (which may be referred to as BSSID 3) and connection password (which may be referred to as password 3) of the network hotspot.
After receiving the BSSID3 and the password3 based on the first wireless connection, the first device may connect to a network hotspot opened by the second device based on the BSSID3 and the password3, so that the first device and the second device are in the same local area network.
In the method, the mode 3 may include: and opening a network hotspot of the first device, and sending hotspot information of the network hotspot to the second device so as to enable the second device to be connected to the network hotspot.
For example, if it is determined that neither the first device nor the second device is connected to the valid wireless network, the first device may open its own data traffic, open a network hotspot, and then send network information of the network hotspot to the second device based on the first wireless connection, where the network information may include a BSSID (which may be denoted as BSSID 4) and a connection password (which may be denoted as password 4) of the network hotspot.
After receiving the BSSID4 and the password4 based on the first wireless connection, the second device may connect to the network hotspot started by the first device based on the BSSID4 and the password4, so that the first device and the second device are in the same local area network.
In the case of example 1, the following examples,
the first device is a computer, the second device is a mobile phone, and the first wireless connection is a low-power Bluetooth connection.
The mobile phone and the computer can be provided with a network topology detection module which is used for determining that the mobile phone and the computer are in the same local area network.
The network topology detection module of the handset can check whether the WLAN function (wireless connection function) of the handset is on, if the WLAN function of the handset is on. It is checked whether a connection to a valid wireless network (i.e., an available wireless network) has been made.
The network topology detection module of the computer can check whether the WLAN function of the computer is started or not, and if the WLAN function of the computer is in a starting state. It is checked whether a connection to a valid wireless network (i.e., an available wireless network) has been made.
After the user information is successfully verified, if the mobile phone and the computer are determined to be connected to the effective wireless network, whether the BSSID1 of the effective wireless network connected with the computer is the same as the BSSID2 of the effective wireless network connected with the mobile phone can be judged.
And if the BSSID1 and the BSSID2 are the same, determining that the mobile phone and the computer are connected to the same wireless network, and accordingly determining that the mobile phone and the computer are in the same local area network.
If BSSID1 and BSSID2 are different, the computer can send BSSID2 and password2 of the effective wireless network connected with the computer to the mobile phone based on low-power-consumption Bluetooth connection, and the mobile phone can be connected to the effective wireless network connected with the computer after receiving the BSSID2 and the password2, so that the mobile phone and the computer are connected to the same wireless network, and the mobile phone and the computer are confirmed to be in the same local area network.
And if the mobile phone is connected to the valid and invalid network and the computer is not connected to the valid wireless network, enabling the computer to be connected to the valid wireless network connected with the mobile phone based on the BSSID1 and the password1 of the valid wireless network connected with the mobile phone.
And if the mobile phone is not connected to the effective wireless network and the computer is connected to the effective wireless network, enabling the mobile phone to be connected to the effective wireless network connected to the computer based on BSSID2 and password2 of the effective wireless network connected to the computer.
If the mobile phone and the computer are not connected to the effective wireless network, the mobile phone can be used for data traffic and network hotspots, BSSID3 and password3 of the network hotspots are sent to the computer based on low-power-consumption Bluetooth connection, the computer is connected to the network hotspots, and therefore the mobile phone and the computer are located in the same local area network.
In the method, the local area network where the mobile phone and the computer are located can be selected according to the following rules: the effective wireless network connected with the mobile phone is superior to the effective wireless network connected with the computer, the effective wireless network connected with the computer is superior to the 5G network of the mobile phone, the 5G network of the mobile phone is superior to the 2.4G network of the mobile phone, the 2.4G network of the mobile phone is superior to the 5G network of the computer, and the 5G network of the computer is superior to the 2.4G network of the computer.
For example, if the mobile phone is connected with an effective wireless network, the computer is also connected with the effective wireless network, so that the mobile phone and the computer are in the same local area network; if the mobile phone is not connected to the effective wireless network and the computer can be connected to the effective wireless network, the mobile phone is connected to the effective wireless network connected with the computer, so that the mobile phone and the computer are in the same local area network; if the mobile phone and the computer are not connected to the effective wireless network and the mobile phone can open 5G data traffic, the computer is connected to the network hotspot where the mobile phone is opened, so that the mobile phone and the computer are in the same local area network. By analogy, the mobile phone and the computer are always in the optimal local area network, so that the file sharing efficiency is improved.
In one exemplary embodiment, a file sharing method is provided, which is applied to a second device. The method is matched with the file sharing method applied to the first equipment to realize the file sharing between the first equipment and the second equipment. Referring to fig. 1 and 3, the method may include:
s510, establishing a first wireless connection with first equipment;
s520, generating file sharing request information;
and S530, under the condition that the second equipment and the first equipment are in the same local area network, sending file sharing request information to the first equipment based on the first wireless connection.
In step S510, the first wireless connection may include a bluetooth connection.
For example, the second device may periodically scan for ambient signals and may scan for broadcasts if the first device sends a broadcast to enable a bluetooth connection and the second device is within a range where the broadcasts can be scanned. After receiving the broadcast, the second device can establish a bluetooth connection with the first device.
In step S520, the second device may set a file sharing module, where the file sharing module mainly includes a Samba service for establishing and disconnecting file sharing with the first device. Samba mainly comprises three Daemon (daemons) of smbpasswd (managing Samba passwords), nmbd and smbd. The smbpasswd is a command under linux, and mainly functions to create a samba user for a system creation user, configure shared passwords and the like, nmbd is responsible for verifying parameters such as passwords during mounting, and smbd is responsible for all subsequent shared work.
Before the file sharing is established, the file sharing module of the second device may generate file sharing request information, which may include, for example, an internet protocol address of the second device, a sharing password of the second device, an identifier of the second device, and the like.
After the file sharing request information is generated, smbpasswd can be started to create the sharing password in the Samba service, so that the second device can share files through the sharing password. After the Samba service shared password is successfully set, nmbd and smbd can be started, wherein nmbd is responsible for verifying parameters such as passwords during mounting, and smbd is responsible for all subsequent shared work.
In step S530, the file sharing request information is used to load the second device to the first device, so that the first device establishes file sharing with the second device, so as to share the file of the second device to the first device through the local area network.
The second device may send the file sharing request information to the first device over the first wireless connection.
After receiving the file sharing request information, the first device mounts the second device through the mount function and the file sharing request information, so that the first device and the second device establish file sharing. The first device and the second device may share files of the second device via the local area network.
In one exemplary embodiment, a file sharing method is provided, which is applied to a second device. In the method, determining that the first device and the second device are in the same local area network may further include:
s610, receiving verification information sent by first equipment based on first wireless connection;
s620, if the verification information is matched with the target information of the second equipment, verification success information is generated, and the verification success information is sent to the first equipment based on the first wireless connection.
In the method, the authentication information may include user information of the first device, that is, information of a user who logs in the first device. For example, the authentication information may be an Identification (ID) of a user logged into the first device.
The target information may include user information of the second device. For example, the target information may be an identity of a user logged into the second device.
In the method, a first device sends authentication information to a second device based on a first wireless connection. The second device receives the authentication information sent by the first device based on the first wireless connection. The second device compares the received verification information with the target information of the second device, if the verification information is the same as the target information, the verification information is matched with the target information, verification success information can be generated, and then the verification success information is sent to the first device based on the first wireless connection, so that the first device and the second device are ensured to be used by the same user, and the file sharing safety is improved.
It should be noted that, regarding the verification of the user information, the second device may also send the target information to the first device based on the first wireless connection, and after receiving the target information, the first device may compare the target information with the verification information of the first device, and if the target information is matched with the verification information of the first device, may perform the subsequent step of "determining that the first device and the second device are in the same local area network".
In addition, if the first device determines that the received target information is matched with the verification information of the first device, verification success information can also be generated, and the verification success information can be sent to the second device based on the first wireless connection, so that the second device determines that the user information verification of the first device and the user information verification of the second device are successful.
In one exemplary embodiment, a file sharing service is provided for use with a second device. In the method, after the second device is loaded on the first device, the method may further include:
s710, determining that the local area network is abnormal, or receiving third control information for canceling the second device from being hung on the first device;
s720, sending first control information for unloading the second device to the first device, and unloading the second device by the first device in response to receiving the first control information.
In step S710, the second device may include a lan status detection module, which may check whether the lans where the first device and the second device are located are abnormal through the ICMP packet.
The third control information may be control information transmitted from the first device to the second device, or may be control information directly input to the first device by the user.
In step S720, after determining that the local area network is abnormal or receiving third control information for canceling the second device from being hung on the first device, the second device may generate the first control information.
The second device may then send first control information to the first device based on the first wireless connection, the first control information to un-suspend the second device from the first device.
After the first device receives the first control information, the mounted second device can be unloaded based on the first control information, so that the second device is not mounted on the first device, and the file sharing between the first device and the second device is disconnected.
It is noted that, after sending the first control information for un-loading the second device from the first device to the first device, the method may further include;
s810, receiving second control information sent by the first equipment based on the first wireless connection;
and S820, controlling to close the file sharing function of the second device based on the second control information.
The second control information may be information that characterizes that the first device successfully uninstalls the second device, that is, the second control information may be information that characterizes that the first device successfully disconnects file sharing with the second device.
After the first device disconnects the file sharing with the second device, that is, after the first device uninstalls the second device, the first device may generate uninstallation success information and then send the uninstallation success information to the second device through the first wireless connection. And after receiving the unloading success information, the second device can close the file sharing function of the second device.
For example, the second device may turn off the Samba service to turn off the file sharing function. Wherein, samba is free software for realizing SMB protocol, and is composed of a server and a client program. SMB (Server Messages Block, information services Block) is a communication protocol for sharing files and printers on a lan, and provides a sharing service of resources such as files and printers between different computers in the lan.
It should be noted that, in the method, when the second device cannot receive the response of the ICMP packet, or the response duration is longer than or equal to the set delay duration, the second device may directly close its file sharing function.
In the method, whether the second device is not hung on the first device or not can be determined based on the requirement of the user or whether the file sharing between the first device and the second device is abnormal, and the use experience of the user can be further improved.
In addition, it should be noted that, in the method, the first device and the second device are determined to be in the same local area network, in a similar manner to the above-mentioned file sharing method applied to the first device, it may also include at least one of the following:
mode 1, determining that a first device and a second device are connected to the same wireless network;
mode 2, determining a network hotspot where a first device is connected to a second device;
mode 3, a network hotspot where the second device is connected to the first device is determined.
For a specific situation, reference may be made to the file sharing method applied to the first device, which is not described herein again.
The method can enable the mobile phone and the computer to be always in the optimal local area network, so that the file sharing efficiency is improved.
In one exemplary embodiment, a file sharing method is provided and applied between a first device and a second device.
Referring to fig. 1 to 3, in the method, the first device may be a computer, the second device may be a mobile phone, and the first wireless connection may be a bluetooth low energy connection.
The user can start the low-power-consumption Bluetooth function of the computer firstly, so that the computer adds GATT (Generic Attribute Profile) service, and after the computer successfully adds the GATT service, the broadcast for realizing the low-power-consumption Bluetooth connection is sent. The broadcast may include a UUID (universal Unique Identifier).
The mobile phone can scan periodically or irregularly, when the mobile phone scans the broadcast comprising the UUID, the mobile phone can pop up a prompt window for prompting a user whether to allow the user to establish the low-power Bluetooth connection with the computer, and when the user determines that the user allows the establishment of the low-power Bluetooth connection, the mobile phone establishes the low-power Bluetooth connection with the computer and can stop scanning so as to reduce power consumption.
In addition, when the user determines that the Bluetooth low energy connection is allowed to be established, the mobile phone can generate the determined connection information and send the determined connection information to the computer. After the computer receives the determined connection information, the computer can stop sending the broadcast so as to reduce the power consumption.
After the low-power-consumption Bluetooth connection is established between the mobile phone and the computer, data can be mutually transmitted through the characteristic value.
After the bluetooth connection is established between the mobile phone and the computer, the computer can start an Auth Server (authentication service) of the computer, and the service can acquire the identity ID1 of the user logging in the computer. Meanwhile, the mobile phone may start an Auth Server (authentication service) of the mobile phone, and the service may obtain an identity ID2 of a user who logs in the mobile phone.
The computer can then send ID1 to the handset via the bluetooth connection. After receiving the ID1 sent by the computer through the Bluetooth, the mobile phone compares the ID1 with the ID2 of the mobile phone and if the ID1 is the same as the ID2, the mobile phone and the computer are the same user, and the mobile phone can generate verification success information and then sends the verification success information to the computer through the Bluetooth connection. The computer can receive the successful verification information through Bluetooth connection, so that the security of file sharing between the mobile phone and the computer is improved.
The mobile phone and the computer can be provided with a network topology detection module which is used for determining that the mobile phone and the computer are in the same local area network.
The local area network where the mobile phone and the computer are located can be selected according to the following rules: the effective wireless network connected with the mobile phone is superior to the effective wireless network connected with the computer, the effective wireless network connected with the computer is superior to the 5G network of the mobile phone, the 5G network of the mobile phone is superior to the 2.4G network of the mobile phone, the 2.4G network of the mobile phone is superior to the 5G network of the computer, and the 5G network of the computer is superior to the 2.4G network of the computer.
For example, the network topology detection module of the handset may check whether the WLAN function (wireless connection function) of the handset is on, if the WLAN function of the handset is on. It is checked whether a connection to a valid wireless network (i.e., an available wireless network) has been made.
The network topology detection module of the computer can check whether the WLAN function of the computer is started or not, and if the WLAN function of the computer is in a starting state. It is checked whether a connection to a valid wireless network (i.e., an available wireless network) has been made.
After the user information is successfully verified, if the mobile phone and the computer are determined to be connected to the effective wireless network, whether the BSSID1 of the effective wireless network connected with the computer is the same as the BSSID2 of the effective wireless network connected with the mobile phone can be judged.
And if the BSSID1 and the BSSID2 are the same, determining that the mobile phone and the computer are connected to the same wireless network, and accordingly determining that the mobile phone and the computer are in the same local area network.
If BSSID1 and BSSID2 are different, the computer can send BSSID2 and password2 of an effective wireless network connected with the computer to the mobile phone based on low-power-consumption Bluetooth connection, and the mobile phone can be connected to the effective wireless network connected with the computer after receiving the BSSID2 and the password2, so that the mobile phone and the computer are connected to the same wireless network, and the situation that the mobile phone and the computer are in the same local area network is determined.
And if the mobile phone is connected to the valid and invalid network and the computer is not connected to the valid wireless network, enabling the computer to be connected to the valid wireless network connected with the mobile phone based on the BSSID1 and the password1 of the valid wireless network connected with the mobile phone.
And if the mobile phone is not connected to the effective wireless network and the computer is connected to the effective wireless network, enabling the mobile phone to be connected to the effective wireless network to which the computer is connected based on BSSID2 and password2 of the effective wireless network to which the computer is connected.
If the mobile phone and the computer are not connected to the effective wireless network, the mobile phone can be used for data traffic and network hotspots, BSSID3 and password3 of the network hotspots are sent to the computer based on low-power-consumption Bluetooth connection, the computer is connected to the network hotspots, and therefore the mobile phone and the computer are located in the same local area network.
By analogy, the mobile phone and the computer are always in the optimal local area network, and the subsequent file sharing efficiency is improved.
Under the condition that the mobile phone and the computer are determined to be in the same local area network, the file sharing module of the mobile phone may generate file sharing request information, and the file sharing request information may include, for example, an internet protocol address of the mobile phone, a sharing password of the mobile phone, an identifier of the mobile phone, and the like.
After the file sharing request information is generated, smbpasswd can be started to create the sharing password in the Samba service, so that the mobile phone can realize file sharing through the sharing password. After the Samba service shared password is successfully set, nmbd and smbd can be started, wherein nmbd is responsible for verifying parameters such as passwords during mounting, and smbd is responsible for all subsequent shared work.
Then, the mobile phone can send the sharing request information to the computer based on the low-power Bluetooth connection. After the computer receives the internet protocol address (IP address) and the device identifier and the shared password, the mobile phone can be mounted based on the mounting function, that is, the computer and the mobile phone establish file sharing, so as to share the file of the mobile phone through the local area network. The user can operate the files on the mobile phone on the computer, so that the use experience of the user is improved.
After the mobile phone and the computer establish file sharing, the local area network state detection modules of the mobile phone and the computer can detect the link condition of the local area network.
The computer can start a Network Status Server (Network state service), the service can establish socket connection with the computer which establishes file sharing, and can send an ICMP data packet at regular time, the on-off of the Network is determined by whether the ICMP data packet has a response, and the time delay is calculated by the response time length of the ICMP data packet.
And when the computer cannot receive the response of the ICMP data packet or the response time length of the computer is longer than or equal to the set time delay, determining that the local area network where the mobile phone and the computer are located is abnormal.
If the computer detects the local area network abnormality, the mounted mobile phone can be forcibly unloaded.
Similarly, the mobile phone can also detect whether the local area Network is abnormal through the Network Status Server. If the mobile phone detects that the local area network is abnormal, the Samba service can be closed so as to close the file sharing function and forcibly stop mounting.
In addition, the user can also directly input third control information to the mobile phone so as to control the mobile phone to stop being mounted. Or, the user can also directly input the first control information to the computer to control the computer to unload the mounted mobile phone.
It should be noted that, after the computer successfully uninstalls the mobile phone, the computer may generate an uninstallation success message, and then send the uninstallation success message to the mobile phone through the low power consumption bluetooth connection. After the mobile phone receives the information of successful uninstallation, if the file sharing function is closed, the file sharing function of the mobile phone can be closed, so that the energy consumption is reduced.
Because most of devices have the Bluetooth function with low power consumption and the wireless connection function, the file sharing method is wider in application range, and based on the file sharing of the local area network, the file sharing speed is higher, the efficiency is higher, and the use experience of a user is better.
In one exemplary embodiment, a file sharing apparatus is provided, which is applied to a first device. The file sharing device is used for implementing the file sharing method applied to the first equipment. Illustratively, referring to fig. 4, the apparatus may include a first connection module 101, a first receiving module 102, and a first sharing module 103, wherein, in the process of implementing the above method,
a first connection module 101, configured to establish a first wireless connection with a second device;
a first receiving module 102, configured to receive, based on a first wireless connection, file sharing request information sent by a second device when it is determined that the first device and the second device are in a same local area network;
the first sharing module 103 is configured to, based on the file sharing request information, suspend the second device on the first device, so as to share the file of the second device through the local area network.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a first device. As shown with reference to fig. 4, the apparatus may further include a first transmitting module 104, wherein,
a first sending module 104, configured to send verification information to the second device based on the first wireless connection;
the first receiving module 102 is further configured to receive verification success information sent by the second device, where the verification success information is generated by the second device in response to the verification information matching the target information of the second device.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a first device. Referring to fig. 4, in the apparatus,
a first receiving module 102, further configured to receive first control information for offloading the second device;
the first sharing module 103 is further configured to un-suspend the second device from the first device.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a first device. Referring to fig. 4, the apparatus may further include a first determining module 105, in which,
a first determining module 105, configured to determine that a local area network is abnormal;
the first sharing module 103 is further configured to un-suspend the second device from the first device.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a first device. Referring to fig. 4, the apparatus further includes:
a first sending module 104, configured to send second control information to the second device based on the first wireless connection, so that the second device closes the file sharing function.
In one exemplary embodiment, a file sharing apparatus is provided, which is applied to a second device. The device is used for implementing the file sharing method applied to the second equipment. Illustratively, referring to fig. 5, the apparatus may include a second connection module 201, a second sharing module 203 and a second sending module 204, in the course of implementing the above method,
a second connection module 201, configured to establish a first wireless connection with a first device;
the second sharing module 203 is used for generating file sharing request information;
a second sending module 204, configured to send, based on the first wireless connection, file sharing request information to the first device when it is determined that the second device and the first device are in the same local area network, where the file sharing request information is used to load the second device on the first device, so as to share a file of the second device to the first device through the local area network.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a second device. Referring to fig. 5, the apparatus further comprises a second receiving module 202, wherein,
a second receiving module 202, configured to receive, based on the first wireless connection, verification information sent by the first device;
the second sending module 204 is further configured to generate verification success information if it is determined that the verification information matches the target information of the second device, and send the verification success information to the first device based on the first wireless connection.
In one exemplary embodiment, a file sharing apparatus is provided and applied to a second device. Referring to fig. 5, in the apparatus,
the second receiving module 202 is further configured to receive third control information for unhooking the second device from the first device;
the second sending module 204 is further configured to send, to the first device, first control information for offloading the second device, and the first device unloads the second device from the first device in response to receiving the first control information.
In one exemplary embodiment, a file sharing apparatus is provided, which is applied to a second device. As shown with reference to fig. 5, the apparatus may further include a second determination module 205, wherein,
a second determining module 205, configured to determine that the local area network is abnormal;
the second sending module 204 is further configured to send, to the first device, first control information for offloading the second device, and the first device unloads the second device from the first device in response to receiving the first control information.
In one exemplary embodiment, a file sharing apparatus is provided, which is applied to a second device. Referring to fig. 5, in the apparatus,
a second receiving module 202, configured to receive, based on the first wireless connection, second control information sent by the first device;
the second sharing module 203 is further configured to control to close the file sharing function of the second device based on the second control information.
In one exemplary embodiment, an apparatus is provided that may function as either the first apparatus described above or the second apparatus described above. Examples of devices are mobile phones, laptops, tablets, wearable devices, and the like.
Referring to fig. 6, device 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the device 400. Examples of such data include instructions for any application or method operating on device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 406 provide power to the various components of device 400. Power components 406 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera module and/or a rear camera module. The front camera module and/or the rear camera module can receive external multimedia data when the apparatus 400 is in an operation mode, such as a shooting mode or a video mode. Each front camera module and rear camera module may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the device 400. For example, the sensor component 414 can detect an open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the device 400, the sensor component 414 can also detect a change in the position of the device 400 or a component of the device 400, the presence or absence of user contact with the device 400, orientation or acceleration/deceleration of the device 400, and a change in the temperature of the device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the device 400 and other devices. The device 700 may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described file sharing method applied to a first device and/or for performing the above-described file sharing method applied to a second device.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the device 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of the device, enable the device to perform the above-described file sharing method applied to the first device and/or the above-described file sharing method applied to the second device.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (24)

1. A file sharing method is applied to a first device, and is characterized by comprising the following steps:
establishing a first wireless connection with a second device;
under the condition that the first device and the second device are determined to be in the same local area network, receiving file sharing request information sent by the second device based on the first wireless connection;
and based on the file sharing request information, the second device is hung on the first device so as to share the file of the second device through the local area network.
2. The method of claim 1, wherein before determining that the first device and the second device are on a same local area network, the method further comprises:
transmitting authentication information to the second device based on the first wireless connection;
receiving verification success information sent by the second device, the verification success information being generated by the second device in response to the verification information matching target information of the second device.
3. The method of claim 2, wherein the authentication information comprises user information of the first device, and wherein the target information comprises user information of the second device.
4. The method of claim 1, wherein after the second device is suspended from the first device, the method further comprises:
determining that the local area network is abnormal, or receiving first control information for unloading the second device;
the second device is de-loaded from the first device.
5. The method of claim 4, wherein after the un-loading the second device from the first device, the method further comprises;
and sending second control information to the second equipment based on the first wireless connection so as to enable the second equipment to close the file sharing function.
6. The method of claim 1, wherein the determining that the first device and the second device are in the same local area network comprises at least one of:
determining that the first device and the second device are connected to the same wireless network;
determining a network hotspot at which the first device connects to the second device;
determining a network hotspot at which the second device connects to the first device.
7. The method of claim 6, wherein the determining that the first device and the second device are connected to the same wireless network comprises at least one of:
determining, based on the first wireless connection, that the first device and the second device are currently connected to the same active wireless network;
if the first equipment and the second equipment are determined to be connected to different effective wireless networks currently based on the first wireless connection, receiving network information of the effective wireless network currently connected with the second equipment, and enabling the first equipment to be connected to the effective wireless network currently connected with the second equipment based on the network information;
if the first equipment is determined to be currently connected to the effective wireless network based on the first wireless connection and the second equipment cannot be currently connected to the effective wireless network, sending network information of the effective wireless network currently connected with the first equipment to the second equipment so that the second equipment is connected to the effective wireless network currently connected with the first equipment.
8. The method of claim 6, wherein determining a network hotspot at which the first device connects to the second device comprises:
and receiving hotspot information of the network hotspot of the second equipment so as to enable the first equipment to be connected to the network hotspot.
9. The method of claim 6, wherein the determining the network hotspot at which the second device connects to the first device comprises:
and opening a network hotspot of the first device, and sending hotspot information of the network hotspot to the second device, so that the second device is connected to the network hotspot.
10. The method according to claim 1, wherein the file sharing request information includes at least one of: an internet protocol address of the second device, a shared password of the second device, and an identification of the second device.
11. A file sharing method is applied to a second device, and is characterized by comprising the following steps:
establishing a first wireless connection with a first device;
generating file sharing request information;
and sending the file sharing request information to the first device based on the first wireless connection under the condition that the second device and the first device are determined to be in the same local area network, wherein the file sharing request information is used for loading the second device on the first device so as to share the file of the second device to the first device through the local area network.
12. The method of claim 11, wherein before determining that the first device and the second device are on a same local area network, the method further comprises:
receiving verification information sent by the first device based on the first wireless connection;
and if the verification information is determined to be matched with the target information of the second equipment, generating verification success information, and sending the verification success information to the first equipment based on the first wireless connection.
13. The method of claim 11, wherein after the loading the second device to the first device, the method further comprises:
determining that the local area network is abnormal, or receiving third control information for canceling the second device from being hung on the first device;
sending first control information for offloading the second device to the first device, the first device de-suspending the second device from the first device in response to receiving the first control information.
14. The method of claim 13, wherein after sending the first control information to the first device for offloading the second device, the method further comprises;
receiving second control information sent by the first equipment based on the first wireless connection;
and controlling to close the file sharing function of the second equipment based on the second control information.
15. A file sharing apparatus applied to a first device, the apparatus comprising:
the first connection module is used for establishing a first wireless connection with the second equipment;
a first receiving module, configured to receive, based on the first wireless connection, file sharing request information sent by the second device when it is determined that the first device and the second device are in the same local area network;
and the first sharing module is used for loading the second equipment to the first equipment based on the file sharing request information so as to share the file of the second equipment through the local area network.
16. The apparatus of claim 15, further comprising a first sending module, wherein,
the first sending module is configured to send verification information to the second device based on the first wireless connection;
the first receiving module is further configured to receive verification success information sent by the second device, where the verification success information is generated by the second device in response to the verification information being matched with target information of the second device.
17. The apparatus of claim 15,
the first receiving module is further configured to receive first control information for offloading the second device; or, the apparatus further includes a first determining module, where the first determining module is configured to determine that the local area network is abnormal;
the first sharing module is further configured to un-load the second device from the first device.
18. The apparatus of claim 17, further comprising:
and the first sending module is used for sending second control information to the second equipment based on the first wireless connection so as to enable the second equipment to close the file sharing function.
19. A file sharing apparatus applied to a second device, the apparatus comprising:
the second connection module is used for establishing first wireless connection with the first equipment;
the second sharing module is used for generating file sharing request information;
a second sending module, configured to send, based on the first wireless connection, the file sharing request information to the first device when it is determined that the second device and the first device are in the same local area network, where the file sharing request information is used to load the second device on the first device, so as to share a file of the second device to the first device through the local area network.
20. The apparatus of claim 19, further comprising a second receiving module, wherein,
the second receiving module is configured to receive, based on the first wireless connection, verification information sent by the first device;
the second sending module is further configured to generate verification success information if it is determined that the verification information matches the target information of the second device, and send the verification success information to the first device based on the first wireless connection.
21. The apparatus of claim 19,
the second receiving module is further configured to receive third control information for unhooking the second device from the first device; or, the apparatus further includes a second determining module, where the second determining module is configured to determine that the local area network is abnormal;
the second sending module is further configured to send, to the first device, first control information for offloading the second device, where the first device cancels the suspension of the second device to the first device in response to receiving the first control information.
22. The apparatus of claim 11,
the second receiving module is further configured to receive, based on the first wireless connection, second control information sent by the first device;
the second sharing module is further configured to control to close the file sharing function of the second device based on the second control information.
23. An apparatus, characterized in that the apparatus further comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute,
the file sharing method according to any one of claims 1 to 10; and/or the presence of a gas in the atmosphere,
the file sharing method of any one of claims 11 to 14.
24. A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of a terminal, enable the terminal to perform,
the file sharing method according to any one of claims 1 to 10; and/or the presence of a gas in the atmosphere,
the file sharing direction according to any one of claims 11 to 14.
CN202110865947.9A 2021-07-29 2021-07-29 File sharing method, device, equipment and storage medium Pending CN115696284A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110865947.9A CN115696284A (en) 2021-07-29 2021-07-29 File sharing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110865947.9A CN115696284A (en) 2021-07-29 2021-07-29 File sharing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115696284A true CN115696284A (en) 2023-02-03

Family

ID=85058708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110865947.9A Pending CN115696284A (en) 2021-07-29 2021-07-29 File sharing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115696284A (en)

Similar Documents

Publication Publication Date Title
US11418388B2 (en) Method for network configuration, and electronic device
US10560491B2 (en) Methods and apparatuses for binding with device
US8953490B2 (en) Methods and apparatus for use in facilitating Wi-Fi peer-to-peer (P2P) wireless networking
US10291608B2 (en) Method and device for establishing wireless connection
EP3238467B1 (en) Controlling a modality of a dockee in a wireless docking system
CA2862872C (en) Methods and apparatus for use in facilitating wi-fi peer-to-peer (p2p) wireless networking
CN107454660B (en) Network residing method and device after authentication failure
CN109041145B (en) Communication method, communication device, terminal and storage medium
CN114200848A (en) Remote control method, system and device of household equipment and storage medium
CN113407427A (en) Verification information processing method and device, terminal equipment and storage medium
CN107105005B (en) Method and device for synchronizing data
CN115696284A (en) File sharing method, device, equipment and storage medium
WO2022174393A1 (en) Capability exchange method and apparatus, and exchange triggering method and apparatus
CN112910906B (en) Data access method and device, mobile terminal and storage medium
WO2023240575A1 (en) Relay communication method, communication apparatus, and communication device
EP4380211A1 (en) Communication method and apparatus, user equipment, base station, core network device, and storage medium
WO2022183348A1 (en) Remote configuration method of user equipment, and method for determining remote configuration mode
WO2024031523A1 (en) Information processing method and apparatus, communication device, and storage medium
WO2023070509A1 (en) Information processing method and apparatus, communication device, and storage medium
WO2024031640A1 (en) Information transmission method and apparatus, and communication device and storage medium
CN114585054B (en) WIFI connection control method, device and storage medium
WO2022206662A1 (en) Method and apparatus for determining establishment of relay pdu session, and user equipment
WO2023212934A1 (en) Relay communication method, access method, apparatus, and device
WO2023000139A1 (en) Credential transmission method and apparatus, communication device, and storage medium
WO2023184183A1 (en) Information processing method and apparatus, communication device, and storage medium

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