CN106413125B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN106413125B
CN106413125B CN201510466583.1A CN201510466583A CN106413125B CN 106413125 B CN106413125 B CN 106413125B CN 201510466583 A CN201510466583 A CN 201510466583A CN 106413125 B CN106413125 B CN 106413125B
Authority
CN
China
Prior art keywords
connection
offline
account
server
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510466583.1A
Other languages
Chinese (zh)
Other versions
CN106413125A (en
Inventor
王达峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510466583.1A priority Critical patent/CN106413125B/en
Publication of CN106413125A publication Critical patent/CN106413125A/en
Application granted granted Critical
Publication of CN106413125B publication Critical patent/CN106413125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data transmission method and device, and belongs to the technical field of computers. The method comprises the following steps: the method comprises the steps that first connection is established between an offline device and a transfer device, wherein the transfer device is a device capable of simultaneously keeping two different network connections; the off-line equipment receives data sent by the transfer equipment through the first connection, wherein the data are acquired by the transfer equipment through a second connection established with the server; or the off-line equipment sends the data to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; wherein, first connection is that WiFi connects and the second is connected for WiFi Direct, or, first connection is that WiFi Direct connects and the second is connected for WiFi, or, first connection is that WiFi Direct connects, the second is connected for mobile network. The invention solves the problem that the off-line equipment can not transmit data with the server, and achieves the effect of data sharing.

Description

Data transmission method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data transmission method and apparatus.
Background
Electronic devices such as motion cameras, automobile data recorders, vehicle-mounted mp3 and drones generate some usage data during use, and users can transmit the usage data to the server, so that the usage data can be stored and shared by the server.
A data transmission method provided in the related art includes: the electronic equipment detects whether a wireless network exists, and when the wireless network exists, the electronic equipment accesses the wireless network, establishes connection with the server through the wireless network, and transmits the use data to the server through the connection.
Since these electronic devices are all used in mobile scenarios where there is little wireless network available, the electronic devices are unable to transmit usage data to the server.
Disclosure of Invention
In order to solve the problem that offline equipment cannot perform data transmission with a server, embodiments of the present invention provide a data transmission method and apparatus. The technical scheme is as follows:
in a first aspect, a data transmission method is provided, where the method includes:
establishing a first connection between an offline device and a transit device, wherein the transit device is a device capable of simultaneously keeping two different network connections, and an Instant Messaging (IM) plug-in for transit data between the offline device and a server is operated in the transit device;
the offline device receives data sent by the transfer device through the first connection, wherein the data is acquired by the transfer device through a second connection established with a server; or, the offline device sends data to the transit device through the first connection, so that the transit device sends the data to the server through a second connection established with the server;
wherein, first connection just for wireless fidelity wiFi connection the second is connected for wiFi Direct, or, first connection just for wiFi Direct connection the second is connected for wiFi, or, first connection is connected for wiFi Direct, the second is connected for mobile network.
In a second aspect, a data transmission method is provided, the method including:
the method comprises the steps that a first connection is established between a transfer device and an offline device, the transfer device is a device capable of simultaneously keeping two different network connections, and an Instant Messaging (IM) plug-in used for transferring data between the offline device and a server is operated in the transfer device;
the transfer device sends data to the offline device through the first connection, wherein the data is acquired by the transfer device through a second connection established with a server; or, the transit device receives the data sent by the offline device through the first connection, and sends the data to the server through a second connection established with the server;
wherein, first connection just for wireless fidelity wiFi connection the second is connected for wiFi Direct, or, first connection just for wiFi Direct connection the second is connected for wiFi, or, first connection is connected for wiFi Direct, the second is connected for mobile network.
In a third aspect, a data transmission apparatus is provided, where the apparatus is used in an offline device, and the apparatus includes:
the connection establishing module is used for establishing a first connection with a transfer device, the transfer device is a device capable of simultaneously keeping two different network connections, and an instant messaging IM plug-in used for transferring data between the offline device and the server is operated in the transfer device;
a data transmission module, configured to receive, through the first connection established by the connection establishment module, data sent by the relay device, where the data is obtained by the relay device through a second connection established with a server; or, the data is sent to the transit device through the first connection established by the connection establishing module, so that the transit device sends the data to the server through a second connection established with the server;
wherein, first connection just for wireless fidelity wiFi connection the second is connected for wiFi Direct, or, first connection just for wiFi Direct connection the second is connected for wiFi, or, first connection is connected for wiFi Direct, the second is connected for mobile network.
In a fourth aspect, a data transmission apparatus is provided, where the data transmission apparatus is used in a relay device, where the relay device is a device capable of maintaining two different network connections simultaneously, and the apparatus includes:
the connection establishing module is used for establishing a first connection with an offline device, and an instant messaging IM plug-in used for transferring data between the offline device and a server runs in the transferring device;
the data transmission module is used for sending data to the offline device through the first connection established by the connection establishment module, wherein the data is acquired by the transfer device through a second connection established with a server; or, receiving the data sent by the offline device through the first connection established by the connection establishing module, and sending the data to the server through a second connection established with the server;
wherein, first connection just for wireless fidelity wiFi connection the second is connected for wiFi Direct, or, first connection just for wiFi Direct connection the second is connected for wiFi, or, first connection is connected for wiFi Direct, the second is connected for mobile network.
In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is used for implementing the above-mentioned data transmission method or implementing the above-mentioned data transmission method.
The technical scheme provided by the embodiment of the invention has the beneficial effects that:
establishing a first connection with a transfer device; receiving data sent by the transfer equipment through the first connection, wherein the data is acquired by the transfer equipment through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a diagram of an implementation environment in which various embodiments of the present invention are implemented;
fig. 2 is a flowchart of a method of data transmission according to an embodiment of the present invention;
fig. 3 is a flowchart of a method of data transmission according to another embodiment of the present invention;
fig. 4 is a flowchart of a method of data transmission according to an embodiment of the present invention;
fig. 5 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of a data transmission apparatus according to still another embodiment of the present invention;
fig. 7 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram of a data transmission apparatus according to still another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, an implementation environment according to various embodiments of the present invention is shown, where fig. 1 includes an offline device 110, a transit device 120, and a server 130.
The offline device 110 is an electronic device running an application for providing a communication interface that provides a set of network interfaces through which the offline device 110 can implement data upload and download capabilities. The offline device 110 may be an electronic device such as a motion camera, a car recorder, a car mp3, or a drone, among others.
The relay device 120 is installed with a set of application programs running on the relay device 120 and used for data between the relay server 130 and the offline device 110, and the application programs run in the form of IM (Instant Messaging) plug-in, so that the application programs have the characteristics of instantaneity and easy acquisition of IM.
The server 130 provides an Interface program, which is written in C language, and runs on the server 130 of the offline device 110 in the form of Fast Common Gateway Interface (FCGI), where the server 130 may be a newly built server dedicated to the present invention, or an original server of the offline device 110, and the present invention is not limited thereto.
In the present invention, the relay device 120 is a device capable of maintaining two different Network connections simultaneously, such as a device using a Mac operating system or a device using an Android operating system capable of virtualizing a Network card into two Network interfaces (Network interfaces). For example, one of the network interfaces corresponds to a WiFi (wireless Fidelity) operating mode, and the other network interface corresponds to a WiFi Direct operating mode, so that the relay device 120 may establish a first connection with the offline device 110 through one of the network interfaces and establish a second connection with the server 130 through the other network interface. If the first connection is a WiFi connection, the second connection is a WiFi Direct connection; when the first connection is a WiFi Direct connection, the second connection is a WiFi connection; when the first connection is a WiFi Direct connection, the second connection is a data network connection.
The WiFi network includes a main control device and a plurality of access devices, where the main control device is in an AP (access point) mode, and the access devices are in a Station mode. The WiFi Direct network comprises a plurality of peer devices, each peer device simultaneously supports an AP mode and a Station mode, one of the peer devices is in the AP mode at the same time, and the other peer devices are in the Station mode.
Referring to fig. 2, a flowchart of a method for data transmission according to an embodiment of the present invention is shown, where the method for data transmission can be applied to an offline device. The data transmission method comprises the following steps:
step 201, the offline device establishes a first connection with a transit device, where the transit device is a device capable of maintaining two different network connections simultaneously.
Step 202, the offline device receives data sent by the transit device through the first connection, wherein the data is acquired by the transit device through a second connection established with the server; or the offline device sends the data to the transit device through the first connection, so that the transit device sends the data to the server through a second connection established with the server.
The first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
In summary, in the data transmission method provided in the embodiment of the present invention, the first connection is established with the transfer device; receiving data sent by the transfer equipment through the first connection, wherein the data is acquired by the transfer equipment through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 3, a flowchart of a data transmission method according to another embodiment of the present invention is shown, where the data transmission method can be applied to a relay device. The data transmission method comprises the following steps:
step 301, a transit device establishes a first connection with an offline device, where the transit device is a device capable of maintaining two different network connections simultaneously.
Step 302, the transfer device sends data to the offline device through the first connection, wherein the data is obtained by the transfer device through the second connection established with the server; or, the transfer device receives the data sent by the offline device through the first connection, and sends the data to the server through the second connection established with the server.
The first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
In summary, in the data transmission method provided in the embodiment of the present invention, the first connection is established with the offline device; sending data to the offline device through the first connection, wherein the data is acquired by the transfer device through a second connection established with the server; or, receiving data sent by the offline device through the first connection, and sending the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 4, a flowchart of a data transmission method according to another embodiment of the present invention is shown, where the data transmission method can be applied to a system including an offline device and a relay device. The data transmission method comprises the following steps:
step 401, a first connection is established between an offline device and a transit device, where the transit device is a device capable of maintaining two different network connections simultaneously.
The method comprises the steps that offline equipment periodically broadcasts a data packet to the outside through a WiFi Direct, the data packet comprises an SSID (Service Set Identifier) and a BSSID (Basic Service Set Identifier), after receiving the data packet, transit equipment judges whether the offline equipment is supported or not according to the data packet, when the transit equipment determines that the offline equipment is supported, first connection is established between the transit equipment and the offline equipment, and when the transit equipment determines that the offline equipment is not supported, the flow is ended.
When the first connection is established, there is a second connection established between the relay device and the server, and the relay device may disconnect the second connection or may not disconnect the second connection.
Step 402, the transfer device sends a device information request to the offline device through the first connection.
The device request information is used for requesting device information of the offline device, the device information at least includes a device identifier and binding indication information, the device identifier includes a PID (Product ID) and an SN (Serial Number), and the binding indication information is used for indicating whether the offline device has a main device and an offline device account. The offline device account is used to identify the offline device during data transmission, and may be an account of an application running on the offline device, such as a micro signal, a QQ number, and the like. It should be noted that the application program is also run in the transfer device, and therefore, the transfer device has a transfer device account, and the transfer device account is used for identifying the transfer device in the data transmission process.
In this embodiment, the offline device cannot be networked, and therefore, the offline device cannot directly request the server to allocate the offline device account, and the relay device needs to request the server to allocate the offline device account for the offline device. The offline device only has one master device at the same time, and the offline device accounts requested by different master devices for the offline device may be the same or different, which is not limited in this embodiment.
Step 403, the offline device receives the device information request sent by the transit device through the first connection.
Step 404, the offline device sends device information to the transit device through the first connection, where the device information includes a device identifier and binding indication information of the offline device.
Step 405, the transit device receives the device information sent by the offline device through the first connection.
Step 406, when the binding indication information indicates that the offline device does not have the account of the main device and the account of the offline device, the transit device sends a main device request to the offline device through the first connection, where the main device request is used to request to become the main device of the offline device.
In this embodiment, whether the offline device has the main device and the offline device account may be indicated by setting a flag bit for the binding indication information. For example, when the value of the flag bit is 1, indicating that the offline device has the account numbers of the main device and the offline device; and when the value of the flag bit is 0, indicating that the offline device does not have the account numbers of the main device and the offline device. Of course, whether the offline device has the main device and the offline device account may also be indicated by other manners, and the specific implementation manner of the binding indication information is not limited in this embodiment.
It should be noted that, when the binding indication information indicates that the offline device has the main device and the offline device account, the process is ended.
Step 407, the offline device receives the master device request sent by the transit device through the first connection.
The master device request may be specifically a winner request.
Step 408, the offline device sends a confirmation message to the transit device through the first connection.
Step 409, the transit device receives the confirmation information sent by the offline device through the first connection.
Step 410, the transit device establishes a second connection, sends an account allocation request including the device identifier of the offline device to the server through the second connection, and receives an offline device account allocated by the server for the offline device according to the account allocation request from the server.
When the transit device establishes the second connection with the server, the transit device may disconnect the first connection established with the offline device, or may not disconnect the first connection.
After receiving the device identifier, the server allocates an offline device account to the offline device, and sends the offline device account to the transfer device through the second connection.
Optionally, when the server obtains the transit device account, the server may also bind the offline device account with the transit device account. The transit device account may be sent by the transit device when sending the device identifier, or may be pre-stored in the server, which is not limited in this embodiment.
Step 411, the transit device sends the offline device account to the offline device through the first connection.
When the transfer equipment keeps the first connection, the transfer equipment directly sends an offline equipment account to the offline equipment through the first connection; when the transit device has disconnected the first connection, it is also necessary to establish the first connection with the offline device first, and send the offline device account to the offline device through the first connection. When the first connection is established, the relay device may disconnect the second connection, or may not disconnect the second connection, which is not limited in this embodiment.
The transit device may further send the transit device account to the offline device through the first connection, so that the offline device may send data to the transit device corresponding to the transit device account.
In step 412, the offline device receives the offline device account sent by the transit device through the first connection.
When the transit device sends the transit device account to the offline device, the offline device also receives the transit device account through the first connection.
In step 413, the offline device modifies the binding indication information, where the modified binding indication information is used to indicate that the offline device has the main device and the offline device account.
For example, when the flag bit indicates whether the offline device has the main device and the offline device account, the offline device may modify the value of the flag bit.
After the offline device obtains the offline device account, the offline device may perform data transmission with the transfer device. Next, steps 414 and 415 describe a process in which the relay device sends data to the offline device, and steps 416 and 417 describe a process in which the offline device sends data to the relay device. In practical application, only the transit device may be supported to send data to the offline device, only the offline device may be supported to send data to the transit device, and the transit device may also be supported to send data to the offline device and simultaneously send data to the transit device, which is not limited in this embodiment. When the transfer device is simultaneously supported to send data to the offline device and the offline device sends data to the transfer device, the sequence of execution is not limited in this example.
Step 414, the transfer device sends data to the offline device corresponding to the offline device account through the first connection, where the data is obtained by the transfer device through the second connection established with the server.
The transit device may first obtain the data in the server through the second connection, and then send the data to the offline device corresponding to the offline device account through the first connection. When the transit equipment keeps the first connection, the transit equipment directly sends data to the offline equipment through the first connection; when the transit device has disconnected the first connection, it is also necessary to establish the first connection with the offline device first, and send data to the offline device through the first connection. When the first connection is established, the relay device may disconnect the second connection, or may not disconnect the second connection, which is not limited in this embodiment.
Step 415, the offline device receives the data sent by the transit device through the offline device account and the first connection.
Step 416, the offline device sends the data to the transit device through the offline device account and the first connection.
Step 417, the transit device receives the data sent by the offline device through the offline device account through the first connection, and sends the data to the server through the second connection established with the server.
The relay device may receive data sent by the offline device through the first connection, and then send the data to the server through the second connection. When the transfer equipment keeps the second connection, the transfer equipment directly sends data to the server through the second connection; when the relay device has disconnected the second connection, it is also necessary to establish the second connection with the server first. When the second connection is established, the relay device may disconnect the first connection or may not disconnect the first connection, which is not limited in this embodiment.
Optionally, the method provided in this embodiment further includes:
the transfer equipment sends a binding releasing request comprising a transfer equipment account and an off-line equipment account of the transfer equipment to the server through the second connection;
the transfer equipment receives unbinding notification information sent by the server through the second connection, wherein the unbinding notification information is sent to the transfer equipment after the server unbinds the transfer equipment account and the off-line equipment account bound in the account allocation process according to the unbinding request;
the transfer equipment sends the unbinding notification information to the offline equipment through the first connection;
the off-line equipment receives unbinding notification information sent by the transfer equipment through the first connection;
and the offline device modifies the binding indication information again, and the modified binding indication information is used for indicating that the offline device does not have the main device and the offline device account.
When the transfer equipment needs to release the binding relation with the offline equipment, firstly, a unbinding request comprising a transfer equipment account and an offline equipment account is sent to the server through a second connection, wherein when the transfer equipment keeps the second connection, the transfer equipment directly sends the unbinding request to the server through the second connection; when the relay device has disconnected the second connection, it is also necessary to establish the second connection with the server first. When the second connection is established, the relay device may disconnect the first connection or may not disconnect the first connection, which is not limited in this embodiment.
The server removes the binding relationship between the transfer equipment account and the off-line equipment account according to the unbinding request, generates unbinding notification information and sends the unbinding notification information to the transfer equipment through the second connection. The transfer equipment sends the unbinding notification information to the offline equipment through the first connection, and when the transfer equipment keeps the first connection, the transfer equipment directly sends the unbinding notification information to the offline equipment through the first connection; when the transit device has disconnected the first connection, it is also necessary to establish the first connection with the offline device first. When the first connection is established, the relay device may disconnect the second connection, or may not disconnect the second connection, which is not limited in this embodiment.
And the offline equipment modifies the binding indication information into the binding indication information according to the unbinding notification information, wherein the binding indication information is used for indicating that the offline equipment does not have the main equipment and the offline equipment account. For example, the offline device may modify the value of the flag bit of the binding indication information.
In summary, in the data transmission method provided in the embodiment of the present invention, the first connection is established with the transfer device; receiving data sent by the transfer equipment through the first connection, wherein the data is acquired by the transfer equipment through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 5, a block diagram of a data transmission apparatus provided in an embodiment of the present invention is shown, where the data transmission apparatus can be applied to an offline device. The data transmission device includes:
a connection establishing module 510, configured to establish a first connection with a transit device, where the transit device is a device capable of maintaining two different network connections simultaneously;
a data transmission module 520, configured to receive, through the first connection established by the connection establishment module 510, data sent by the relay device, where the data is obtained by the relay device through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection established by the connection establishing module, so that the transfer equipment sends the data to the server through the second connection established with the server;
the first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
In summary, the data transmission apparatus provided in the embodiment of the present invention establishes the first connection with the transfer device; receiving data sent by the transfer equipment through the first connection, wherein the data is acquired by the transfer equipment through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 6, a block diagram of a data transmission apparatus according to still another embodiment of the present invention is shown, where the data transmission apparatus can be applied to an offline device. The data transmission device includes: a connection establishment module 610 and a data transmission module 620.
A connection establishing module 610, configured to establish a first connection with a relay device, where the relay device is a device capable of maintaining two different network connections simultaneously;
a data transmission module 620, configured to receive, through the first connection established by the connection establishment module 610, data sent by the relay device, where the data is obtained by the relay device through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection established by the connection establishing module, so that the transfer equipment sends the data to the server through the second connection established with the server;
the first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
Optionally, the apparatus provided in this embodiment further includes:
an account acquiring module 630, configured to acquire, by the transit device, an offline device account allocated by the server after the connection establishing module 610 establishes the first connection with the transit device;
correspondingly, the data transmission module 620 is specifically configured to: receiving data sent by the transfer equipment through the offline equipment account and the first connection; or, the data is sent to the transfer device through the offline device account and the first connection.
Optionally, the account number obtaining module 630 includes:
a first receiving unit 631, configured to receive, through the first connection, a master device request sent by the relay device, where the master device request is used to request to become a master device of the offline device;
an information sending unit 632, configured to send confirmation information to the relay device through the first connection, so that the relay device establishes a second connection, send an account allocation request including a device identifier of the offline device to the server through the second connection, and receive, from the server, an offline device account allocated by the server for the offline device according to the account allocation request;
the second receiving unit 633 is configured to receive, through the first connection, the offline device account sent by the relay device.
Optionally, the first receiving unit 631 is specifically configured to:
receiving an equipment information request sent by the transfer equipment through the first connection;
sending equipment information to the transfer equipment through the first connection, wherein the equipment information comprises equipment identification and binding indication information of the offline equipment;
and when the binding indication information indicates that the offline device does not have the main device and the offline device account, receiving a main device request sent by the transit device through the first connection.
Optionally, the apparatus provided in this embodiment further includes:
a first modifying module 640, configured to modify the binding indication information after the account acquiring module 630 acquires the offline device account allocated by the server through the transit device, where the modified binding indication information is used to indicate that the offline device has the main device and the offline device account.
Optionally, the apparatus provided in this embodiment further includes:
an information receiving module 650, configured to receive, by the first modifying module 640, unbinding notification information sent by the transfer device through the first connection after the binding indication information is modified, where the unbinding notification information is a request for the transfer device to send, to the server through the second connection, a request for unbinding the transfer device account and the offline device account of the transfer device, and the server unbinds the transfer device account and the offline device account bound in the account allocation process according to the unbinding request and then sends the unbound transfer device account and the offline device account to the transfer device;
a second modifying module 660, configured to modify the binding indication information again, where the modified binding indication information is used to indicate that the offline device does not have the main device and the offline device account.
In summary, the data transmission apparatus provided in the embodiment of the present invention establishes the first connection with the transfer device; receiving data sent by the transfer equipment through the first connection, wherein the data is acquired by the transfer equipment through a second connection established with the server; or, the data is sent to the transfer equipment through the first connection, so that the transfer equipment sends the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 7, a block diagram of a data transmission apparatus according to an embodiment of the present invention is shown, where the data transmission apparatus can be applied to a relay device, and the relay device is a device capable of simultaneously maintaining two different network connections. The data transmission device includes:
a connection establishing module 710, configured to establish a first connection with an offline device;
a data transmission module 720, configured to send data to the offline device through the first connection established by the connection establishment module 710, where the data is obtained by the relay device through a second connection established with the server; or, receiving data sent by the offline device through a first connection established by the connection establishing module, and sending the data to the server through a second connection established with the server;
the first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
In summary, the data transmission apparatus provided in the embodiment of the present invention establishes the first connection with the offline device; sending data to the offline device through the first connection, wherein the data is acquired by the transfer device through a second connection established with the server; or, receiving data sent by the offline device through the first connection, and sending the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
Referring to fig. 8, a block diagram of a data transmission apparatus according to still another embodiment of the present invention is shown, where the data transmission apparatus can be applied to a relay device, and the relay device is a device capable of simultaneously maintaining two different network connections. The data transmission device includes: a connection establishment module 810 and a data transmission module 820.
A connection establishing module 810, configured to establish a first connection with an offline device;
a data transmission module 820, configured to send data to the offline device through the first connection established by the connection establishment module 810, where the data is obtained by the relay device through the second connection established with the server; or, receiving data sent by the offline device through a first connection established by the connection establishing module, and sending the data to the server through a second connection established with the server;
the first connection is a WiFi connection and the second connection is a WiFi Direct connection, or the first connection is a WiFiDirect connection and the second connection is a WiFi connection, or the first connection is a WiFi Direct connection and the second connection is a mobile network connection.
Optionally, the apparatus provided in this embodiment further includes:
a first sending module 830, configured to send the offline device account allocated by the server to the offline device after the connection establishing module 810 establishes a first connection with the offline device;
correspondingly, the data transmission module 820 is specifically configured to: sending the data to the offline equipment corresponding to the offline equipment account through the first connection; or, receiving data sent by the offline device through the offline device account through the first connection.
Optionally, the first sending module 830 includes:
a first transmitting unit 831 configured to transmit a master request to the offline device through the first connection, the master request requesting a master to become the offline device;
a first receiving unit 832, configured to receive, through the first connection, acknowledgement information sent by the offline device;
a connection establishing unit 833, configured to establish a second connection, send an account allocation request including a device identifier of the offline device to the server through the second connection, and receive, from the server, an offline device account allocated to the offline device by the server according to the account allocation request;
a second sending unit 834, configured to send the offline device account to the offline device through the first connection.
Optionally, the first sending unit 831 is specifically configured to:
before sending a main equipment request to the offline equipment through the first connection, sending an equipment information request to the offline equipment through the first connection;
receiving equipment information sent by the offline equipment through the first connection, wherein the equipment information comprises equipment identification and binding indication information of the offline equipment;
and when the binding indication information indicates that the offline device does not have the main device and the offline device account, sending a main device request to the offline device through the first connection.
Optionally, the apparatus provided in this embodiment further includes:
a second sending module 840, configured to send a request for unbinding the transit device account and the offline device account of the transit device to the server through the second connection;
the information receiving module 850 is configured to receive unbinding notification information sent by the server through the second connection, where the unbinding notification information is sent to the transfer device after the server unbinds the transfer device account and the offline device account bound in the account allocation process according to the unbinding request;
a third sending module 860, configured to send the unbinding notification message to the offline device through the first connection.
In summary, the data transmission apparatus provided in the embodiment of the present invention establishes the first connection with the offline device; sending data to the offline device through the first connection, wherein the data is acquired by the transfer device through a second connection established with the server; or, receiving data sent by the offline device through the first connection, and sending the data to the server through a second connection established with the server; the transfer device simultaneously keeps the first connection and the second connection, and can receive data sent by the server through the transfer device or send the data to the server through the transfer device, so that the problem that the off-line device cannot transmit the data with the server is solved, and the effect of data sharing is achieved.
It should be noted that: in the data transmission device provided in the above embodiment, only the division of the functional modules is illustrated when data transmission is performed, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the data transmission device is divided into different functional modules to complete all or part of the functions described above. In addition, the data transmission device and the data transmission method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (15)

1. A method of data transmission, the method comprising:
establishing a first connection between an offline device and a transit device, wherein the transit device is a device capable of simultaneously keeping two different network connections, and an Instant Messaging (IM) plug-in for transit data between the offline device and a server is operated in the transit device;
the offline device receives a main device request sent by the transit device through the first connection, wherein the main device request is used for requesting to become a main device of the offline device;
the off-line equipment sends confirmation information to the transfer equipment through the first connection so that the transfer equipment establishes a second connection with a server, sends an account allocation request comprising an equipment identifier of the off-line equipment to the server through the second connection, and receives an off-line equipment account allocated to the off-line equipment by the server according to the account allocation request from the server;
the offline device receives the offline device account sent by the transfer device through the first connection;
the offline device receives data sent by the transfer device through the offline device account and the first connection, wherein the data is acquired by the transfer device through a second connection established with a server; or, the offline device sends data to the transit device through the offline device account and the first connection, so that the transit device sends the data to the server through a second connection established with the server;
the first connection is a wireless fidelity (WiFi) connection and the second connection is a WiFi Direct connection, or the first connection is a WiFi Direct connection and the second connection is a WiFi connection, or the first connection is a WiFiDirect connection and the second connection is a mobile network connection.
2. The method of claim 1, wherein the receiving, by the offline device, the master device request sent by the relay device via the first connection comprises:
the offline device receives a device information request sent by the transfer device through the first connection;
the offline device sends device information to the transfer device through the first connection, wherein the device information comprises a device identifier and binding indication information of the offline device;
and when the binding indication information indicates that the offline device does not have a main device and an offline device account, the offline device receives the main device request sent by the transfer device through the first connection.
3. The method of claim 2, wherein after the offline device obtains the offline device account allocated by the server through the transit device, the method further comprises:
and the offline device modifies the binding indication information, and the modified binding indication information is used for indicating that the offline device has a main device account and an offline device account.
4. The method of claim 3, wherein after the offline device modifies the binding indication information, the method further comprises:
the off-line equipment receives unbinding notification information sent by the transfer equipment through the first connection, the unbinding notification information is that the transfer equipment sends a transfer equipment account of the transfer equipment and an unbinding request of the off-line equipment account to the server through the second connection, and the server unbinds the transfer equipment account and the off-line equipment account bound in the account allocation process according to the unbinding request and then sends the unbound transfer equipment account and the off-line equipment account to the transfer equipment;
and the offline device modifies the binding indication information again, and the modified binding indication information is used for indicating that the offline device does not have the main device and the offline device account.
5. A method of data transmission, the method comprising:
the method comprises the steps that a first connection is established between a transfer device and an offline device, the transfer device is a device capable of simultaneously keeping two different network connections, and an Instant Messaging (IM) plug-in used for transferring data between the offline device and a server is operated in the transfer device;
the transit device sends a master device request to the offline device through the first connection, wherein the master device request is used for requesting to become a master device of the offline device;
the transit equipment receives confirmation information sent by the offline equipment through the first connection;
the transit device establishes a second connection, sends an account allocation request including the device identifier of the offline device to the server through the second connection, and receives an offline device account allocated to the offline device by the server according to the account allocation request from the server;
the transit equipment sends the offline equipment account to the offline equipment through the first connection; the transit device sends data to the offline device corresponding to the offline device account through the first connection, wherein the data is acquired by the transit device through the second connection established with the server; or, the transit device receives, through the first connection, data sent by the offline device through the offline device account, and sends the data to the server through the second connection established with the server;
the first connection is a wireless fidelity (WiFi) connection and the second connection is a WiFi Direct connection, or the first connection is a WiFi Direct connection and the second connection is a WiFi connection, or the first connection is a WiFiDirect connection and the second connection is a mobile network connection.
6. The method of claim 5, wherein the transit device sending a master device request to the offline device over the first connection comprises:
the transit equipment sends an equipment information request to the offline equipment through the first connection;
the transit device receives device information sent by the offline device through the first connection, wherein the device information comprises a device identifier and binding indication information of the offline device;
and when the binding indication information indicates that the offline device does not have the main device and the offline device account, the transit device sends the main device request to the offline device through the first connection.
7. The method of claim 5 or 6, further comprising:
the transfer equipment sends a transfer equipment account of the transfer equipment and a unbinding request of the offline equipment account to the server through the second connection;
the transfer equipment receives unbinding notification information sent by the server through the second connection, wherein the unbinding notification information is sent to the transfer equipment after the server unbinds the transfer equipment account and the off-line equipment account bound in the account allocation process according to the unbinding request;
and the transfer equipment sends the unbinding notification information to the offline equipment through the first connection.
8. A data transmission apparatus for use in an offline device, the apparatus comprising:
the connection establishing module is used for establishing a first connection with a transfer device, the transfer device is a device capable of simultaneously keeping two different network connections, and an instant messaging IM plug-in used for transferring data between the offline device and the server is operated in the transfer device;
the account acquisition module is used for acquiring an offline device account distributed by the server through the transit device after the connection establishment module establishes first connection with the transit device; the account number obtaining module comprises: a first receiving unit, configured to receive, through the first connection, a master device request sent by the relay device, where the master device request is used to request to become a master device of the offline device; an information sending unit, configured to send confirmation information to the transfer device through the first connection, so that the transfer device establishes a second connection, send an account allocation request including a device identifier of the offline device to the server through the second connection, and receive, from the server, an offline device account allocated by the server to the offline device according to the account allocation request; a second receiving unit, configured to receive, through the first connection, the offline device account sent by the transfer device;
a data transmission module, configured to receive, through the offline device account and the first connection established by the connection establishment module, data sent by the relay device, where the data is obtained by the relay device through a second connection established with a server; or, sending data to the transit device through the offline device account and the first connection established by the connection establishment module, so that the transit device sends the data to the server through a second connection established with the server;
the first connection is a wireless fidelity (WiFi) connection and the second connection is a WiFi Direct connection, or the first connection is a WiFi Direct connection and the second connection is a WiFi connection, or the first connection is a WiFiDirect connection and the second connection is a mobile network connection.
9. The apparatus of claim 8, wherein the first receiving unit is specifically configured to:
receiving an equipment information request sent by the transfer equipment through the first connection;
sending equipment information to the transfer equipment through the first connection, wherein the equipment information comprises an equipment identifier and binding indication information of the offline equipment;
and when the binding indication information indicates that the offline device does not have the main device and the offline device account, receiving the main device request sent by the transfer device through the first connection.
10. The apparatus of claim 9, further comprising:
and the first modification module is used for modifying the binding indication information after the account acquisition module acquires the offline device account distributed by the server through the transit device, wherein the modified binding indication information is used for indicating that the offline device has a main device account and an offline device account.
11. The apparatus of claim 10, further comprising:
an information receiving module, configured to receive, by the first modification module, unbinding notification information sent by the transfer device through the first connection after the binding indication information is modified by the first modification module, where the unbinding notification information is a request for unbinding, to the server, the transfer device, and the server, where the request includes a transfer device account of the transfer device and an offline device account of the transfer device, and the server unbinds, according to the unbinding request, the transfer device account and the offline device account bound in an account allocation process and then sends the unbound transfer device account and the offline device account to the transfer device;
and the second modification module is used for modifying the binding indication information again, and the modified binding indication information is used for indicating that the offline device does not have the main device and the offline device account.
12. A data transmission apparatus used in a relay device, the relay device being a device capable of simultaneously maintaining two different network connections, the apparatus comprising:
the connection establishing module is used for establishing a first connection with an offline device, and an instant messaging IM plug-in used for transferring data between the offline device and a server runs in the transferring device;
the first sending module is used for sending the offline device account number distributed by the server to the offline device after the connection establishing module establishes the first connection with the offline device; the first sending module includes a first sending unit, configured to send a master device request to the offline device through the first connection, where the master device request is used to request to become a master device of the offline device; a first receiving unit, configured to receive, through the first connection, acknowledgement information sent by the offline device; a connection establishing unit, configured to establish a second connection, send an account allocation request including a device identifier of the offline device to the server through the second connection, and receive, from the server, an offline device account allocated by the server to the offline device according to the account allocation request; a second sending unit, configured to send the offline device account to the offline device through the first connection;
the data transmission module is used for sending data to the offline device corresponding to the offline device account through the first connection established by the connection establishment module, wherein the data is acquired by the transfer device through the second connection established with the server; or, the first connection established by the connection establishing module receives the data sent by the offline device through the offline device account, and the second connection established with the server sends the data to the server;
the first connection is a wireless fidelity (WiFi) connection and the second connection is a WiFi Direct connection, or the first connection is a WiFi Direct connection and the second connection is a WiFi connection, or the first connection is a WiFiDirect connection and the second connection is a mobile network connection.
13. The apparatus according to claim 12, wherein the first sending unit is specifically configured to:
before sending a main equipment request to the offline equipment through the first connection, sending an equipment information request to the offline equipment through the first connection;
receiving equipment information sent by the offline equipment through the first connection, wherein the equipment information comprises an equipment identifier and binding indication information of the offline equipment;
and when the binding indication information indicates that the offline device does not have a main device and an offline device account, sending the main device request to the offline device through the first connection.
14. The apparatus of claim 12 or 13, further comprising:
a second sending module, configured to send, to the server through the second connection, a request for unbinding the transit device account and the offline device account of the transit device;
an information receiving module, configured to receive, through the second connection, unbinding notification information sent by the server, where the unbinding notification information is sent to the transfer device after the server unbinds the transfer device account and the offline device account bound in the account allocation process according to the unbinding request;
and the third sending module is used for sending the unbinding notification information to the offline device through the first connection.
15. A computer-readable storage medium, in which a computer program is stored, the computer program being adapted to implement the method of any one of claims 1 to 4, or to implement the method of any one of claims 5 to 7.
CN201510466583.1A 2015-07-31 2015-07-31 Data transmission method and device Active CN106413125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510466583.1A CN106413125B (en) 2015-07-31 2015-07-31 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510466583.1A CN106413125B (en) 2015-07-31 2015-07-31 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN106413125A CN106413125A (en) 2017-02-15
CN106413125B true CN106413125B (en) 2020-04-24

Family

ID=58007326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510466583.1A Active CN106413125B (en) 2015-07-31 2015-07-31 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN106413125B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753331B (en) * 2019-10-18 2021-05-25 珠海格力电器股份有限公司 Data transmission method, system, storage medium and networking device
CN110958142A (en) * 2019-11-26 2020-04-03 华为技术有限公司 Device maintenance method, maintenance device, storage medium, and computer program product
WO2023169545A1 (en) * 2022-03-11 2023-09-14 华为技术有限公司 Offline device control method and related apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701876A (en) * 2013-12-12 2014-04-02 北京奇虎科技有限公司 Method and device based on shared network resources
CN103716393A (en) * 2013-12-27 2014-04-09 深圳天珑无线科技有限公司 Resource sharing method and device and terminal used for LAN communication
CN104584606A (en) * 2012-08-30 2015-04-29 皇家飞利浦有限公司 Method and devices for pairing within a group of wireless devices
CN104579610A (en) * 2013-10-14 2015-04-29 网件公司 Systems and methods for simultaneously using multiple wlan modules operating in different wireless bands
CN104770055A (en) * 2012-11-08 2015-07-08 苹果公司 Mixtures for the coating of metallic surfaces

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100177712A1 (en) * 2009-01-15 2010-07-15 Nokia Corporation Multichannel/multiband operation for wireless device to device communication

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104584606A (en) * 2012-08-30 2015-04-29 皇家飞利浦有限公司 Method and devices for pairing within a group of wireless devices
CN104770055A (en) * 2012-11-08 2015-07-08 苹果公司 Mixtures for the coating of metallic surfaces
CN104579610A (en) * 2013-10-14 2015-04-29 网件公司 Systems and methods for simultaneously using multiple wlan modules operating in different wireless bands
CN103701876A (en) * 2013-12-12 2014-04-02 北京奇虎科技有限公司 Method and device based on shared network resources
CN103716393A (en) * 2013-12-27 2014-04-09 深圳天珑无线科技有限公司 Resource sharing method and device and terminal used for LAN communication

Also Published As

Publication number Publication date
CN106413125A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
US10111025B2 (en) Service providing terminal connection method and apparatus
CN102308290B (en) Method for transmitting virtualized data in cloud computing environment
CN109672708B (en) Communication method, device and system
US11083004B2 (en) Data transmission method and apparatus
US11723091B2 (en) Unicast connection establishment method for direct link, terminal and device
CN108432311B (en) Resource request method, equipment, network side node and system
CN112740642B (en) Communication method and multi-access edge computing server
CN106413125B (en) Data transmission method and device
CN112997548A (en) Method and device for mutually exclusive access of roaming terminal to network slice in wireless communication system
WO2019028738A1 (en) Unmanned aerial vehicle access method and device
CN106411981B (en) account number distribution method and device
CN106413123B (en) Data transmission method and device
CN102185881A (en) Household digital equipment wireless multi-protocol space sharing storage manager and method
CN110876193B (en) Information transmission method, communication equipment and network equipment
CN108462657B (en) Method and equipment for acquiring resources and information of SDN (software defined network) of different operators
CN108631997B (en) Data indication method and equipment
JP6497711B2 (en) Resource broadcast method and resource broadcast apparatus
CN112383617A (en) Method, device, terminal equipment and medium for long connection
CN112469029A (en) Service processing method, device and equipment
CN110830922A (en) Multicast communication method, device and terminal of direct link
CN114097191B (en) Communication method, device and system, computer storage medium
WO2022062856A1 (en) Resource management method and apparatus
CN111163435B (en) Method for acquiring and sending terminal transmission mode, base station, terminal and core network
CN113498046B (en) Communication method, device and system, storage medium and terminal
US20230128080A1 (en) Vehicle diagnostics system and method therein for enabling synchronous remote vehicle diagnostics for a plurality of vehicles

Legal Events

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