CN104702678B - Document transmission method and device - Google Patents
Document transmission method and device Download PDFInfo
- Publication number
- CN104702678B CN104702678B CN201510081000.3A CN201510081000A CN104702678B CN 104702678 B CN104702678 B CN 104702678B CN 201510081000 A CN201510081000 A CN 201510081000A CN 104702678 B CN104702678 B CN 104702678B
- Authority
- CN
- China
- Prior art keywords
- information
- terminal
- connection establishment
- access point
- connection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 63
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012795 verification Methods 0.000 claims description 51
- 238000012546 transfer Methods 0.000 claims description 19
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000004458 analytical method Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 39
- 230000006870 function Effects 0.000 description 24
- 238000010586 diagram Methods 0.000 description 15
- 238000012545 processing Methods 0.000 description 10
- 238000001514 detection method Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000007726 management method Methods 0.000 description 5
- 230000001133 acceleration Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000005484 gravity Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 238000010295 mobile communication Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001413 cellular effect Effects 0.000 description 2
- 238000007599 discharging Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000010079 rubber tapping Methods 0.000 description 2
- 238000010897 surface acoustic wave method Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a kind of document transmission method and devices, belong to the communications field.This method comprises: when first terminal and second terminal are in same local area network, information is established based on the first connection, the first audio-frequency information of assigned frequency is generated, the port information of the first set of words object of the address information that information includes first terminal and first terminal creation is established in the first connection;By the local area network, the first audio-frequency information is broadcasted;When receiving the connection foundation request that second terminal is sent based on the first audio-frequency information, the connection between first set of words object and the second socket object word of second terminal creation is established;By the connection between first set of words object and the second socket object word, file transmission is carried out with second terminal.The present invention is based on the first connections to establish information, generates the first audio-frequency information of assigned frequency, and by local area network, broadcasts the first audio-frequency information, file transmission efficiency can be improved.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a file transmission method and apparatus.
Background
With the rapid development of communication technology, when files are transmitted among a plurality of terminals, the files can be transmitted not only through Bluetooth, but also through a network by using data flow of the terminals. When the data traffic is transmitted through the network, a large amount of data traffic is consumed, and when the consumed data traffic is data traffic paid by the user, additional cost is generated for the user.
At present, a file transmission method is provided, which can save data traffic, and specifically includes: the first terminal is set to a wireless access point mode and an access point identification of the first terminal is broadcast. And the second terminal scans a plurality of access points covered by the current position to obtain a plurality of access point identifications. And when the second terminal acquires the access point identification of the first terminal from the plurality of access point identifications, connecting to the first terminal based on the access point identification of the first terminal. At this time, the first terminal and the second terminal are in the same local area network. Then, the first terminal and the second terminal respectively create a socket object, and respectively assign a port number to the created socket object. The second terminal acquires a plurality of IP (Internet Protocol, Chinese: network interconnection Protocol) addresses in the local area network, and sends a verification message to the terminal corresponding to each IP address in the plurality of IP addresses. And when a response message sent by the terminal corresponding to the IP address is received within the specified time, determining that the IP address is the IP address of the first terminal. And when the response message sent by the terminal corresponding to the IP address is not received within the specified time, determining that the terminal corresponding to the IP address does not exist, and sending a verification message to the terminal corresponding to the next IP address until the IP address of the first terminal is obtained. Then, the second terminal sends a connection establishment request to the first terminal based on the IP address of the first terminal and the port number corresponding to the socket object of the first terminal, so that the first terminal establishes a connection between the socket object of the first terminal and the socket object of the second terminal, and performs file transfer through the connection.
When the second terminal acquires the IP address of the first terminal through the method, a plurality of IP addresses in the local area network need to be verified until the IP address of the first terminal is acquired; in the verification process, at least specified time needs to be consumed for each verification, so that the verification time required before transmission is longer, and the file transmission efficiency is reduced.
Disclosure of Invention
In order to improve file transmission efficiency, embodiments of the present invention provide a file transmission method and apparatus. The technical scheme is as follows:
in a first aspect, a file transfer method is provided, where the method includes:
when a first terminal and a second terminal are in the same local area network, generating first audio information of a specified frequency based on first connection establishment information, wherein the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal;
broadcasting the first audio information through the local area network;
when a connection establishment request sent by the second terminal based on the first audio information is received, establishing a connection between the first socket object and a second socket object established by the second terminal;
and carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object.
In a second aspect, a file transfer method is provided, the method including:
when a first terminal and a second terminal are in the same local area network, receiving first audio information of a specified frequency broadcasted by the first terminal through the local area network, wherein the first audio information is generated by the first terminal based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal;
sending a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes a connection between the first socket object and a second socket object established by the second terminal;
and carrying out file transmission with the first terminal through the connection between the first socket object and the second socket object.
In a third aspect, a file transfer apparatus is provided, the apparatus comprising:
the first generation module is used for generating first audio information with specified frequency based on first connection establishment information when a first terminal and a second terminal are in the same local area network, wherein the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal;
the broadcasting module is used for broadcasting the first audio information through the local area network;
a first establishing module, configured to, when a connection establishment request sent by the second terminal based on the first audio information is received, establish a connection between the first socket object and a second socket object created by the second terminal;
and the transmission module is used for carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object.
In a fourth aspect, there is provided a file transfer apparatus, the apparatus comprising:
the terminal comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving first audio information of a specified frequency broadcasted by a first terminal through a local area network when the first terminal and a second terminal are in the same local area network, the first audio information is generated by the first terminal based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object established by the first terminal;
a sending module, configured to send a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes a connection between the first socket object and a second socket object created by the second terminal;
and the transmission module is used for carrying out file transmission with the first terminal through the connection between the first socket object and the second socket object.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
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 flowchart of a file transmission method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another file transfer method provided by the embodiment of the invention;
FIG. 3 is a flowchart of another file transmission method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a file transfer device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a first generation module according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another file transfer device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of another file transfer device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a second establishing module according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of another file transfer device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a sending module according to an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of another file transfer device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a first establishing module according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a first terminal according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a second terminal according to an 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.
Fig. 1 is a flowchart of a file transmission method according to an embodiment of the present invention. The execution subject of the method may be the first terminal, referring to fig. 1, the method includes:
step 101: when the first terminal and the second terminal are in the same local area network, first audio information of a designated frequency is generated based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal.
Step 102: first audio information is broadcast over the local area network.
Step 103: and when a connection establishment request sent by the second terminal based on the first audio information is received, establishing a connection between the first socket object and a second socket object established by the second terminal.
Step 104: and carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
Optionally, generating the first audio information of the specified frequency based on the first connection establishment information includes:
adding appointed head information and appointed tail information to the first connection establishment information to obtain second connection establishment information;
the second connection establishment information is converted into first audio information of a specified frequency.
Optionally, before generating the first audio information with a specified frequency based on the first connection establishment information, the method further includes:
and generating first connection establishment information according to the specified character string, the address information of the first terminal and the port information of the first socket object and the specified format.
Optionally, when the first terminal and the second terminal are in the same local area network, before generating the first audio information with the specified frequency based on the first connection establishment information, the method further includes:
establishing wireless network connection with a second terminal to enable the first terminal and the second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the second terminal, and the first terminal and the second terminal are in the same local area network.
Optionally, the establishing a wireless network connection with the second terminal includes:
setting a first terminal to a wireless access point mode;
generating second audio information of a designated frequency based on first access point information of the first terminal, wherein the first access point information at least comprises an access point identifier;
broadcasting second audio information in a wireless access point mode;
and when a wireless network connection request sent by the second terminal based on the second audio information is received, establishing wireless network connection with the second terminal.
Optionally, generating second audio information of a specified frequency based on the first access point information of the first terminal includes:
adding appointed head information and appointed tail information to first access point information of a first terminal to obtain second access point information;
the second access point information is converted into second audio information of a specified frequency.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present invention, which is not described in detail herein.
Fig. 2 is a flowchart of a file transmission method according to an embodiment of the present invention. The execution subject of the method may be the second terminal, referring to fig. 2, the method includes:
step 201: when the first terminal and the second terminal are in the same local area network, receiving first audio information of a specified frequency broadcasted by the first terminal through the local area network, wherein the first audio information is generated by the first terminal based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal.
Step 202: and sending a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes connection between the first socket object and the second socket object established by the second terminal.
Step 203: and carrying out file transmission with the first terminal through the connection between the first socket object and the second socket object.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
Optionally, sending a connection establishment request to the first terminal based on the first audio information, including:
analyzing the first audio information to obtain second connection establishment information;
performing fault tolerance verification on the second connection establishment information based on the head information and the tail information of the second connection establishment information;
if the verification is passed, removing the head information and the tail information of the second connection establishment information to obtain first connection establishment information;
and sending a connection establishment request to the first terminal based on the first connection establishment information.
Optionally, performing fault tolerance verification on the second connection establishment information based on the header information and the trailer information of the second connection establishment information, including:
acquiring head information and tail information of second connection establishment information;
and if the acquired head information is the specified head information and the acquired tail information is the specified tail information, determining that the second connection establishment information is verified to be passed, otherwise, determining that the second connection establishment information is not verified to be passed.
Optionally, sending a connection establishment request to the first terminal based on the first connection establishment information, including:
analyzing the first connection establishment information according to a specified format to obtain address information of the first terminal and port information of the first socket object;
and sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
Optionally, when the first terminal and the second terminal are in the same local area network, before receiving the first audio information of the specified frequency broadcast by the first terminal through the local area network, the method further includes:
establishing wireless network connection with a first terminal to enable the first terminal and a second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the first terminal, and the first terminal and the second terminal are in the same local area network.
Optionally, the establishing a wireless network connection with the first terminal includes:
receiving second audio information of a designated frequency broadcasted by the first terminal in a wireless access point mode, wherein the second audio information is generated by the first terminal based on first access point information of the first terminal, and the first access point information at least comprises an access point identifier;
and sending a wireless network connection request to the first terminal based on the second audio information, so that the first terminal establishes wireless network connection with the second terminal.
Optionally, sending a wireless network connection request to the first terminal based on the second audio information, including:
analyzing the second audio information to obtain second access point information;
performing fault tolerance verification on the second access point information based on the head information and the tail information of the second access point information;
if the verification is passed, removing the head information and the tail information of the second access point information to obtain first access point information of the first terminal;
and sending a wireless network connection request to the first terminal based on the first access point information.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present invention, which is not described in detail herein.
Fig. 3 is a flowchart of a file transmission method according to an embodiment of the present invention. Referring to fig. 3, the method includes:
step 301: when the first terminal and the second terminal are in the same local area network, the first terminal generates first audio information with specified frequency based on first connection establishment information, wherein the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal.
When the first terminal generates the first audio information of the designated frequency based on the first connection establishment information, the first terminal may directly convert the first connection establishment information into the first audio information of the designated frequency.
Optionally, in order to improve reliability of file transmission and avoid an error of the first audio information in the transmission process, when the first terminal generates the first audio information with the specified frequency based on the first connection establishment information, the first terminal may add specified header information and specified tail information to the first connection establishment information to obtain second connection establishment information; the second connection establishment information is converted into first audio information of a specified frequency.
It should be noted that, in the embodiment of the present invention, when adding the specified header information and the specified trailer information to the first connection establishment information, the specified header information may be added to the header of the first connection establishment information, and the specified trailer information may be added to the trailer of the first connection establishment information, which is not described in detail in the embodiment of the present invention. In addition, the specified header information and the specified trailer information are set in advance by the first terminal and the second terminal, which is not particularly limited in the embodiment of the present invention.
For example, the header information is specified as XY, the trailer information is specified as 00, and the first connection establishment information may be jiexie #211.144.172.14#2, and at this time, the specified header information and the specified trailer information are added to the first connection establishment information, resulting in that the second connection establishment information is XY jiexie #211.144.172.14# 200.
In addition, the address information of the first terminal may be an IP address of the first terminal, and may also be other addresses, which is not specifically limited in this embodiment of the present invention. Furthermore, the first Socket object may be a Socket, and the port information of the first Socket object may include a port number, configuration information of a port, and the like, which is not specifically limited in the embodiment of the present invention.
Further, in order to avoid a malicious party from sending a connection establishment request to the first terminal based on the first audio information broadcast by the first terminal, before the first terminal generates the first audio information with a specified frequency based on the first connection establishment information, the method further includes: and generating first connection establishment information according to the specified character string, the address information of the first terminal and the port information of the first socket object and the specified format.
The designated character string is preset between the first terminal and the second terminal, and the second terminal can recognize the first connection establishment information according to the designated character string. In addition, the designated format is also preset between the first terminal and the second terminal, and the designated format may include multiple formats, for example, a mode of sequentially connecting the address information of the first terminal, the port information of the first socket object, and the designated character string in series, a mode of reversely connecting the address information of the first terminal, the port information of the first socket object, and the designated character string in series, and the like.
For example, when the address information of the first terminal is 211.144.172.14, the port information of the first socket object is 2, the designated string is jiexie, and the designation rule is "address information of the designated string # first terminal # port information of the first socket object", the first connection establishment information is jiexie #211.144.172.14#2 is generated according to the designation rule based on the address information 211.144.172.14 of the first terminal, the port information 2 of the first socket object, and the designated string jiexie.
In addition, in the embodiment of the present invention, the address information of the first terminal and the port information of the first socket object may be composed of a string of letters, numbers, punctuation marks, and the like, for convenience of description, the letters, numbers, punctuation marks, and the like are collectively referred to as characters, and the first terminal may store a correspondence between the characters and frequencies in advance, where a frequency corresponding to each character is a designated frequency. Therefore, when the first terminal converts the first connection establishment information into the first audio information of the specified frequency or converts the second connection establishment information into the first audio information of the specified frequency, the first terminal may obtain the corresponding frequency from the correspondence between the character and the frequency based on the character included in the first connection establishment information, thereby generating the first audio information of the specified frequency and realizing the conversion of the first connection establishment information. Or, the first terminal may obtain a corresponding frequency from a correspondence between the character and the frequency based on the character included in the second connection establishment information, thereby generating the first audio information with the specified frequency and implementing the conversion of the second connection establishment information.
For example, in the correspondence between characters and frequencies stored in the first terminal, the frequency corresponding to character j is 10Hz, the frequency corresponding to character i is 15Hz, the frequency corresponding to character e is 11Hz, the frequency corresponding to character x is 25Hz, the frequency corresponding to character # is 20Hz, the frequency corresponding to character 2 is 14Hz, the frequency corresponding to character 1 is 5Hz, and the frequency corresponding to character is 40Hz, the frequency corresponding to character 4 is 33Hz, and the frequency corresponding to character 7 is 50 Hz. When the first terminal converts the first connection setup information into first audio information of a designated frequency, the first audio information may be 10Hz15Hz11 Hz14 Hz5Hz33 Hz40Hz5Hz50Hz14 Hz5Hz33Hz20Hz14 Hz.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network and file transmission is carried out between the first terminal and the second terminal, the file transmission can be carried out through the local area network without an operator, so that the data traffic of a user is not wasted, the data traffic of payment is not involved, and the extra cost is avoided for the user. The two ways of enabling the first terminal and the second terminal to be in the same local area network may include:
in the first mode, the first terminal establishes wireless network connection with the designated access point based on the designated access point information. And the second terminal establishes wireless network connection with the specified access point based on the specified access point information.
Since the first terminal and the second terminal are connected to the same access point, that is, a designated access point, the designated access point may be an access point to which the first terminal is currently connected or to which the first terminal is to be connected, or the designated access point may be an access point to which the second terminal is currently connected or to which the second terminal is to be connected.
For the first mode, when the first terminal and the second terminal are connected to the same access point and use the wireless hotspot network at the same time and do not use data traffic, the first terminal and the second terminal are in the same local area network. When the first terminal and the second terminal do not adopt the wireless hotspot network but adopt the data traffic, the first terminal and the second terminal need to be in the same local area network in the following second mode.
And in the second mode, the wireless network connection with the second terminal is established, so that the first terminal and the second terminal are in the same local area network.
For the first way, the first terminal may set the first terminal to a wireless access point mode; generating second audio information of a designated frequency based on first access point information of the first terminal, wherein the first access point information at least comprises an access point identifier; the first terminal broadcasts the second audio information in the wireless access point mode. And when the second terminal receives second audio information of the specified frequency broadcasted by the first terminal in the wireless access point mode, sending a wireless network connection request to the first terminal based on the second audio information. And when the first terminal receives a wireless network connection request sent by the second terminal based on the second audio information, establishing wireless network connection between the first terminal and the second terminal, so that the first terminal and the second terminal are in the same local area network.
When the first terminal generates the second audio information of the designated frequency based on the first access point information of the first terminal, the first terminal may directly convert the first access point information of the first terminal into the second audio information of the designated frequency. Accordingly, when the second terminal receives second audio information of a designated frequency broadcast by the first terminal in the wireless access point mode, the second terminal transmits a wireless network connection request to the first terminal based on the second audio information, including: the second terminal analyzes the second audio information to obtain first access point information, and sends a wireless network connection request to the first terminal based on the first access point information.
Optionally, in order to improve the reliability of file transmission and avoid an error in the transmission process of the second audio information, the generating, by the first terminal, the second audio information with a specified frequency based on the first access point information of the first terminal includes: the first terminal adds appointed head information and appointed tail information to first access point information of the first terminal to obtain second access point information; the second access point information is converted into second audio information of a specified frequency. Accordingly, when the second terminal receives second audio information of a designated frequency broadcast by the first terminal in the wireless access point mode, the second terminal transmits a wireless network connection request to the first terminal based on the second audio information, including: the second terminal analyzes the second audio information to obtain second access point information; performing fault tolerance verification on the second access point information based on the head information and the tail information of the second access point information; if the verification is passed, removing the head information and the tail information of the second access point information to obtain first access point information of the first terminal; and sending a wireless network connection request to the first terminal based on the first access point information.
It should be noted that, in the embodiment of the present invention, when adding the specified header information and the specified trailer information to the first access point information, the specified header information may be added to the header of the first access point information, and the specified trailer information may be added to the trailer of the first access point information, which is not described in detail in the embodiment of the present invention.
For example, the first access point information includes an access point identifier myssid, and at this time, the specified header information and the specified trailer information are added to the first access point information, resulting in that the second access point information is XYmyssid 00. According to the method of the above example, the second audio information to convert the second access point information into the specified frequency is 30Hz35Hz22 Hz28Hz15Hz45Hz8 Hz. Correspondingly, when the second terminal receives second audio information of the specified frequency broadcasted by the first terminal in the wireless access point mode, the second terminal analyzes the second audio information to obtain that the second access point information is XYmyssid 00; performing fault tolerance verification on the second access point information based on the head information XY and the tail information 00 of the second access point information; if the verification is passed, removing the head information XY and the tail information 00 of the second access point information to obtain the myssid of the first access point information of the first terminal; and sending a wireless network connection request to the first terminal based on the first access point information.
The second terminal performs fault-tolerant verification on the second access point information based on the header information and the tail information of the second access point information, and the fault-tolerant verification includes: the second terminal acquires the head information and the tail information of the second access point information; and if the acquired head information is the specified head information and the acquired tail information is the specified tail information, determining that the second access point information passes verification, otherwise, determining that the second access point information fails verification.
Further, the first terminal may periodically broadcast the second audio information, when the second terminal determines that the second access point information is verified in the current period, it is determined that no error occurs in the second audio information in the transmission process, it is determined that the second audio information is accurate, and a wireless network connection is established with the first terminal in the current period. And when the second terminal determines that the second access point information is not verified in the current period, determining that the second audio information has errors in the transmission process and is inaccurate, receiving the second audio information again when the second audio information is broadcast in the next period of the first terminal, and establishing wireless network connection with the first terminal according to the method.
In addition, in the embodiment of the present invention, each of the first access point information and the second access point information may be composed of a string of letters, numbers, punctuation marks, and the like, for convenience of description, the letters, numbers, punctuation marks, and the like are collectively referred to as characters, and the first terminal may store a correspondence between the characters and frequencies in advance, where a frequency corresponding to each character is a designated frequency. Therefore, when the first terminal converts the first access point information into the second audio information of the specified frequency, the first terminal may obtain the corresponding frequency from the corresponding relationship between the character and the frequency based on the character included in the first access point information, thereby generating the second audio information of the specified frequency, and implementing the conversion of the first access point information. Correspondingly, the corresponding relationship between the character and the frequency may also be stored in the second terminal, and when the second terminal analyzes the second audio information, the corresponding character may be acquired from the corresponding relationship between the character and the frequency based on the frequency included in the second audio information, so as to obtain the first access point information, and implement the analysis of the second audio information.
Or, when the first terminal converts the second access point information into the second audio information with the specified frequency, the first terminal may obtain the corresponding frequency from the corresponding relationship between the character and the frequency based on the character included in the second access point information, so as to generate the second audio information with the specified frequency, and implement the conversion of the second access point information. Correspondingly, when the second terminal analyzes the second audio information, the corresponding character can be obtained from the corresponding relationship between the character and the frequency based on the frequency included in the second audio information, so that the second access point information is obtained, and the second audio information is analyzed.
Furthermore, the first access point information may include not only the access point identifier but also information such as an access point password. When the first access point information includes the access point identifier, the second terminal may send the wireless network connection request to the first terminal directly based on the access point identifier when the second terminal sends the wireless network connection request to the first terminal based on the first access point information. When the first access point information further includes an access point password, before the first terminal generates the second audio information with the specified frequency based on the first access point information, the method further includes: and the first terminal generates first access point information according to the specified character string, the access point identifier and the access point password and the specified format. Correspondingly, when the second terminal sends the wireless network connection request to the first terminal based on the first access point information, the second terminal can analyze the first access point information according to the specified format to obtain an access point identifier and an access point password, and send the wireless network connection request to the first terminal based on the access point identifier and the access point password.
For example, the first access point information includes not only the access point identifier myssid but also the access point password mime 2233, the designated string is jisiexie, and the designated rule is "designated string # access point identifier # access point password", and at this time, according to the access point identifier myssid, the access point password mime 2233, and the designated string jisiexie, the first access point information is jisiexie # myssid # mime 2233 is generated according to the designated rule. Accordingly, when the second terminal sends the wireless network connection request to the first terminal based on the first access point information jiexie # myssima # mimea 2233, the second terminal may parse the first access point information jiexie # myssima # mimea 2233 according to a specified format to obtain the access point identifier myssid and the access point password mimea 2233, and send the wireless network connection request to the first terminal based on the access point identifier myssid and the access point password mimea 2233.
In the embodiment of the invention, when the first terminal is set to be in an Access Point (AP) mode, the first terminal can be used as a core of a wireless hotspot network and broadcasts the second audio information. Optionally, a general terminal may include a function of a wireless hotspot, so in the embodiment of the present invention, a user may set the first terminal in a wireless hotspot mode by starting the function of the wireless hotspot carried by the first terminal.
In addition, the Wireless hotspot network may be a WIFI (Wireless Fidelity) network, and of course, may also be other networks as long as the network does not need data traffic, and the embodiment of the present invention is not limited to this specifically. Furthermore, the access point Identifier may be an SSID (Service Set Identifier), the access point Identifier may be a name of the access point, a factory number of the access point, and the like, and the access point Identifier and the access point password may be Set in the first terminal by the user in advance, or may be Set by default by the first terminal.
It should be noted that the wireless network connection request sent by the second terminal to the first terminal may carry address information of the second terminal, and the like, which is not specifically limited in this embodiment of the present invention. In addition, the data traffic involved in the embodiment of the present invention is data traffic generated by accessing the internet through a mobile communication technology, and when the terminal uses the data traffic, a certain fee needs to be paid to an operator to which the data traffic belongs. In practical application, a user can purchase a package of data traffic, when the terminal uses the data traffic in the package, no extra fee is generated for the user, and when the used data traffic exceeds the data traffic in the package, the user needs to pay the extra fee. Therefore, the method provided by the embodiment of the invention can not consume the data flow of the user, thereby avoiding generating extra cost for the user.
Step 302: the first terminal broadcasts first audio information through the local area network.
Specifically, the first terminal may periodically broadcast the first audio information through the local area network. For example, the first terminal may broadcast the first audio information every 5 seconds.
Step 303: and when the second terminal receives first audio information of the designated frequency broadcasted by the first terminal through the local area network, sending a connection establishment request to the first terminal based on the first audio information.
In a scenario where the first audio information is obtained by directly converting the first connection establishment information by the first terminal, when the second terminal receives the first audio information of the specified frequency broadcasted by the first terminal through the local area network, the first audio information may be analyzed to obtain the first connection establishment information. And sending a connection establishment request to the first terminal based on the first connection establishment information.
Under the scene that the first audio information is obtained by converting the second connection establishment information by the first terminal, when the second terminal receives the first audio information with the appointed frequency broadcasted by the first terminal through the local area network, the first audio information can be analyzed to obtain the second connection establishment information; performing fault tolerance verification on the second connection establishment information based on the head information and the tail information of the second connection establishment information; if the verification is passed, removing the head information and the tail information of the second connection establishment information to obtain first connection establishment information; and sending a connection establishment request to the first terminal based on the first connection establishment information.
For example, the first audio information may be 10Hz15Hz11Hz25Hz15Hz11Hz20Hz14 Hz5Hz40Hz5Hz33 Hz40Hz5Hz50Hz14 Hz5Hz33Hz20Hz14Hz, and the first audio information is analyzed according to the corresponding relationship between characters and frequencies to obtain second connection establishment information XY jiexie #211.144.172.14# 200; performing fault tolerance verification on the second connection establishment information based on the head information XY and the tail information 00 of the second connection establishment information; if the verification is passed, removing the head information XY and the tail information 00 of the second connection establishment information to obtain first connection establishment information jiexie #211.144.172.14# 2; and sending a connection establishment request to the first terminal based on the first connection establishment information.
The second terminal performs fault-tolerant verification on the second connection establishment information based on the head information and the tail information of the second connection establishment information, and the fault-tolerant verification includes: acquiring head information and tail information of second connection establishment information; and if the acquired head information is the specified head information and the acquired tail information is the specified tail information, determining that the second connection establishment information is verified to be passed, otherwise, determining that the second connection establishment information is not verified to be passed.
Further, when the second terminal determines that the second connection establishment information is verified, it is determined that the first audio information is free of errors in the transmission process, it is determined that the first audio information is accurate, and the second terminal can remove the header information and the tail information of the second connection establishment information in the current period to obtain the first connection establishment information, so that a connection establishment request is sent to the first terminal. And when the second terminal determines that the second connection establishment information is not verified, determining that the first audio information has errors in the transmission process, determining that the first audio information is inaccurate, receiving the first audio information again when the first audio information is broadcast in the next period of the first terminal, and sending a connection establishment request to the first terminal according to the method.
Further, when the first connection establishment information is generated by the first terminal according to the specified character string, the address information of the first terminal, and the port information of the first socket object in the specified format, the second terminal sends a connection establishment request to the first terminal based on the first connection establishment information, including: analyzing the first connection establishment information according to a specified format to obtain address information of the first terminal and port information of the first socket object; and sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
For example, if the first connection establishment information is generated by the first terminal according to the specified character string, the address information of the first terminal, and the port information of the first socket object in the specified format, the second terminal parses the first connection establishment information jiexie #211.144.172.14#2 in the specified format, and obtains that the address information of the first terminal is 211.144.172.14 and the port information of the first socket object is 2; and sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
Therefore, when the second terminal analyzes the first audio information, the corresponding characters can be obtained from the corresponding relation between the characters and the frequencies based on the frequencies included in the first audio information, so that the first connection establishment information or the second connection establishment information is obtained, and the first audio information is analyzed.
It should be noted that the connection establishment request sent by the second terminal to the first terminal may carry port information of the second socket object created by the second terminal, address information of the second terminal, and the like, which is not specifically limited in this embodiment of the present invention.
Step 304: and when the first terminal receives a connection establishment request sent by the second terminal based on the first audio information, establishing a connection between the first socket object and a second socket object established by the second terminal.
In the embodiment of the present invention, a method for establishing a connection between a first socket object and a second socket object established by a second terminal by a first terminal may refer to an existing method, which is not described in detail in the embodiment of the present invention.
Step 305: and the first terminal performs file transmission with the second terminal through the connection between the first socket object and the second socket object.
The first terminal transmits the file with the second terminal through the connection between the first socket object and the second socket object without passing through an operator, so that the data traffic of the user is saved, and further, the extra cost generated for the user is avoided.
It should be noted that, in this embodiment of the present invention, the time when the first terminal creates the first socket object may be after a wireless network connection is established with the second terminal and before the first audio information with a specified frequency is generated based on the first connection establishment information, and the time when the second terminal creates the second socket object may be before a connection establishment request is sent to the first terminal based on the first audio information, which is not specifically limited in this embodiment of the present invention. In addition, after the first terminal creates the first socket object, the first terminal may acquire the port information of the first socket. After the second terminal creates the second socket object, the second terminal may acquire the port information of the second socket.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved. In addition, the first terminal adds the specified header information and the specified trailer information to the first connection establishment information to obtain second connection establishment information, and converts the second connection establishment information into first audio information of specified frequency. When the second terminal receives the first audio information, the first audio information is analyzed to obtain second connection establishment information, and whether errors occur in the transmission process of the first audio information is judged according to the head information and the tail information of the second connection establishment information, so that the reliability of file transmission is improved.
Fig. 4 is a schematic structural diagram of a file transfer device according to an embodiment of the present invention. Referring to fig. 4, the apparatus includes:
a first generating module 401, configured to generate first audio information with a specified frequency based on first connection establishment information when the first terminal and the second terminal are in the same local area network, where the first connection establishment information includes address information of the first terminal and port information of a first socket object created by the first terminal;
a broadcasting module 402, configured to broadcast first audio information via the local area network;
a first establishing module 403, configured to, when a connection establishing request sent by the second terminal based on the first audio information is received, establish a connection between the first socket object and a second socket object created by the second terminal;
a transmission module 404, configured to perform file transmission with the second terminal through the connection between the first socket object and the second socket object.
Alternatively, referring to fig. 5, the first generation module 401 includes:
an adding unit 4011, configured to add specified header information and specified trailer information to the first connection establishment information, to obtain second connection establishment information;
a conversion unit 4012 configured to convert the second connection establishment information into first audio information of a specified frequency.
Optionally, referring to fig. 6, the apparatus further comprises:
a second generating module 405, configured to generate the first connection establishment information according to the specified format and according to the specified character string, the address information of the first terminal, and the port information of the first socket object.
Optionally, referring to fig. 7, the apparatus further comprises:
a second establishing module 405, configured to establish a wireless network connection with a second terminal, so that the first terminal and the second terminal are in the same local area network; or,
a third establishing module 406, configured to establish a wireless network connection with a designated access point based on the information of the designated access point, where the designated access point is an access point to which the second terminal is currently connected or to be connected, and the first terminal and the second terminal are in the same local area network.
Optionally, referring to fig. 8, the second establishing module 405 includes:
a setting unit 4051 configured to set the first terminal to the wireless access point mode;
a generating unit 4052, configured to generate second audio information of a specified frequency based on first access point information of the first terminal, where the first access point information at least includes an access point identifier;
a broadcasting unit 4053 for broadcasting the second audio information in the wireless access point mode;
the establishing unit 4054 is configured to, when a wireless network connection request sent by the second terminal based on the second audio information is received, establish a wireless network connection with the second terminal.
Optionally, the generating unit 4052 includes:
the adding subunit is used for adding the appointed head information and the appointed tail information to the first access point information of the first terminal to obtain second access point information;
a conversion subunit, configured to convert the second access point information into second audio information of a specified frequency.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
Fig. 9 is a schematic structural diagram of a file transfer device according to an embodiment of the present invention. Referring to fig. 9, the apparatus includes:
a receiving module 901, configured to receive first audio information of a specified frequency broadcasted by a first terminal through a local area network when the first terminal and a second terminal are in the same local area network, where the first audio information is generated by the first terminal based on first connection establishment information, and the first connection establishment information includes address information of the first terminal and port information of a first socket object created by the first terminal;
a sending module 902, configured to send a connection establishment request to a first terminal based on the first audio information, so that the first terminal establishes a connection between a first socket object and a second socket object created by a second terminal;
a transmission module 903, configured to perform file transmission with the first terminal through connection between the first socket object and the second socket object.
Optionally, referring to fig. 10, the sending module 902 includes:
an analyzing unit 9021, configured to analyze the first audio information to obtain second connection establishment information;
a verification unit 9022, configured to perform fault-tolerant verification on the second connection establishment information based on the header information and the trailer information of the second connection establishment information;
a removing unit 9023, configured to remove the header information and the trailer information of the second connection establishment information if the verification passes, to obtain first connection establishment information;
a first sending unit 9024, configured to send a connection establishment request to the first terminal based on the first connection establishment information.
Optionally, the verification unit 9022 includes:
an obtaining subunit, configured to obtain header information and tail information of the second connection establishment information;
and the determining subunit is used for determining that the second connection establishment information is verified to be passed if the acquired head information is the specified head information and the acquired tail information is the specified tail information, and otherwise, determining that the second connection establishment information is not verified to be passed.
Optionally, the first sending unit 9024 includes:
the first analysis subunit is used for analyzing the first connection establishment information according to the specified format to obtain the address information of the first terminal and the port information of the first socket object;
and the first sending subunit is used for sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
Optionally, referring to fig. 11, the apparatus further comprises:
a first establishing module 904, configured to establish a wireless network connection with the first terminal, so that the first terminal and the second terminal are in the same local area network; or,
a second establishing module 905, configured to establish a wireless network connection with a designated access point based on information of the designated access point, where the designated access point is an access point to which the first terminal is currently connected or to be connected, and the first terminal and the second terminal are in the same local area network.
Optionally, referring to fig. 12, the first establishing module 904 includes:
a receiving unit 9041, configured to receive second audio information of a specified frequency broadcasted by the first terminal in the wireless access point mode, where the second audio information is generated by the first terminal based on first access point information of the first terminal, and the first access point information at least includes an access point identifier;
a second sending unit 9042, configured to send a wireless network connection request to the first terminal based on the second audio information, so that the first terminal establishes a wireless network connection with the second terminal, where the first terminal and the second terminal are in the same local area network.
Optionally, the second sending unit 9042 includes:
the second analysis subunit is used for analyzing the second audio information to obtain second access point information;
the verification subunit is used for performing fault-tolerant verification on the second access point information based on the head information and the tail information of the second access point information;
the removing subunit is configured to remove the header information and the trailer information of the second access point information if the verification passes, and obtain first access point information of the first terminal;
and the second sending subunit is used for sending the wireless network connection request to the first terminal based on the first access point information.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
It should be noted that: in the file transfer device provided in the above embodiment, only the division of the functional modules is illustrated in the file transfer, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the file transmission device and the file transmission method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
Fig. 13 is a schematic structural diagram of a first terminal according to an embodiment of the present invention. Referring to fig. 13, the first terminal 1300 may include components such as a communication unit 1310, a memory 1320 including one or more computer-readable storage media, an input unit 1330, a display unit 1340, a sensor 1350, an audio circuit 1360, a WIFI (Wireless Fidelity) module 1370, a processor 1380 including one or more processing cores, and a power supply 1390. Those skilled in the art will appreciate that the first terminal structure shown in fig. 13 is not intended to be limiting of the first terminal and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the communication unit 1310 may be used for receiving and transmitting information or signals during a call, and the communication unit 1310 may be an RF (Radio Frequency) circuit, a router, a modem, or other network communication devices. In particular, when the communication unit 1310 is an RF circuit, downlink information of a base station is received and then processed by one or more processors 1380; in addition, data relating to uplink is transmitted to the base station. Generally, the RF circuit as a communication unit includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. Further, the communication unit 1310 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), etc. The memory 1320 may be used to store software programs and modules, and the processor 1380 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1320. The memory 1320 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the first terminal 1300, and the like. Further, the memory 1320 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 1320 may also include a memory controller to provide the processor 1380 and the input unit 1330 access to the memory 1320.
The input unit 1330 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Preferably, input unit 1330 may include a touch-sensitive surface 1331 as well as other input devices 1332. Touch-sensitive surface 1331, also referred to as a touch display screen or touch pad, may collect touch operations by a user on or near the touch-sensitive surface 1331 (e.g., operations by a user on or near the touch-sensitive surface 1331 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, touch-sensitive surface 1331 may comprise two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1380, where the touch controller can receive and execute commands sent by the processor 1380. Additionally, touch sensitive surface 1331 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to touch-sensitive surface 1331, input unit 1330 may include other input devices 1332. Preferably, other input devices 1332 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1340 may be used to display information input by or provided to the user and various graphical user interfaces of the first terminal 1300, which may be made up of graphics, text, icons, video, and any combination thereof. The display unit 1340 may include a display panel 1341, and optionally, the display panel 1341 may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 1331 may overlay display panel 1341 and, upon detecting a touch operation on or near touch-sensitive surface 1331, communicate to processor 1380 to determine the type of touch event, and processor 1380 then provides a corresponding visual output on display panel 1341 based on the type of touch event. Although in FIG. 13, the touch-sensitive surface 1331 and the display panel 1341 are shown as two separate components to implement input and output functions, in some embodiments, the touch-sensitive surface 1331 may be integrated with the display panel 1341 to implement input and output functions.
The first terminal 1300 can also include at least one sensor 1350, such as light sensors, motion sensors, and other sensors. The light sensor may include an ambient light sensor that adjusts the brightness of the display panel 1341 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 1341 and/or a backlight when the first terminal 1300 moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be further configured on the first terminal 1300, detailed descriptions thereof are omitted.
An audio circuit 1360, a speaker 1361, and a microphone 1362 may provide an audio interface between a user and the first terminal 1300. The audio circuit 1360 may transmit the electrical signal converted from the received audio data to the speaker 1361, and the electrical signal is converted into a sound signal by the speaker 1361 and output; on the other hand, the microphone 1362 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 1360, processes the audio data by the audio data output processor 1380, and then transmits the processed audio data to, for example, another terminal via the communication unit 1310, or outputs the audio data to the memory 1320 for further processing. The audio circuit 1360 may also include an ear-bud jack to provide communication of peripheral headphones with the first terminal 1300.
In order to realize wireless communication, a wireless communication unit 1370 may be configured on the first terminal, and the wireless communication unit 1370 may be a WIFI module. WIFI belongs to a short-distance wireless transmission technology, and the first terminal 1300 can help a user to send and receive e-mails, browse webpages, access streaming media, and the like through the wireless communication unit 1370, and provides a wireless broadband internet access for the user. Although the wireless communication unit 1370 is shown in the drawing, it is understood that it does not belong to the essential constitution of the first terminal 1300 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1380 is a control center of the first terminal 1300, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the first terminal 1300 and processes data by operating or executing software programs and/or modules stored in the memory 1320 and calling data stored in the memory 1320, thereby monitoring the entire mobile phone. Optionally, processor 1380 may include one or more processing cores; preferably, the processor 1380 may integrate an application processor, which handles primarily operating systems, user interfaces, application programs, etc., and a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated within processor 1380.
The first terminal 1300 further includes a power supply 1390 (e.g., a battery) for supplying power to various components, which may preferably be logically coupled to the processor 1380 via a power management system, such that functions to manage charging, discharging, and power consumption management are performed via the power management system. The power supply 1360 may also include any component or components of one or more direct or alternating current power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the first terminal 1300 may further include a camera, a bluetooth module, etc., which are not described in detail herein.
In this embodiment, the first terminal further comprises one or more programs, stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the file transfer method as follows.
When the first terminal and the second terminal are in the same local area network, first audio information of a designated frequency is generated based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal.
First audio information is broadcast over the local area network.
And when a connection establishment request sent by the second terminal based on the first audio information is received, establishing a connection between the first socket object and a second socket object established by the second terminal.
And carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object.
Optionally, generating the first audio information of the specified frequency based on the first connection establishment information includes:
adding appointed head information and appointed tail information to the first connection establishment information to obtain second connection establishment information;
the second connection establishment information is converted into first audio information of a specified frequency.
Optionally, before generating the first audio information with a specified frequency based on the first connection establishment information, the method further includes:
and generating first connection establishment information according to the specified character string, the address information of the first terminal and the port information of the first socket object and the specified format.
Optionally, when the first terminal and the second terminal are in the same local area network, before generating the first audio information with the specified frequency based on the first connection establishment information, the method further includes:
establishing wireless network connection with a second terminal to enable the first terminal and the second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the second terminal, and the first terminal and the second terminal are in the same local area network.
Optionally, the establishing a wireless network connection with the second terminal includes:
setting a first terminal to a wireless access point mode;
generating second audio information of a designated frequency based on first access point information of the first terminal, wherein the first access point information at least comprises an access point identifier;
broadcasting second audio information in a wireless access point mode;
and when a wireless network connection request sent by the second terminal based on the second audio information is received, establishing wireless network connection with the second terminal.
Optionally, generating second audio information of a specified frequency based on the first access point information of the first terminal includes:
adding appointed head information and appointed tail information to first access point information of a first terminal to obtain second access point information;
the second access point information is converted into second audio information of a specified frequency.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
Fig. 14 is a schematic structural diagram of a second terminal according to an embodiment of the present invention. The second terminal 1400 may include components such as a communication unit 1410, a memory 1420 including one or more computer-readable storage media, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a WIFI (Wireless Fidelity) module 1470, a processor 1480 including one or more processing cores, and a power supply 1490. Those skilled in the art will appreciate that the second terminal structure shown in fig. 14 is not intended to be limiting of the second terminal and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the communication unit 1410 may be used for receiving and transmitting information or signals during a call, and the communication unit 1410 may be a Radio Frequency (RF) circuit, a router, a modem, or other network communication devices. In particular, when the communication unit 1410 is an RF circuit, downlink information of a base station is received and then processed by one or more processors 1480; in addition, data relating to uplink is transmitted to the base station. Generally, the RF circuit as a communication unit includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. Further, the communication unit 1410 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), etc. The memory 1420 may be used to store software programs and modules, and the processor 1480 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the second terminal 1400, and the like. Further, memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1420 may also include a memory controller to provide the processor 1480 and the input unit 1430 access to the memory 1420.
The input unit 1430 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Preferably, the input unit 1430 may include a touch-sensitive surface 1431 as well as other input devices 1432. Touch-sensitive surface 1431, also referred to as a touch display screen or touch pad, may collect touch operations by a user on or near the touch-sensitive surface 1431 (e.g., operations by a user on or near the touch-sensitive surface 1431 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predefined program. Optionally, touch-sensitive surface 1431 may include both touch detection means and touch controller portions. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device and converts it to touch point coordinates, which are provided to the processor 1480 and can receive and execute commands from the processor 1480. Additionally, the touch-sensitive surface 1431 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves, among others. In addition to touch-sensitive surface 1431, input unit 1430 may also include other input devices 1432. Preferably, other input devices 1432 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1440 may be used to display information input by or provided to the user and various graphical user interfaces of the second terminal 1400, which may be made up of graphics, text, icons, video, and any combination thereof. The display unit 1440 may include a display panel 1441, and optionally, the display panel 1441 may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 1431 can overlie display panel 1441, and when touch operations are detected on or near touch-sensitive surface 1431, they are passed to processor 1480 for determining the type of touch event, and processor 1480 then provides a corresponding visual output on display panel 1441 in accordance with the type of touch event. Although in FIG. 14, touch-sensitive surface 1431 and display panel 1441 are implemented as two separate components for input and output functions, in some embodiments, touch-sensitive surface 1431 may be integrated with display panel 1441 for input and output functions.
The second terminal 1400 can also include at least one sensor 1450, such as light sensors, motion sensors, and other sensors. The light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1441 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1441 and/or a backlight when the second terminal 1400 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be further configured on the second terminal 1400, detailed descriptions thereof are omitted.
The audio circuit 1460, speaker 1461, microphone 1462 may provide an audio interface between a user and the second terminal 1400. The audio circuit 1460 can transmit the received electrical signal converted from the audio data to the loudspeaker 1461, and the electrical signal is converted into a sound signal by the loudspeaker 1461 and output; on the other hand, the microphone 1462 converts collected sound signals into electric signals, converts the electric signals into audio data after being received by the audio circuit 1460, processes the audio data output processor 1480, and then transmits the processed audio data to, for example, another terminal via the communication unit 1410, or outputs the audio data to the memory 1420 for further processing. The audio circuit 1460 may also include an earbud jack to provide communication of a peripheral headset with the second terminal 1400.
To implement wireless communication, a wireless communication unit 1470 may be configured on the second terminal, and the wireless communication unit 1470 may be a WIFI module. WIFI belongs to a short-distance wireless transmission technology, and the second terminal 1400 may help a user to send and receive e-mails, browse webpages, access streaming media, and the like through the wireless communication unit 1470, which provides a wireless broadband internet access for the user. Although the wireless communication unit 1470 is illustrated in the drawing, it is understood that it does not belong to the essential constitution of the second terminal 1400 and may be omitted as needed within a scope not changing the essence of the invention.
The processor 1480, which is a control center of the second terminal 1400, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the second terminal 1400 and processes data by operating or executing software programs and/or modules stored in the memory 1420 and calling data stored in the memory 1420, thereby monitoring the entire cellular phone. Optionally, the processor 1480 may include one or more processing cores; preferably, the processor 1480 may integrate an application processor, which handles primarily operating systems, user interfaces, and applications, among others, with a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1480.
The second terminal 1400 further includes a power supply 1490 (e.g., a battery) for powering various components, which may be logically coupled to the processor 1480 via a power management system that may enable managing charging, discharging, and power consumption management functions. The power supply 1460 may also include any components including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the second terminal 1400 may further include a camera, a bluetooth module, etc., which will not be described herein.
In this embodiment, the second terminal also includes one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the file transfer method as follows.
When the first terminal and the second terminal are in the same local area network, receiving first audio information of a specified frequency broadcasted by the first terminal through the local area network, wherein the first audio information is generated by the first terminal based on first connection establishment information, and the first connection establishment information comprises address information of the first terminal and port information of a first socket object created by the first terminal.
And sending a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes connection between the first socket object and the second socket object established by the second terminal.
And carrying out file transmission with the first terminal through the connection between the first socket object and the second socket object.
Optionally, sending a connection establishment request to the first terminal based on the first audio information, including:
analyzing the first audio information to obtain second connection establishment information;
performing fault tolerance verification on the second connection establishment information based on the head information and the tail information of the second connection establishment information;
if the verification is passed, removing the head information and the tail information of the second connection establishment information to obtain first connection establishment information;
and sending a connection establishment request to the first terminal based on the first connection establishment information.
Optionally, performing fault tolerance verification on the second connection establishment information based on the header information and the trailer information of the second connection establishment information, including:
acquiring head information and tail information of second connection establishment information;
and if the acquired head information is the specified head information and the acquired tail information is the specified tail information, determining that the second connection establishment information is verified to be passed, otherwise, determining that the second connection establishment information is not verified to be passed.
Optionally, sending a connection establishment request to the first terminal based on the first connection establishment information, including:
analyzing the first connection establishment information according to a specified format to obtain address information of the first terminal and port information of the first socket object;
and sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
Optionally, when the first terminal and the second terminal are in the same local area network, before receiving the first audio information of the specified frequency broadcast by the first terminal through the local area network, the method further includes:
establishing wireless network connection with a first terminal to enable the first terminal and a second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the first terminal, and the first terminal and the second terminal are in the same local area network.
Optionally, the establishing a wireless network connection with the first terminal includes:
receiving second audio information of a designated frequency broadcasted by the first terminal in a wireless access point mode, wherein the second audio information is generated by the first terminal based on first access point information of the first terminal, and the first access point information at least comprises an access point identifier;
and sending a wireless network connection request to the first terminal based on the second audio information, so that the first terminal establishes wireless network connection with the second terminal, and the first terminal and the second terminal are in the same local area network.
Optionally, sending a wireless network connection request to the first terminal based on the second audio information, including:
analyzing the second audio information to obtain second access point information;
performing fault tolerance verification on the second access point information based on the head information and the tail information of the second access point information;
if the verification is passed, removing the head information and the tail information of the second access point information to obtain first access point information of the first terminal;
and sending a wireless network connection request to the first terminal based on the first access point information.
In the embodiment of the invention, when the first terminal and the second terminal are in the same local area network, the first terminal generates the first audio information with the appointed frequency based on the first connection establishment information, and broadcasts the first audio information through the local area network, so that the second terminal receives the first audio information. And through the local area network, the time for broadcasting the first audio information is short, the speed is high, so that the second terminal can also quickly receive the first audio information, the connection between the first socket object of the first terminal and the second socket object of the second terminal can be quickly established, and the file transmission efficiency is improved.
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 (22)
1. A file transmission method is applied to a first terminal, and comprises the following steps:
when the first terminal and the second terminal are in the same local area network, generating first connection establishment information according to a specified character string, address information of the first terminal and port information of a first socket object created by the first terminal and a specified format, wherein the specified character string is preset between the first terminal and the second terminal, the second terminal can recognize the first connection establishment information according to the specified character string, and the first connection establishment information comprises the address information of the first terminal and the port information of the first socket object;
adding appointed head information and appointed tail information to the first connection establishment information to obtain second connection establishment information, and converting the second connection establishment information into first audio information with appointed frequency, wherein the appointed head information and the appointed tail information are preset by the first terminal and the second terminal;
periodically broadcasting the first audio information through the local area network, analyzing the first audio information by the second terminal to obtain second connection establishment information, performing fault-tolerant verification on the second connection establishment information based on head information and tail information of the second connection establishment information, if the verification is not passed, receiving the first audio information again when the first terminal broadcasts the first audio information in the next period, and sending a connection establishment request to the first terminal based on the first audio information;
when a connection establishment request sent by the second terminal based on the first audio information is received, establishing a connection between the first socket object and a second socket object established by the second terminal;
and carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object.
2. The method as claimed in claim 1, wherein before generating the first connection establishment information according to the specified format based on the specified character string, the address information of the first terminal, and the port information of the first socket object created by the first terminal when the first terminal and the second terminal are in the same lan, the method further comprises:
establishing wireless network connection with the second terminal to enable the first terminal and the second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the second terminal, and the first terminal and the second terminal are in the same local area network.
3. The method of claim 2, wherein the establishing the wireless network connection with the second terminal comprises:
setting the first terminal to a wireless access point mode;
generating second audio information of a designated frequency based on first access point information of the first terminal, wherein the first access point information at least comprises an access point identifier;
broadcasting the second audio information in the wireless access point mode;
and when a wireless network connection request sent by the second terminal based on the second audio information is received, establishing wireless network connection with the second terminal.
4. The method of claim 3, wherein the generating second audio information of a specified frequency based on the first access point information for the first terminal comprises:
adding appointed head information and appointed tail information to first access point information of the first terminal to obtain second access point information;
and converting the second access point information into second audio information with a specified frequency.
5. A file transmission method is applied to a second terminal, and comprises the following steps:
when a first terminal and a second terminal are in the same local area network, receiving first audio information of specified frequency periodically broadcast by the first terminal through the local area network, wherein the first audio information is obtained by converting second connection establishment information from the first terminal, the second connection establishment information is obtained by adding specified head information and specified tail information to the first connection establishment information by the first terminal, the first connection establishment information is generated by the first terminal according to a specified character string, address information of the first terminal and port information of a first socket object created by the first terminal according to a specified format, the specified head information and the specified tail information are preset by the first terminal and the second terminal, and the specified character string is preset between the first terminal and the second terminal, the second terminal can identify the first connection establishment information according to the specified character string, wherein the first connection establishment information comprises address information of the first terminal and port information of the first socket object;
sending a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes a connection between the first socket object and a second socket object established by the second terminal;
performing file transmission with the first terminal through the connection between the first socket object and the second socket object;
wherein the sending a connection establishment request to the first terminal based on the first audio information comprises:
analyzing the first audio information to obtain second connection establishment information;
performing fault tolerance verification on the second connection establishment information based on the head information and the tail information of the second connection establishment information;
and if the verification is not passed, receiving the first audio information again when the first audio information is broadcasted in the next period of the first terminal, and sending a connection establishment request to the first terminal based on the first audio information.
6. The method of claim 5, wherein said sending a connection establishment request to the first terminal based on the first audio information comprises:
if the verification is passed, removing the head information and the tail information of the second connection establishment information to obtain the first connection establishment information;
and sending a connection establishment request to the first terminal based on the first connection establishment information.
7. The method of claim 5, wherein the fault tolerant verifying the second connection setup information based on header information and trailer information of the second connection setup information comprises:
acquiring head information and tail information of the second connection establishment information;
and if the acquired head information is the specified head information and the acquired tail information is the specified tail information, determining that the second connection establishment information is verified to be passed, otherwise, determining that the second connection establishment information is not verified to be passed.
8. The method of claim 6, wherein said sending a connection establishment request to the first terminal based on the first connection establishment information comprises:
analyzing the first connection establishment information according to a specified format to obtain address information of the first terminal and port information of the first socket object;
and sending a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
9. The method of claim 5, wherein before receiving the first audio information of the designated frequency periodically broadcasted by the first terminal through the local area network when the first terminal and the second terminal are in the same local area network, further comprising:
establishing wireless network connection with the first terminal to enable the first terminal and the second terminal to be in the same local area network; or,
and establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the first terminal, and the first terminal and the second terminal are in the same local area network.
10. The method of claim 9, wherein the establishing the wireless network connection with the first terminal comprises:
receiving second audio information of a designated frequency broadcasted by the first terminal in a wireless access point mode, wherein the second audio information is generated by the first terminal based on first access point information of the first terminal, and the first access point information at least comprises an access point identifier;
and sending a wireless network connection request to the first terminal based on the second audio information, so that the first terminal establishes wireless network connection with the second terminal.
11. The method of claim 10, wherein said sending a wireless network connection request to the first terminal based on the second audio information comprises:
analyzing the second audio information to obtain second access point information;
performing fault tolerance verification on the second access point information based on the head information and the tail information of the second access point information;
if the verification is passed, removing the head information and the tail information of the second access point information to obtain first access point information of the first terminal;
and sending a wireless network connection request to the first terminal based on the first access point information.
12. A file transfer apparatus, applied to a first terminal, the apparatus comprising:
a first generating module, configured to generate, according to a specified format, first connection establishment information according to a specified character string, address information of the first terminal, and port information of a first socket object created by the first terminal when the first terminal and a second terminal are in a same local area network, and generate first audio information of a specified frequency based on the first connection establishment information, where the specified character string is preset between the first terminal and the second terminal, and the second terminal may recognize the first connection establishment information according to the specified character string, and the first connection establishment information includes the address information of the first terminal and the port information of the first socket object;
a broadcast module, configured to periodically broadcast the first audio information through the local area network, where the first audio information is analyzed by the second terminal to obtain second connection establishment information, where the second connection establishment information is subjected to fault-tolerant verification based on header information and trailer information of the second connection establishment information, and if the second connection establishment information is not verified, the first audio information is received again when the first terminal broadcasts the first audio information in the next period, and a connection establishment request is sent to the first terminal based on the first audio information;
a first establishing module, configured to, when a connection establishment request sent by the second terminal based on the first audio information is received, establish a connection between the first socket object and a second socket object created by the second terminal;
the transmission module is used for carrying out file transmission with the second terminal through the connection between the first socket object and the second socket object;
wherein the first generating module comprises:
an adding unit, configured to add specified header information and specified trailer information to the first connection establishment information to obtain the second connection establishment information, where the specified header information and the specified trailer information are set in advance by the first terminal and the second terminal;
a conversion unit, configured to convert the second connection establishment information into first audio information with a specified frequency.
13. The apparatus of claim 12, wherein the apparatus further comprises:
the second establishing module is used for establishing wireless network connection with the second terminal so that the first terminal and the second terminal are in the same local area network; or,
and the third establishing module is used for establishing wireless network connection with the appointed access point based on the appointed access point information, wherein the appointed access point is an access point which is currently connected or to be connected with the second terminal, and the first terminal and the second terminal are in the same local area network.
14. The apparatus of claim 13, wherein the second establishing means comprises:
a setting unit configured to set the first terminal to a wireless access point mode;
a generating unit, configured to generate second audio information of a specified frequency based on first access point information of the first terminal, where the first access point information at least includes an access point identifier;
a broadcasting unit for broadcasting the second audio information in the wireless access point mode;
and the establishing unit is used for establishing wireless network connection with the second terminal when receiving a wireless network connection request sent by the second terminal based on the second audio information.
15. The apparatus of claim 14, wherein the generating unit comprises:
an adding subunit, configured to add specified header information and specified tail information to first access point information of the first terminal, to obtain second access point information;
a conversion subunit, configured to convert the second access point information into second audio information of a specified frequency.
16. A file transfer apparatus, applied to a second terminal, the apparatus comprising:
a receiving module, configured to receive first audio information of an assigned frequency periodically broadcast by a first terminal through a local area network when the first terminal and a second terminal are in the same local area network, where the first audio information is obtained by converting first connection establishment information to the second connection establishment information, the second connection establishment information is obtained by adding, to the first connection establishment information, assigned header information and assigned trailer information by the first terminal, and the first connection establishment information is generated according to an assigned format by the first terminal according to an assigned character string, address information of the first terminal, and port information of a first socket object created by the first terminal, where the assigned header information and the assigned trailer information are set in advance for the first terminal and the second terminal, and the assigned character string is set in advance between the first terminal and the second terminal, the second terminal can identify the first connection establishment information according to the specified character string, wherein the first connection establishment information comprises address information of the first terminal and port information of the first socket object;
a sending module, configured to send a connection establishment request to the first terminal based on the first audio information, so that the first terminal establishes a connection between the first socket object and a second socket object created by the second terminal;
the transmission module is used for carrying out file transmission with the first terminal through the connection between the first socket object and the second socket object;
wherein the sending module comprises:
the analysis unit is used for analyzing the first audio information to obtain the second connection establishment information;
a verification unit, configured to perform fault-tolerant verification on the second connection establishment information based on header information and trailer information of the second connection establishment information;
wherein the sending module is further configured to:
and if the verification is not passed, receiving the first audio information again when the first audio information is broadcasted in the next period of the first terminal, and sending a connection establishment request to the first terminal based on the first audio information.
17. The apparatus of claim 16, wherein the sending module comprises:
a removing unit, configured to remove header information and trailer information of the second connection establishment information to obtain the first connection establishment information if the verification passes;
a first sending unit, configured to send a connection establishment request to the first terminal based on the first connection establishment information.
18. The apparatus of claim 17, wherein the authentication unit comprises:
an obtaining subunit, configured to obtain header information and tail information of the second connection establishment information;
and the determining subunit is configured to determine that the second connection establishment information is verified to be passed if the acquired header information is the specified header information and the acquired trailer information is the specified trailer information, and otherwise, determine that the second connection establishment information is not verified to be passed.
19. The apparatus of claim 17, wherein the first sending unit comprises:
a first parsing subunit, configured to parse the first connection establishment information according to a specified format to obtain address information of the first terminal and port information of the first socket object;
and the first sending subunit is configured to send a connection establishment request to the first terminal based on the address information of the first terminal and the port information of the first socket object.
20. The apparatus of claim 16, wherein the apparatus further comprises:
the first establishing module is used for establishing wireless network connection with the first terminal so that the first terminal and the second terminal are in the same local area network; or,
and the second establishing module is used for establishing wireless network connection with the designated access point based on the designated access point information, wherein the designated access point is the access point which is currently connected or to be connected with the first terminal, and the first terminal and the second terminal are in the same local area network.
21. The apparatus of claim 20, wherein the first establishing module comprises:
a receiving unit, configured to receive second audio information of a specified frequency broadcasted by the first terminal in a wireless access point mode, where the second audio information is generated by the first terminal based on first access point information of the first terminal, and the first access point information at least includes an access point identifier;
and the second sending unit is used for sending a wireless network connection request to the first terminal based on the second audio information so that the first terminal establishes wireless network connection with the second terminal, and the first terminal and the second terminal are in the same local area network.
22. The apparatus of claim 21, wherein the second transmitting unit comprises:
the second analysis subunit is used for analyzing the second audio information to obtain second access point information;
the verification subunit is used for performing fault-tolerant verification on the second access point information based on the head information and the tail information of the second access point information;
a removing subunit, configured to remove, if the verification passes, the header information and the trailer information of the second access point information to obtain first access point information of the first terminal;
and the second sending subunit is configured to send a wireless network connection request to the first terminal based on the first access point information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510081000.3A CN104702678B (en) | 2015-02-13 | 2015-02-13 | Document transmission method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510081000.3A CN104702678B (en) | 2015-02-13 | 2015-02-13 | Document transmission method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104702678A CN104702678A (en) | 2015-06-10 |
CN104702678B true CN104702678B (en) | 2019-04-02 |
Family
ID=53349437
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510081000.3A Active CN104702678B (en) | 2015-02-13 | 2015-02-13 | Document transmission method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104702678B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105764116A (en) * | 2016-02-22 | 2016-07-13 | 努比亚技术有限公司 | Method of connection between terminals and terminal |
CN108696547A (en) * | 2017-02-28 | 2018-10-23 | 中兴通讯股份有限公司 | Document transmission method, apparatus and system |
CN108984621A (en) * | 2018-06-14 | 2018-12-11 | 王怡科 | Information storage, read method |
CN109862526A (en) * | 2019-01-28 | 2019-06-07 | 平安科技(深圳)有限公司 | Document transmission method, device, computer equipment and storage medium |
CN114285873B (en) * | 2021-12-09 | 2024-01-02 | 阿波罗智联(北京)科技有限公司 | Method, device, equipment and storage medium for establishing communication connection |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102695148A (en) * | 2012-06-01 | 2012-09-26 | 上海车音网络科技有限公司 | Methods and devices for sending and receiving short message, and short message sending and receiving system |
CN103826208A (en) * | 2014-01-22 | 2014-05-28 | 深圳市同洲电子股份有限公司 | Wireless interaction method, terminal and system |
CN104092712A (en) * | 2013-05-22 | 2014-10-08 | 腾讯科技(深圳)有限公司 | Method and system used for file transmission based on audio signals |
-
2015
- 2015-02-13 CN CN201510081000.3A patent/CN104702678B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102695148A (en) * | 2012-06-01 | 2012-09-26 | 上海车音网络科技有限公司 | Methods and devices for sending and receiving short message, and short message sending and receiving system |
CN104092712A (en) * | 2013-05-22 | 2014-10-08 | 腾讯科技(深圳)有限公司 | Method and system used for file transmission based on audio signals |
CN103826208A (en) * | 2014-01-22 | 2014-05-28 | 深圳市同洲电子股份有限公司 | Wireless interaction method, terminal and system |
Also Published As
Publication number | Publication date |
---|---|
CN104702678A (en) | 2015-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107094294B (en) | Network connection method and device | |
US10304461B2 (en) | Remote electronic service requesting and processing method, server, and terminal | |
WO2015090248A1 (en) | Server overload protection method and device | |
CN109005527B (en) | Data transmission method and terminal | |
CN104702678B (en) | Document transmission method and device | |
WO2015014144A1 (en) | Method and apparatus for installing application, and terminal device | |
CN109257793B (en) | Network connection method, device, equipment and storage medium | |
CN109088844B (en) | Information interception method, terminal, server and system | |
CN109039989B (en) | Address resolution protocol spoofing detection method, host and computer-readable storage medium | |
WO2017096909A1 (en) | Data connection establishing method and apparatus | |
CN110933704B (en) | Network communication method, device, storage medium and electronic equipment | |
TW201519601A (en) | Method and device for managing a router | |
CN113489630A (en) | Network distribution method, device, storage medium and electronic terminal | |
CN109495769B (en) | Video communication method, terminal, smart television, server and storage medium | |
CN104917905B (en) | Processing method, terminal and the server of Stranger Calls | |
CN107317828B (en) | File downloading method and device | |
CN106470234B (en) | Equipment discovery method and device | |
CN111800794A (en) | Method and device for determining position of demodulation reference signal | |
CN112839326A (en) | Network switching method, device, storage medium and gateway equipment | |
US9965341B2 (en) | Method and device for exchanging data between processes | |
US20140344423A1 (en) | Method, apparatus and system for switching function mode | |
CN111615219B (en) | PC5 link establishing method, equipment and system | |
CN106817370B (en) | Method and device for transmitting network data | |
CN106330875B (en) | Message display method and device | |
CN105681723B (en) | Audio and video call method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |