Data transmission method and device and storage medium
By responding to the direct connection transmission request message in the hotspot network of the mobile device, determining the connection status of the second terminal and transmitting data through the target hotspot network, the problem of not being able to use the hotspot network and point-to-point connection to share files is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202311394957.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
When using a hotspot network of a mobile device, it is impossible to use a point-to-point direct network connection to share files at the same time, resulting in users needing to manually disconnect and re-open the hotspot network, affecting the user experience.
In response to the direct connection transmission request message sent by the second terminal, when the target hotspot network is turned on, it is determined whether the second terminal is connected to the target hotspot network, and transmits data through the target hotspot network when the connection is connected.
It realizes that while keeping the hotspot network on, it connects to the second terminal through the hotspot network to share files without the need for the user to manually close the hotspot network, which improves the user experience.
Smart Images

Figure CN119893742A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of mobile equipment, and in particular to a data transmission method, device and storage medium. Background Art
[0002] In mobile device terminals, mobile devices can communicate with other mobile devices through P2P direct networks, hotspot networks, etc. Among them, P2P direct network technology is a point-to-point connection method specific to mobile devices, which can be used in specific application scenarios. It can be convenient to use the shared network provided by P2P direct network technology to carry out cross-device collaboration, share resources, perform distributed computing, etc. Hotspots are another method for mobile device terminals to share networks, which are usually created by users.
[0003] At present, many data transmission services require two mobile devices to establish a point-to-point direct network connection to share files, such as the "AirDrop" function of the iOS system and the shared files of the Android system. However, in the related art, these point-to-point direct network services cannot be used when the hotspot is turned on, and the user needs to manually disconnect the hotspot network, which will interrupt the connection between the mobile device and the device using the hotspot network. After using the service, the user has to manually turn on the hotspot of the mobile device, which makes the user experience poor when using these services. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data transmission method, device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a data transmission method is provided, the method being applied to a first terminal, the method comprising:
[0006] In response to receiving a direct connection transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, determining whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0007] When it is determined that the second terminal is connected to the target hotspot network, target data is transmitted to the second terminal according to the target hotspot network.
[0008] Optionally, determining whether the second terminal is connected to the target hotspot network includes:
[0009] Searching for a plurality of first candidate terminals through the target hotspot network, where the first candidate terminals are terminals that have opened the hotspot network;
[0010] In a case where the second terminal is included in the plurality of first candidate terminals, determining whether the network connected by the second terminal is the target hotspot network;
[0011] In a case where it is determined that the network to which the second terminal is connected is the target hotspot network, it is determined that the second terminal is connected to the target hotspot network.
[0012] Optionally, the method further comprises:
[0013] When it is determined that the hotspot network connected to the second terminal is not the target hotspot network, a hotspot connection prompt message is sent to the second terminal via the target network, where the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0014] Optionally, the method further comprises:
[0015] In the case that the second terminal is not included in the plurality of first candidate terminals, a short-range wireless communication link is established with the second terminal, and a hotspot connection prompt message is sent to the second terminal through the short-range wireless communication link; or
[0016] A hotspot connection prompt message is sent to the second terminal via the target network.
[0017] According to a second aspect of an embodiment of the present disclosure, a data transmission method is provided, the method being applied to a second terminal, the method comprising:
[0018] Sending a direct connection transmission request message to the first terminal based on the target network connected to the second terminal, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0019] When the second terminal is connected to the target hotspot network, target data is transmitted to the first terminal according to the target hotspot network.
[0020] Optionally, the method further comprises:
[0021] When the second terminal is not connected to the target hotspot network, receiving a hotspot connection prompt message sent by the first terminal, wherein the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network;
[0022] Displaying the hotspot connection prompt message;
[0023] In response to a connection operation triggered by the user based on the displayed hotspot connection prompt message, the second terminal is connected to the target hotspot network, and target data is transmitted with the first terminal according to the target hotspot network.
[0024] Optionally, the receiving a hotspot connection prompt message sent by the first terminal includes:
[0025] When the hotspot network opened by the second terminal is not the target hotspot network, a hotspot connection prompt message sent by the first terminal is received through the target network.
[0026] Optionally, the receiving a hotspot connection prompt message sent by the first terminal includes:
[0027] When the second terminal does not open the hotspot network, establish a short-range wireless communication link connection with the first terminal, and receive a hotspot connection prompt message sent by the first terminal through the short-range wireless communication link; or
[0028] When the hotspot network is not turned on at the second terminal, a hotspot connection prompt message sent by the first terminal is received through the target network.
[0029] According to a third aspect of an embodiment of the present disclosure, a data transmission device is provided, the device comprising:
[0030] a determination module configured to determine, in response to receiving a direct connection transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0031] The first transmission module is configured to transmit target data with the second terminal according to the target hotspot network when it is determined that the second terminal is connected to the target hotspot network.
[0032] Optionally, the determining module includes:
[0033] A search submodule is configured to search for a plurality of first candidate terminals through the target hotspot network, wherein the first candidate terminals are terminals that have opened the hotspot network;
[0034] A first determination submodule is configured to determine whether the network connected to the second terminal is the target hotspot network when the second terminal is included in the plurality of first candidate terminals;
[0035] The second determining submodule is configured to determine that the second terminal is connected to the target hotspot network when it is determined that the network connected to the second terminal is the target hotspot network.
[0036] Optionally, the determining module further includes:
[0037] The first sending submodule is configured to send a hotspot connection prompt message to the second terminal through the target network when it is determined that the hotspot network connected to the second terminal is not the target hotspot network, wherein the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0038] Optionally, the determining module further includes:
[0039] a broadcast submodule, configured to establish a short-range wireless communication link with the second terminal when the second terminal is not included in the plurality of the first candidate terminals, and to send a hotspot connection prompt message to the second terminal through the short-range wireless communication link; or
[0040] The second sending submodule is configured to send a hotspot connection prompt message to the second terminal through the target network.
[0041] According to a fourth aspect of an embodiment of the present disclosure, a data transmission device is provided, the device comprising:
[0042] A sending module, configured to send a direct connection transmission request message to the first terminal based on a target network to which the second terminal is connected, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0043] The second transmission module is configured to transmit target data with the first terminal according to the target hotspot network when the second terminal is connected to the target hotspot network.
[0044] Optionally, the device further comprises:
[0045] a receiving module, configured to receive a hotspot connection prompt message sent by the first terminal when the second terminal is not connected to the target hotspot network, wherein the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network;
[0046] A display module, configured to display the hotspot connection prompt message;
[0047] The connection module is configured to connect the second terminal to the target hotspot network in response to a connection operation triggered by the user based on a displayed hotspot connection prompt message, and transmit target data with the first terminal according to the target hotspot network.
[0048] Optionally, the receiving module is configured to receive the hotspot connection prompt message sent by the first terminal through the target network when the hotspot network opened by the second terminal is not the target hotspot network.
[0049] Optionally, the receiving module includes:
[0050] a receiving submodule, configured to establish a short-range wireless communication link connection with the first terminal when the second terminal does not open the hotspot network, and receive a hotspot connection prompt message sent by the first terminal through the short-range wireless communication link; or
[0051] The third sending submodule is configured to receive the hotspot connection prompt message sent by the first terminal through the target network when the hotspot network is not turned on by the second terminal.
[0052] According to a fifth aspect of an embodiment of the present disclosure, there is provided a data transmission device, including:
[0053] processor;
[0054] a memory for storing processor-executable instructions;
[0055] Wherein, the processor is configured to implement the steps of the method described in the first aspect of the present disclosure when executed.
[0056] According to a sixth aspect of an embodiment of the present disclosure, there is provided a data transmission device, including:
[0057] processor;
[0058] a memory for storing processor-executable instructions;
[0059] Wherein, the processor is configured to implement the steps of the method described in the second aspect of the present disclosure when executed.
[0060] According to a seventh aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data transmission method provided in the first aspect of the present disclosure are implemented.
[0061] According to an eighth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data transmission method provided in the second aspect of the present disclosure are implemented.
[0062] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0063] In response to receiving a direct transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, the first terminal determines whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct transmission request message is a message requesting transmission of target data based on a direct network; when it is determined that the second terminal is connected to the target hotspot network, the target data is transmitted to the second terminal according to the target hotspot network. In this way, when the first terminal receives a direct transmission request message from a second terminal when turning on the hotspot, the second terminal can be connected to the hotspot network of the first terminal, and can be connected to the second terminal through the hotspot network without disconnecting the hotspot to share files using the sharing function, without the user having to manually close the hotspot network, thereby improving the user experience.
[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0066] Figure 1 The figure is a flow chart of a data transmission method according to an exemplary embodiment.
[0067] Figure 2 The figure is a flow chart of a data transmission method according to an exemplary embodiment.
[0068] Figure 3 The figure is a flow chart of a data transmission method according to an exemplary embodiment.
[0069] Figure 4 The figure is a flow chart of a data transmission method according to an exemplary embodiment.
[0070] Figure 5 The figure is a flow chart of a data transmission method according to an exemplary embodiment.
[0071] Figure 6 The figure is a flow chart showing another data transmission method according to an exemplary embodiment.
[0072] Figure 7 It is a block diagram of a data transmission device according to an exemplary embodiment.
[0073] Figure 8 is based on Figure 7 The illustrated embodiment shows a block diagram of a determination module.
[0074] Fig. 9 is based on Figure 7 The illustrated embodiment shows a block diagram of a determination module.
[0075] Fig.10 is based on Figure 7 The illustrated embodiment shows a block diagram of a determination module.
[0076] Fig.11 It is a block diagram of a data transmission device according to an exemplary embodiment.
[0077] Fig.12 is based on Fig.11 The illustrated embodiment shows a block diagram of a data transmission device.
[0078] Fig.13 is based on Fig.12 The illustrated embodiment shows a block diagram of a data transmission device.
[0079] Fig.14 It is a block diagram of a data transmission device according to an exemplary embodiment. DETAILED DESCRIPTION
[0080] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, 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 disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0081] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0082] First, the application scenario of the present disclosure is introduced. The present disclosure can be applied when a hotspot network is turned on and a direct transmission request message is received. Currently, in mobile device terminals, mobile devices can transmit data with other mobile devices through P2P direct connection networks, hotspot networks, etc.
[0083] When a mobile device accesses a hotspot network to communicate with other mobile devices, the mobile device can operate in GO mode, also known as Group Owner mode, to provide a signal source of the hotspot network for other mobile devices. For example, at this time, the mobile device can provide a hotspot network and can communicate with other mobile devices accessing the hotspot network. The mobile device accessing the hotspot network operates in GC mode, also known as Group Client mode. Alternatively, two mobile devices can also be connected through a direct network (Peer-to-Peer, P2P).
[0084] At present, many data transmission services require two mobile devices to establish a point-to-point connection to share files, such as the "AirDrop" function of the iOS system and the shared files of the Android system. In the related art, the GO mode and direct network connection of the mobile device are mutually exclusive and cannot be used at the same time. When the hotspot is turned on, these point-to-point direct network services cannot be used, and the user needs to manually disconnect the hotspot network, which will interrupt the connection between the mobile device and the device using the hotspot network. After using the service, the user manually turns on the hotspot of the mobile device, which makes the user experience bad when using these services.
[0085] In order to solve the above problems, the present disclosure provides a data transmission method, device and storage medium. By a first terminal responding to receiving a direct transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, when the first terminal turns on a target hotspot network, it is determined whether the second terminal is connected to the target hotspot network; the direct transmission request message is a message requesting to transmit target data based on a direct network; when it is determined that the second terminal is connected to the target hotspot network, the target data is transmitted with the second terminal according to the target hotspot network. In this way, when the first terminal receives a direct transmission request message from a second terminal requesting a direct transmission when turning on the hotspot, the second terminal can be connected to the hotspot network of the first terminal, and can be connected to the second terminal through the hotspot network without disconnecting the hotspot to share files using the sharing function, without the user having to manually turn off the hotspot network, thereby improving the user experience.
[0086] Figure 1 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 1 As shown, the method is used in a first terminal and includes the following steps.
[0087] In step S11, in response to receiving a direct connection transmission request message sent by the second terminal based on the target network connected to the first terminal, when the first terminal turns on the target hotspot network, it is determined whether the second terminal is connected to the target hotspot network.
[0088] The direct connection transmission request message is a message requesting the transmission of target data based on the direct connection network. The first terminal is a mobile terminal that has turned on the hotspot network, and the mobile terminal may include a mobile device such as a mobile phone, a tablet computer, a personal computer, etc. The first terminal and the second terminal have established any network connection other than the P2P direct connection network, for example, the first terminal and the second terminal may both be connected to the same local area network.
[0089] In this step, first, the first terminal can detect the user's operation of turning on the sharing function, wherein the sharing function can be used to share files or data with other mobile terminal devices except the first terminal, and can also receive files or data shared by other mobile terminal devices except the first terminal. When the first terminal determines that the sharing function has been turned on, it can receive the direct transmission request message sent by the second terminal through the connected target network, such as a local area network. When the first terminal receives the direct transmission request message, it can determine whether the second terminal is connected to the target hotspot network of the first terminal working in GO mode.
[0090] In step S12, when it is determined that the second terminal is connected to the target hotspot network, target data is transmitted to the second terminal according to the target hotspot network.
[0091] The first terminal responds to receiving a direct transmission request message sent by the second terminal based on the target network connected to the second terminal and the first terminal, and determines whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct transmission request message is a message requesting the transmission of target data based on the direct network; when it is determined that the second terminal is connected to the target hotspot network, the target data is transmitted with the second terminal according to the target hotspot network. In this way, when the first terminal receives a direct transmission request message from the second terminal when turning on the hotspot, the second terminal can be connected to the hotspot network of the first terminal, and can be connected to the second terminal through the hotspot network without disconnecting the hotspot to share files using the sharing function, without the user having to manually close the hotspot network, thereby improving the user experience.
[0092] In some implementations, such as Figure 2 As shown, step S12 may include the following steps.
[0093] In step S121, a plurality of first candidate terminals are searched through the target hotspot network.
[0094] The first candidate terminal is a terminal that has a hotspot network enabled.
[0095] In this step, the discovery protocol of the target hotspot network opened by the first terminal working in GO mode (such as Mdns protocol, etc.) is a common discovery protocol for hotspot networks. The first terminal can use the discovery protocol of the target hotspot network to search for the first candidate terminals of multiple opened hotspot networks.
[0096] In step S122, when the second terminal is included in the plurality of first candidate terminals, it is determined whether the network to which the second terminal is connected is the target hotspot network.
[0097] In some embodiments, the first terminal may first determine whether the second terminal is included in the plurality of first candidate terminals, and if it is determined that the second terminal is included in the plurality of first candidate terminals, determine whether the network connected to the second terminal is the target hotspot network.
[0098] For example, the first terminal can detect the IP addresses of multiple first candidate terminals based on the discovery protocol of the target hotspot network (such as the Mdns protocol, etc.). When it is determined that the IP address of the second terminal is included in the IP addresses of the multiple first candidate terminals, it can be determined that the second terminal is included in the multiple first candidate terminals.
[0099] And when it is determined that the second terminal is included in the multiple first candidate terminals, the gateway information and subnet mask information of the hotspot network connected to the second terminal can be obtained according to the discovery protocol of the target hotspot network (such as the Mdns protocol, etc.); when it is determined that the gateway information and subnet mask information of the hotspot network connected to the second terminal are consistent with the target hotspot network, it can be determined that the network connected to the second terminal is the target hotspot network.
[0100] In step S123, when it is determined that the network to which the second terminal is connected is the target hotspot network, it is determined that the second terminal is connected to the target hotspot network.
[0101] By adopting the above technical solution, it is possible to determine whether the second terminal is connected to the target hotspot network through the hotspot network to which the first terminal has been connected. If the second terminal is connected to the target hotspot network, the target data based on the direct transmission request message can be directly transmitted through the connected target hotspot network. The second terminal can be connected to the hotspot network to share files using the sharing function without disconnecting the hotspot, without the user having to manually close the hotspot network, thereby improving the user experience.
[0102] In some embodiments, Figure 3 As shown, step S12 may further include the following steps.
[0103] In step S124, when it is determined that the hotspot network to which the second terminal is connected is not the target hotspot network, a hotspot connection prompt message is sent to the second terminal via the target network.
[0104] The hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0105] In this step, the first terminal can first detect the IP addresses of multiple first candidate terminals according to the discovery protocol of the target hotspot network (such as the Mdns protocol, etc.). When it is determined that the IP addresses of the multiple first candidate terminals include the IP address of the second terminal, it can be determined that the second terminal is included in the multiple first candidate terminals; then, when it is determined that the second terminal is included in the multiple first candidate terminals, the gateway information and subnet mask information of the hotspot network connected to the second terminal can be obtained according to the discovery protocol of the target hotspot network (such as the Mdns protocol, etc.). When it is determined that the gateway information and subnet mask information of the hotspot network connected to the second terminal are inconsistent with the target hotspot network, it can be determined that the network connected to the second terminal is not the target hotspot network.
[0106] When it is determined that the hotspot network connected to the second terminal is not the target hotspot network, the first terminal can send a hotspot connection prompt message including the connection information of the target hotspot network to the second terminal through the target network to which the second terminal is already connected, so that when the second terminal obtains the connection information of the target hotspot network carried in the hotspot connection prompt message, such as information including SSID / Password, etc., it first disconnects the hotspot network connected to the second terminal itself, and connects to the target network according to the hotspot connection prompt message.
[0107] By adopting the above technical solution, when the hotspot network connected to the second terminal is not the target hotspot network, the second terminal can be connected to the target hotspot network according to the hotspot connection prompt message.
[0108] In some embodiments, when the second terminal is not included in the plurality of first candidate terminals, a short-range wireless communication link is established with the second terminal by broadcasting a connection prompt message, and a hotspot connection prompt message is sent to the second terminal via the short-range wireless communication link. Alternatively, a hotspot connection prompt message may be sent to the second terminal via the target network.
[0109] Optionally, the first terminal may first detect the IP addresses of the multiple first candidate terminals according to the discovery protocol of the target hotspot network (such as the Mdns protocol, etc.), and when it is determined that the IP addresses of the multiple first candidate terminals do not include the IP address of the second terminal, it may be determined that the second terminal is not included in the multiple first candidate terminals. Then the first terminal may broadcast a connection prompt message by turning on its own Bluetooth communication module, and when the second terminal also turns on the Bluetooth communication module, the second terminal may display a connection prompt on the display interface of the second terminal according to the connection prompt message, so that the user can perform a connection operation according to the displayed connection prompt, so that the first terminal can establish a short-range wireless communication link with the second terminal, and secondly, the second terminal may send a hotspot connection prompt message to the second terminal through the short-range wireless communication link to indicate that the second terminal can connect to the target hotspot network according to the hotspot connection prompt message.
[0110] By adopting the above technical solution, the first terminal can send a hotspot connection prompt message through short-range wireless communication or the target network without opening the hotspot network, so that the second terminal can connect to the target hotspot network according to the hotspot connection prompt message.
[0111] Figure 4 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 4 As shown, the method is used in the second terminal and includes the following steps.
[0112] In step S21, a direct connection transmission request message is sent to the first terminal based on the target network to which the second terminal is connected, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on.
[0113] The direct connection transmission request message is a message requesting to transmit target data based on a direct connection network.
[0114] In this step, first, the second terminal can detect the user's operation of turning on the sharing function, wherein the sharing function can be used to share files or data with other mobile terminal devices except the first terminal, and can also receive files or data shared by other mobile terminal devices except the first terminal. When the first terminal determines that the sharing function has been turned on, it can send a direct transmission request message to the first terminal through the connected target network, such as a local area network.
[0115] In step S22, when the second terminal is connected to the target hotspot network, target data is transmitted to the first terminal according to the target hotspot network.
[0116] By adopting the above technical solution, a direct connection transmission request message can be sent to the first terminal based on the target network connected to the second terminal and the first terminal, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on. When the second terminal is connected to the target hotspot network, the target data is transmitted to the first terminal according to the target hotspot network. In this way, when the second terminal is connected to the target hotspot network, the target data can be transmitted to the first terminal according to the target hotspot network.
[0117] In some embodiments, Figure 5 As shown, the scheme also includes the following steps.
[0118] In step S23, when the second terminal is not connected to the target hotspot network, a hotspot connection prompt message sent by the first terminal is received.
[0119] The hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0120] Optionally, when the hotspot network opened by the second terminal is not the target hotspot network, the hotspot connection prompt message sent by the first terminal is received through the target network.
[0121] Optionally, when the hotspot network is not turned on, the second terminal receives a connection prompt message sent by the first terminal, establishes a short-range wireless communication link connection with the first terminal, and receives a hotspot connection prompt message sent by the first terminal through the short-range wireless communication link; or, when the hotspot network is not turned on, the second terminal receives a hotspot connection prompt message sent by the first terminal through the target network.
[0122] In step S24, the hotspot connection prompt message is displayed.
[0123] In step S25, in response to a connection operation triggered by the user based on the displayed hotspot connection prompt message, the second terminal is connected to the target hotspot network, and target data is transmitted with the first terminal according to the target hotspot network.
[0124] By adopting the above technical solution, the first terminal responds to receiving a direct transmission request message sent by the second terminal based on the target network connected to the second terminal and the first terminal, and when the first terminal turns on the target hotspot network, determines whether the second terminal is connected to the target hotspot network; the direct transmission request message is a message requesting the transmission of target data based on the direct network; when it is determined that the second terminal is connected to the target hotspot network, the target data is transmitted with the second terminal according to the target hotspot network. In this way, when the first terminal receives a direct transmission request message from the second terminal when turning on the hotspot, the second terminal can be connected to the hotspot network of the first terminal, and can be connected to the second terminal through the hotspot network without disconnecting the hotspot to share files using the sharing function, without the user having to manually close the hotspot network, thereby improving the user experience.
[0125] Figure 6 is a flow chart showing another data transmission method according to an exemplary embodiment. Figure 6 As shown, the method is used in the first terminal and the second terminal, and includes the following steps.
[0126] In step S31, the second terminal sends a direct connection transmission request message to the first terminal based on a target network to which the second terminal is connected to the first terminal.
[0127] In step S32, the first terminal searches for a plurality of first candidate terminals through the target hotspot network in response to receiving a direct connection transmission request message sent by the second terminal based on the target network to which the second terminal and the first terminal are connected, the first candidate terminals being terminals that have the hotspot network turned on;
[0128] If it is determined that the hotspot network connected to the second terminal is the target hotspot network, executing step S39;
[0129] If it is determined that the hotspot network connected to the second terminal is not the target hotspot network, executing steps S35-S39;
[0130] If it is determined that the second terminal does not have the hotspot network turned on, executing steps S33-S34 and steps S36-S39;
[0131] In step S33, the first terminal establishes a short-range wireless communication link with the second terminal by broadcasting a connection prompt message.
[0132] In step S34, the first terminal sends a hotspot connection prompt message to the second terminal via the short-range wireless communication link; or, sends a hotspot connection prompt message to the second terminal via the target network.
[0133] In step S35, the first terminal sends a hotspot connection prompt message to the second terminal through the target network, and the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0134] In step S36, the second terminal receives the hotspot connection prompt message sent by the first terminal.
[0135] In step S37, the second terminal displays the hotspot connection prompt message;
[0136] In step S38, the second terminal connects to the target hotspot network in response to a connection operation triggered by the user based on the displayed hotspot connection prompt message.
[0137] In step S39, target data is transmitted to the second terminal according to the target hotspot network.
[0138] By adopting the above technical solution, the first terminal responds to receiving a direct transmission request message sent by the second terminal based on the target network connected to the second terminal and the first terminal, and when the first terminal turns on the target hotspot network, determines whether the second terminal is connected to the target hotspot network; the direct transmission request message is a message requesting the transmission of target data based on the direct network; when it is determined that the second terminal is connected to the target hotspot network, the target data is transmitted with the second terminal according to the target hotspot network. In this way, when the first terminal receives a direct transmission request message from the second terminal when turning on the hotspot, the second terminal can be connected to the hotspot network of the first terminal, and can be connected to the second terminal through the hotspot network without disconnecting the hotspot to share files using the sharing function, without the user having to manually close the hotspot network, thereby improving the user experience.
[0139] Figure 7 FIG. 1 is a block diagram of a data transmission device according to an exemplary embodiment. Figure 7 As shown, the device 700 may include a determination module 701 and a first transmission module 702 .
[0140] The determination module 701 is configured to determine whether the second terminal is connected to the target hotspot network in response to receiving a direct connection transmission request message sent by the second terminal based on the target network connected to the second terminal and the first terminal, when the first terminal turns on the target hotspot network; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0141] The first transmission module 702 is configured to transmit target data with the second terminal according to the target hotspot network when it is determined that the second terminal is connected to the target hotspot network.
[0142] Figure 8 is based on Figure 7 The embodiment shown is a block diagram of a determination module, such as Figure 8 As shown, the determination module 701 includes:
[0143] The search submodule 7011 is configured to search for a plurality of first candidate terminals through the target hotspot network, where the first candidate terminals are terminals that have opened the hotspot network;
[0144] The first determining submodule 7012 is configured to determine whether the network connected to the second terminal is the target hotspot network when the second terminal is included in the plurality of first candidate terminals;
[0145] The second determining submodule 7013 is configured to determine that the second terminal is connected to the target hotspot network when it is determined that the network connected to the second terminal is the target hotspot network.
[0146] Fig. 9 is based on Figure 7 The embodiment shown is a block diagram of a determination module, such as Fig. 9 As shown, the determination module also includes:
[0147] The first sending submodule 7014 is configured to send a hotspot connection prompt message to the second terminal through the target network when it is determined that the hotspot network connected to the second terminal is not the target hotspot network. The hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
[0148] Fig.10 is based on Figure 7 The embodiment shown is a block diagram of a determination module, such as Fig.10 As shown, the determination module 701 also includes:
[0149] The broadcast submodule 7015 is configured to establish a short-range wireless communication link with the second terminal when the second terminal is not included in the plurality of first candidate terminals, and send a hotspot connection prompt message to the second terminal through the short-range wireless communication link; or
[0150] The second sending submodule 7016 is configured to send a hotspot connection prompt message to the second terminal through the target network.
[0151] Fig.11 FIG. 1 is a block diagram of a data transmission device according to an exemplary embodiment. Fig.11 As shown, the device 1100 may include a sending module 1101 and a second transmission module 1102 .
[0152] The sending module 1101 is configured to send a direct connection transmission request message to the first terminal based on the target network to which the second terminal is connected to the first terminal, so that the first terminal determines whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network;
[0153] The second transmission module 1102 is configured to transmit target data with the first terminal according to the target hotspot network when the second terminal is connected to the target hotspot network.
[0154] Fig.12 is based on Fig.11 The embodiment shown is a block diagram of a data transmission device, such as Fig.12 As shown, the device also includes:
[0155] The receiving module 1103 is configured to receive a hotspot connection prompt message sent by the first terminal when the second terminal is not connected to the target hotspot network, and the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network;
[0156] A display module 1104 is configured to display the hotspot connection prompt message;
[0157] The connection module 1105 is configured to connect the second terminal to the target hotspot network in response to a connection operation triggered by the user based on the displayed hotspot connection prompt message, and transmit target data with the first terminal according to the target hotspot network.
[0158] Optionally, the receiving module 1103 is configured to receive the hotspot connection prompt message sent by the first terminal through the target network when the hotspot network opened by the second terminal is not the target hotspot network.
[0159] Fig.13 is based on Fig.12 The embodiment shown is a block diagram of a data transmission device, such as Fig.13 As shown, the receiving module 1103 includes:
[0160] The receiving submodule 11031 is configured to receive a connection prompt message sent by the first terminal when the hotspot network is not turned on at the second terminal, establish a short-range wireless communication link connection with the first terminal, and receive a hotspot connection prompt message sent by the first terminal through the short-range wireless communication link; or,
[0161] The third sending submodule 11032 is configured to receive the hotspot connection prompt message sent by the first terminal through the target network when the hotspot network is not turned on at the second terminal.
[0162] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0163] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data transmission method provided by the present disclosure are implemented.
[0164] Fig.14 1 is a block diagram of a data transmission device 1400 according to an exemplary embodiment. For example, the device 1400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0165] Reference Fig.14 , the device 1400 may include one or more of the following components: a processing component 1402 , a memory 1404 , a power component 1406 , a multimedia component 1408 , an audio component 1410 , an input / output interface 1412 , a sensor component 1414 , and a communication component 1416 .
[0166] The processing component 1402 generally controls the overall operation of the device 1400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1402 may include one or more processors 1420 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1402 may include one or more modules to facilitate the interaction between the processing component 1402 and other components. For example, the processing component 1402 may include a multimedia module to facilitate the interaction between the multimedia component 1408 and the processing component 1402.
[0167] The memory 1404 is configured to store various types of data to support operations on the device 1400. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 1404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 disk or optical disk.
[0168] The power supply component 1406 provides power to the various components of the device 1400. The power supply component 1406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1400.
[0169] The multimedia component 1408 includes a screen that provides an output interface between the device 1400 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 input signals from the 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 boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1408 includes a front camera and / or a rear camera. When the device 1400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0170] The audio component 1410 is configured to output and / or input audio signals. For example, the audio component 1410 includes a microphone (MIC), and when the device 1400 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1404 or sent via the communication component 1416. In some embodiments, the audio component 1410 also includes a speaker for outputting audio signals.
[0171] The input / output interface 1412 provides an interface between the processing component 1402 and the 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.
[0172] The sensor assembly 1414 includes one or more sensors for providing various aspects of the status assessment of the device 1400. For example, the sensor assembly 1414 can detect the open / closed state of the device 1400, the relative positioning of components, such as the display and keypad of the device 1400, the sensor assembly 1414 can also detect the position change of the device 1400 or a component of the device 1400, the presence or absence of user contact with the device 1400, the orientation or acceleration / deceleration of the device 1400, and the temperature change of the device 1400. The sensor assembly 1414 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1414 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1414 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0173] The communication component 1416 is configured to facilitate wired or wireless communication between the device 1400 and other devices. The device 1400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0174] In an exemplary embodiment, the device 1400 can 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, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0175] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1404 including instructions, and the instructions can be executed by a processor 1420 of the device 1400 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0176] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0177] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data transmission method, characterized in that: The method is applied to a first terminal, and the method includes: In response to receiving a direct connection transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, determining whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network; When it is determined that the second terminal is connected to the target hotspot network, target data is transmitted to the second terminal according to the target hotspot network.
2. The method according to claim 1, characterized in that: The determining whether the second terminal is connected to the target hotspot network includes: Searching for a plurality of first candidate terminals through the target hotspot network, where the first candidate terminals are terminals that have opened the hotspot network; In a case where the second terminal is included in the plurality of first candidate terminals, determining whether the network connected by the second terminal is the target hotspot network; In a case where it is determined that the network to which the second terminal is connected is the target hotspot network, it is determined that the second terminal is connected to the target hotspot network.
3. The method according to claim 2, characterized in that The method further comprises: When it is determined that the hotspot network connected to the second terminal is not the target hotspot network, a hotspot connection prompt message is sent to the second terminal via the target network, where the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network.
4. The method according to claim 2, characterized in that: The method further comprises: In the case that the second terminal is not included in the plurality of first candidate terminals, a short-range wireless communication link is established with the second terminal, and a hotspot connection prompt message is sent to the second terminal through the short-range wireless communication link; or A hotspot connection prompt message is sent to the second terminal via the target network.
5. A data transmission method, characterized in that: The method is applied to a second terminal, and the method includes: Sending a direct connection transmission request message to the first terminal based on the target network connected to the second terminal, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network; When the second terminal is connected to the target hotspot network, target data is transmitted to the first terminal according to the target hotspot network.
6. The method according to claim 5, characterized in that The method further comprises: When the second terminal is not connected to the target hotspot network, receiving a hotspot connection prompt message sent by the first terminal, wherein the hotspot connection prompt message is used to prompt the second terminal to connect to the target hotspot network; Displaying the hotspot connection prompt message; In response to a connection operation triggered by the user based on the displayed hotspot connection prompt message, the second terminal is connected to the target hotspot network, and target data is transmitted with the first terminal according to the target hotspot network.
7. The method according to claim 6, characterized in that The receiving the hotspot connection prompt message sent by the first terminal includes: When the hotspot network opened by the second terminal is not the target hotspot network, a hotspot connection prompt message sent by the first terminal is received through the target network.
8. The method according to claim 6, characterized in that The receiving the hotspot connection prompt message sent by the first terminal includes: When the second terminal does not open the hotspot network, establish a short-range wireless communication link connection with the first terminal, and receive a hotspot connection prompt message sent by the first terminal through the short-range wireless communication link; or When the second terminal does not open the hotspot network, the hotspot connection prompt message sent by the first terminal is received through the target network.
9. A data transmission device, characterized in that: The device comprises: a determination module configured to determine, in response to receiving a direct connection transmission request message sent by a second terminal based on a target network connected to the second terminal and the first terminal, whether the second terminal is connected to the target hotspot network when the first terminal turns on the target hotspot network; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network; The first transmission module is configured to transmit target data with the second terminal according to the target hotspot network when it is determined that the second terminal is connected to the target hotspot network.
10. A data transmission device, characterized in that: The device comprises: A sending module, configured to send a direct connection transmission request message to the first terminal based on a target network to which the second terminal is connected, so that the first terminal can determine whether the second terminal is connected to the target hotspot network when the target hotspot network is turned on; the direct connection transmission request message is a message requesting transmission of target data based on the direct connection network; The second transmission module is configured to transmit target data with the first terminal according to the target hotspot network when the second terminal is connected to the target hotspot network.
11. A data transmission device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the steps of the method according to any one of claims 1 to 4 when executed.
12. A data transmission device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the steps of the method described in any one of claims 5 to 8 when executed.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 5 to 8 are implemented.