CN104702678B - Document transmission method and device - Google Patents

Document transmission method and device Download PDF

Info

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
audio
frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510081000.3A
Other languages
Chinese (zh)
Other versions
CN104702678A (en
Inventor
张兴华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510081000.3A priority Critical patent/CN104702678B/en
Publication of CN104702678A publication Critical patent/CN104702678A/en
Application granted granted Critical
Publication of CN104702678B publication Critical patent/CN104702678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network 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

Document transmission method and device
Technical field
The present invention relates to the communications field, in particular to a kind of document transmission method and device.
Background technique
When transmitting file with the fast development of the communication technology, between multiple terminals, it can not only be passed by bluetooth It is defeated, it can be transmitted with the data traffic of using terminal by network.And when being transmitted by network, it can expend a large amount of Data traffic, when the data traffic of consuming be user charges data traffic when, can for user generate extra-pay.
Currently, providing a kind of document transmission method, data traffic can be saved, specifically: it sets first terminal to Wireless access dot pattern, and broadcast the access point identity of first terminal.Multiple connecing of the second terminal to position covering is presently in Access point is scanned, and obtains multiple access point identities.When second terminal gets first terminal from multiple access point identity Access point identity when, the access point identity based on first terminal is connected on first terminal.At this point, first terminal and second Terminal is in same local area network.Then, it is right that socket (English: socket) is respectively created in first terminal and second terminal As, and be respectively that the socket object word created distributes a port number.Second terminal obtains multiple IP (English in locating local area network Text: Internet Protocol, Chinese: Internet protocol) address, for each IP address in multiple IP address, to The corresponding terminal of the IP address sends verifying message.When the sound for receiving the corresponding terminal transmission of the IP address in specified duration When answering message, determine that the IP address is the IP address of first terminal.It is corresponding when being not received by the IP address in specified duration Terminal send response message, it is determined that the corresponding terminal of the IP address is not present, to the corresponding terminal of next IP address Verifying message is sent, until getting the IP address of first terminal.Then, IP address of the second terminal based on first terminal Port numbers corresponding with the socket object word of first terminal send connection to first terminal and establish request, establish first terminal Connection between the socket object word of first terminal and the socket object word of second terminal, and file biography is carried out by the connection It is defeated.
When second terminal obtains the IP address of first terminal by the above method, need to multiple IP in the local area network Location is verified, until getting the IP address of first terminal;Verified every time in the verification process at least need to expend it is specified Duration, the verification time needed for causing before transmission is longer, reduces the efficiency of file transmission.
Summary of the invention
In order to improve file transmission efficiency, the embodiment of the invention provides a kind of document transmission method and devices.The skill Art scheme is as follows:
In a first aspect, providing a kind of document transmission method, which comprises
When first terminal and second terminal are in same local area network, information is established based on the first connection, generates specified frequency The address information and the first terminal that information includes the first terminal are established in first audio-frequency information of rate, first connection The port information of the first set of words object of creation;
By the local area network, first audio-frequency information is broadcasted;
When receiving the connection foundation request that the second terminal is sent based on first audio-frequency information, described in foundation Connection between first set of words object and the second socket object word of second terminal creation;
By the first set of words object and it is described second socket object word between connection, with the second terminal into Part of composing a piece of writing transmits.
Second aspect provides a kind of document transmission method, which comprises
When first terminal and second terminal are in same local area network, it is wide by the local area network to receive the first terminal First audio-frequency information of the assigned frequency broadcast, first audio-frequency information are based on the first connection for the first terminal and establish information It generates, the first set of the address information that information includes the first terminal and first terminal creation is established in first connection Connect the port information of object word;
Based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request, builds the first terminal Stand the connection between the first set of words object and the second socket object word of second terminal creation;
By the first set of words object and it is described second socket object word between connection, with the first terminal into Part of composing a piece of writing transmits.
The third aspect, provides a kind of file transfer means, and described device includes:
First generation module, for connecting and building based on first when first terminal and second terminal be in same local area network Vertical information, generates the first audio-frequency information of assigned frequency, and the address that information includes the first terminal is established in first connection The port information of information and the first set of words object of first terminal creation;
Broadcast module, for broadcasting first audio-frequency information by the local area network;
First establishes module, builds for that ought receive the connection that the second terminal is sent based on first audio-frequency information When vertical request, the connection between the first set of words object and the second socket object word of second terminal creation is established;
Transmission module, for being socketed the connection between object word by the first set of words object and described second, with The second terminal carries out file transmission.
Fourth aspect, provides a kind of file transfer means, and described device includes:
Receiving module leads to for when first terminal and second terminal be in same local area network, receiving the first terminal Cross the first audio-frequency information of the assigned frequency of the LAN broadcast, first audio-frequency information is that the first terminal is based on the Information generation is established in one connection, and the address information that information includes the first terminal and first end are established in first connection Hold the port information of the first set of words object of creation;
Sending module, for being based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request, makes institute State the connection that first terminal is established between the first set of words object and the second socket object word of second terminal creation;
Transmission module, for being socketed the connection between object word by the first set of words object and described second, with The first terminal carries out file transmission.
Technical solution provided in an embodiment of the present invention has the benefit that
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of document transmission method flow chart provided in an embodiment of the present invention;
Fig. 2 is another document transmission method flow chart provided in an embodiment of the present invention;
Fig. 3 is another document transmission method flow chart provided in an embodiment of the present invention;
Fig. 4 is a kind of file transfer means structural schematic diagram provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of first generation module provided in an embodiment of the present invention;
Fig. 6 is another file transfer means structural schematic diagram provided in an embodiment of the present invention;
Fig. 7 is another file transfer means structural schematic diagram provided in an embodiment of the present invention;
Fig. 8 is the provided in an embodiment of the present invention a kind of second structural schematic diagram for establishing module;
Fig. 9 is another file transfer means structural schematic diagram provided in an embodiment of the present invention;
Figure 10 is a kind of structural schematic diagram of sending module provided in an embodiment of the present invention;
Figure 11 is another file transfer means structural schematic diagram provided in an embodiment of the present invention;
Figure 12 is the provided in an embodiment of the present invention a kind of first structural schematic diagram for establishing module;
Figure 13 is a kind of structural schematic diagram of first terminal provided in an embodiment of the present invention;
Figure 14 is a kind of structural schematic diagram of second terminal provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is a kind of document transmission method flow chart provided in an embodiment of the present invention.The executing subject of this method can be First terminal, referring to Fig. 1, this method comprises:
Step 101: when first terminal and second terminal are in same local area network, information is established based on the first connection, it is raw At the first audio-frequency information of assigned frequency, the address information that information includes first terminal and first terminal creation are established in the first connection First set of words object port information.
Step 102: by the local area network, broadcasting the first audio-frequency information.
Step 103: when receiving the connection foundation request that second terminal is sent based on the first audio-frequency information, establishing first The connection being socketed between object word and the second socket object word of second terminal creation.
Step 104: by the connection between first set of words object and the second socket object word, carrying out text with second terminal Part transmission.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Optionally, information is established based on the first connection, generates the first audio-frequency information of assigned frequency, comprising:
Information is established to the first connection and adds specified header information and specified trailer information, is obtained the second connection and is established letter Breath;
The first audio-frequency information that information is converted to assigned frequency is established into second connection.
Optionally, information is established based on the first connection, before the first audio-frequency information for generating assigned frequency, further includes:
According to designated character string, the port information of the address information of first terminal and first set of words object, according to specified Format generates the first connection and establishes information.
Optionally, when first terminal and second terminal are in same local area network, information is established based on the first connection, is generated Before first audio-frequency information of assigned frequency, further includes:
The wireless network connection between second terminal is established, first terminal and second terminal is made to be in same local area network; Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, specifying access point is the Currently attached or the to be connected access point of two terminals makes first terminal and second terminal be in same local area network.
Optionally, the wireless network connection between second terminal is established, comprising:
Wireless access dot pattern is set by first terminal;
The first access-in point information based on first terminal generates the second audio-frequency information of assigned frequency, the first access point letter Breath includes at least access point identity;
Under wireless access dot pattern, the second audio-frequency information is broadcasted;
When receiving the wireless network connection request that second terminal is sent based on the second audio-frequency information, establish with second eventually Wireless network connection between end.
Optionally, the first access-in point information based on first terminal generates the second audio-frequency information of assigned frequency, comprising:
Specified header information and specified trailer information are added to the first access-in point information of first terminal, obtains the second access Point information;
Second access-in point information is converted to the second audio-frequency information of assigned frequency.
All the above alternatives, can form alternative embodiment of the invention according to any combination, and the present invention is real It applies example and this is no longer repeated one by one.
Fig. 2 is a kind of document transmission method flow chart provided in an embodiment of the present invention.The executing subject of this method can be Second terminal, referring to fig. 2, this method comprises:
Step 201: when first terminal and second terminal are in same local area network, receiving first terminal and pass through the local area network First audio-frequency information of the assigned frequency of broadcast, the first audio-frequency information are based on the first connection for first terminal and establish information generation, The port letter of the first set of words object of the address information that information includes first terminal and first terminal creation is established in first connection Breath.
Step 202: being based on the first audio-frequency information, send connection to first terminal and establish request, first terminal is made to establish the Connection between one socket object word and the second socket object word of second terminal creation.
Step 203: by the connection between first set of words object and the second socket object word, carrying out text with first terminal Part transmission.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Optionally, it is based on the first audio-frequency information, connection is sent to first terminal and establishes request, comprising:
First audio-frequency information is parsed, the second connection is obtained and establishes information;
The header information and trailer information that information is established based on the second connection are established information to the second connection and carry out fault-tolerant test Card;
If the verification passes, then removal second connects the header information and trailer information for establishing information, obtains the first connection Establish information;
Information is established based on the first connection, connection is sent to first terminal and establishes request.
Optionally, the header information and trailer information of information are established based on the second connection, to the second connection establish information into The fault-tolerant verifying of row, comprising:
Obtain header information and trailer information that information is established in the second connection;
If the header information obtained is specified header information and the trailer information that obtains is specified trailer information, it is determined that Second connection is established Information Authentication and is passed through, otherwise, it determines the second connection is established Information Authentication and do not passed through.
Optionally, information is established based on the first connection, sends connection to first terminal and establishes request, comprising:
According to specified format, information is established to the first connection and is parsed, the address information and first of first terminal is obtained It is socketed the port information of object word;
The port information of address information and first set of words object based on first terminal sends connection to first terminal and builds Vertical request.
Optionally, when first terminal and second terminal are in same local area network, it is wide by local area network to receive first terminal Before first audio-frequency information of the assigned frequency broadcast, further includes:
The wireless network connection between first terminal is established, first terminal and second terminal is made to be in same local area network; Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, specifying access point is the Currently attached or the to be connected access point of one terminal makes first terminal and second terminal be in same local area network.
Optionally, the wireless network connection between first terminal is established, comprising:
Receive the second audio-frequency information of the assigned frequency that first terminal is broadcasted under wireless access dot pattern, the second audio letter Breath is that first terminal is generated based on the first access-in point information of first terminal, and the first access-in point information includes at least access point mark Know;
Based on the second audio-frequency information, wireless network connection request is sent to first terminal, establishes first terminal and second Wireless network connection between terminal.
Optionally, it is based on the second audio-frequency information, sends wireless network connection request to first terminal, comprising:
Second audio-frequency information is parsed, the second access-in point information is obtained;
Header information and trailer information based on the second access-in point information carry out fault-tolerant verifying to the second access-in point information;
If the verification passes, then the header information and trailer information for removing the second access-in point information, obtain first terminal First access-in point information;
Based on the first access-in point information, wireless network connection request is sent to first terminal.
All the above alternatives, can form alternative embodiment of the invention according to any combination, and the present invention is real It applies example and this is no longer repeated one by one.
Fig. 3 is a kind of document transmission method flow chart provided in an embodiment of the present invention.Referring to Fig. 3, this method comprises:
Step 301: when first terminal and second terminal are in same local area network, first terminal is based on the first connection and establishes Information, generates the first audio-frequency information of assigned frequency, and the address information and first that information includes first terminal is established in the first connection The port information of the first set of words object of terminal creation.
First terminal is based on the first connection and establishes information, and when generating the first audio-frequency information of assigned frequency, first terminal can The first audio-frequency information that information is converted to assigned frequency directly is established in the first connection.
Optionally, in order to improve file transmission reliability, avoid the first audio-frequency information from malfunctioning in transmission process, first Terminal is based on the first connection and establishes information, when generating the first audio-frequency information of assigned frequency, can establish information to the first connection Specified header information and specified trailer information are added, the second connection is obtained and establishes information;Information is established in second connection to be converted to First audio-frequency information of assigned frequency.
It should be noted that in embodiments of the present invention, establishing the specified header information of information addition to the first connection and referring to When determining trailer information, specified header information can be added on the head that information is established in the first connection, establish information in the first connection Tail portion add specified trailer information, the embodiment of the present invention is to this without elaborating.In addition, specifying header information and specifying Trailer information is that first terminal and second terminal are set in advance, and the embodiment of the present invention is not specifically limited in this embodiment.
For example, specified header information is XY, specifying trailer information is 00, and it can be jiexie# that information is established in the first connection 211.144.172.14#2, at this point, establishing information to the first connection adds specified header information and specified trailer information, the is obtained It is XY jiexie#211.144.172.14#200 that information is established in two connections.
In addition, the address information of first terminal can be first terminal IP address, it is, of course, also possible to for other addresses, The embodiment of the present invention is not specifically limited in this embodiment.Furthermore first set of words object can be Socket (socket), and first set The port information for connecing object word may include port numbers, configuration information of port etc., and the embodiment of the present invention, which does not equally do this, to be had Body limits.
Further, it in order to avoid the first audio-frequency information that malefactor is broadcasted based on first terminal, is sent out to first terminal Connection is sent to establish request, first terminal is based on the first connection and establishes information, before the first audio-frequency information for generating assigned frequency, also It include: according to the port information of designated character string, the address information of first terminal and first set of words object, according to specified lattice Formula generates the first connection and establishes information.
Wherein, designated character string is set in advance between first terminal and second terminal, and second terminal can basis Designated character string recognizes the first connection and establishes information.In addition, specified format is also prior between first terminal and second terminal Be arranged, and the specified format may include it is a variety of, for example, the port of the address information of first terminal, first set of words object The mode of information and designated character string sequential series, the address information of first terminal, the port information of first set of words object and Concatenated mode of designated character string backward etc., the embodiment of the present invention is not specifically limited in this embodiment.
For example, the address information of first terminal is 211.144.172.14, the port information of first set of words object is 2, Designated character string is jiexie, and specified rule is " the address information # first set of words object of designated character string # first terminal Port information ", at this point, according to the address information 211.144.172.14 of first terminal, the port information 2 of first set of words object With designated character string jiexie, according to specified rule, generating the first connection and establishing information is jiexie#211.144.172.14# 2。
In addition, in embodiments of the present invention, the address information of first terminal and the port information of first set of words object can To be made of a string of letters, number, punctuation marks etc., for ease of description, letter, number, punctuation mark etc. are referred to as word Symbol, and the corresponding relationship between character and frequency can be stored in advance in first terminal, in the corresponding relationship, each character is corresponding Frequency be assigned frequency.Therefore, when the first audio that information is converted to assigned frequency is established in the first connection by first terminal Information, or when establishing information by the second connection and be converted to the first audio-frequency information of assigned frequency, first terminal can be based on the The character that information includes is established in one connection, from the corresponding relationship between the character and frequency, obtains corresponding frequency, thus raw At the first audio-frequency information of assigned frequency, realize that the conversion of information is established in the first connection.Alternatively, first terminal can be based on second The character that information includes is established in connection, from the corresponding relationship between the character and frequency, corresponding frequency is obtained, to generate First audio-frequency information of assigned frequency realizes that the conversion of information is established in the second connection.
For example, first terminal storage character and frequency between corresponding relationship in, the corresponding frequency of character j be 10Hz, The corresponding frequency of character i is 15Hz, and the corresponding frequency of character e is 11Hz, and the corresponding frequency of character x is 25Hz, and character # is corresponding Frequency is 20Hz, and the corresponding frequency of character 2 is 14Hz, and the corresponding frequency of character 1 is 5Hz, and the corresponding frequency of character is 40Hz, The corresponding frequency of character 4 is 33Hz, and the corresponding frequency of character 7 is 50Hz.When the first connection is established information conversion by first terminal For assigned frequency the first audio-frequency information when, the first audio-frequency information can be 10Hz15Hz11Hz25Hz15Hz11Hz20Hz14H z5Hz5Hz40Hz5Hz33Hz33Hz40Hz5Hz50Hz14Hz40Hz5Hz33Hz20Hz14Hz。
In the embodiment of the present invention, when first terminal and second terminal are in same local area network, first terminal and second is eventually It when carrying out file transmission between end, can be transmitted by the local area network, without passing through operator, it is therefore not necessary to waste use The data traffic at family, and then will not relate to payment data flow, it avoids generating extra-pay for user.And make first terminal The mode that same local area network is in second terminal may include two kinds, specific as follows:
First way, first terminal are based on specified access-in point information, establish the wireless network between specified access point Connection.Second terminal is based on specified access-in point information, establishes the wireless network connection between specified access point.
Since first terminal connects same access point with second terminal, specified access point that is to say, therefore, the specified access Point can be currently attached or the to be connected access point of first terminal, alternatively, the specified access point can be second terminal Currently attached or to be connected access point.
It is directed to first way, when first terminal and second terminal connect same access point and using hotspot simultaneously Network, when there is no using data traffic, first terminal and second terminal are in same local area network.And work as first terminal and second Terminal does not use hotspot network, and when using data traffic, needs first terminal and second terminal by following the Two kinds of modes make first terminal and second terminal be in same local area network.
Wireless network connection between the second way, foundation and second terminal is in first terminal and second terminal Same local area network.
For first way, first terminal can set first terminal to wireless access dot pattern;Eventually based on first First access-in point information at end, generates the second audio-frequency information of assigned frequency, and the first access-in point information includes at least access point mark Know;First terminal broadcasts the second audio-frequency information under wireless access dot pattern.When second terminal receives first terminal wireless When the second audio-frequency information of the assigned frequency broadcasted under access point mode, it is based on the second audio-frequency information, sends nothing to first terminal Line network connecting request.When first terminal receives the wireless network connection request that second terminal is sent based on the second audio-frequency information When, the wireless network connection between first terminal and second terminal is established, first terminal and second terminal is made to be in same local Net.
First access-in point information of the first terminal based on first terminal, when generating the second audio-frequency information of assigned frequency, the First access-in point information of first terminal can be converted directly into the second audio-frequency information of assigned frequency by one terminal.Correspondingly, When second terminal receives the second audio-frequency information of the assigned frequency that first terminal is broadcasted under wireless access dot pattern, second Terminal is based on the second audio-frequency information, sends wireless network connection request to first terminal, comprising: second terminal believes the second audio Breath is parsed, and the first access-in point information is obtained, and is based on the first access-in point information, is sent wireless network connection to first terminal and is asked It asks.
Optionally, in order to improve file transmission reliability, avoid the second audio-frequency information from malfunctioning in transmission process, first First access-in point information of the terminal based on first terminal, generates the second audio-frequency information of assigned frequency, comprising: first terminal is to First access-in point information of one terminal adds specified header information and specified trailer information, obtains the second access-in point information;By Two access-in point informations are converted to the second audio-frequency information of assigned frequency.Correspondingly, when second terminal receives first terminal in nothing When the second audio-frequency information of the assigned frequency broadcasted under line access point mode, second terminal is based on the second audio-frequency information, to first Terminal sends wireless network connection request, comprising: second terminal parses the second audio-frequency information, obtains the second access point letter Breath;Header information and trailer information based on the second access-in point information carry out fault-tolerant verifying to the second access-in point information;If tested Card passes through, then removes the header information and trailer information of the second access-in point information, obtains the first access-in point information of first terminal; Based on the first access-in point information, wireless network connection request is sent to first terminal.
It should be noted that in embodiments of the present invention, adding specified header information to the first access-in point information and specifying When trailer information, specified header information can be added on the head of the first access-in point information, in the tail portion of the first access-in point information Specified trailer information is added, the embodiment of the present invention is to this without elaborating.
For example, it is myssid that the first access-in point information, which includes access point identity, at this point, referring to the addition of the first access-in point information Determine header information and specified trailer information, obtaining the second access-in point information is XYmyssid00.It, will according to the method for above-mentioned example The second audio-frequency information that second access-in point information is converted to assigned frequency is 30Hz35Hz22Hz35Hz28Hz28Hz15Hz45Hz 8Hz8Hz.Correspondingly, when second terminal receives the second of the assigned frequency that first terminal is broadcasted under wireless access dot pattern When audio-frequency information, second terminal parses the second audio-frequency information, and obtaining the second access-in point information is XYmyssid00;It is based on The header information XY and trailer information 00 of second access-in point information carry out fault-tolerant verifying to the second access-in point information;If verifying Pass through, then remove the header information XY and trailer information 00 of the second access-in point information, obtains the first access point letter of first terminal Breath is myssid;Based on the first access-in point information, wireless network connection request is sent to first terminal.
Wherein, header information and trailer information of the second terminal based on the second access-in point information, to the second access-in point information Carry out fault-tolerant verifying, comprising: second terminal obtains the header information and trailer information of the second access-in point information;If the head obtained Portion's information is specified header information and the trailer information that obtains is specified trailer information, it is determined that the verifying of the second access-in point information is logical It crosses, otherwise, it determines the verifying of the second access-in point information does not pass through.
Further, first terminal can be broadcast periodically the second audio-frequency information, when second terminal is true in current period It when fixed second access-in point information is verified, determines that the second audio-frequency information does not malfunction in transmission process, determines that the second audio is believed Breath is accurate, establishes wireless network connection in current period and first terminal.And when second terminal determines that second connects in current period Access point Information Authentication is obstructed out-of-date, determines that the second audio-frequency information malfunctions in transmission process, determines the second audio-frequency information inaccuracy, The second audio-frequency information can be received again, according still further to above-mentioned side when first terminal next cycle broadcasts the second audio-frequency information Method establishes the wireless network connection between first terminal.
In addition, in embodiments of the present invention, the first access-in point information and the second access-in point information can by a string of letters, Letter, number, punctuation mark etc. are referred to as character for ease of description by the composition such as number, punctuation mark, and first terminal In can be stored in advance corresponding relationship between character and frequency, in the corresponding relationship, the corresponding frequency of each character as refers to Determine frequency.Therefore, when the first access-in point information is converted to the second audio-frequency information of assigned frequency by first terminal, first terminal The character that can include based on the first access-in point information obtains corresponding frequency from the corresponding relationship between the character and frequency Rate realizes the conversion of the first access-in point information to generate the second audio-frequency information of assigned frequency.Correspondingly, in second terminal In the corresponding relationship that also can store between the character and frequency can when second terminal parses the second audio-frequency information With the frequency for including based on the second audio-frequency information, from the corresponding relationship between the character and frequency, corresponding character is obtained, from And the first access-in point information is obtained, realize the parsing of the second audio-frequency information.
Alternatively, first eventually when the second access-in point information is converted to the second audio-frequency information of assigned frequency by first terminal The character that can include based on the second access-in point information is held, from the corresponding relationship between the character and frequency, is obtained corresponding Frequency realizes the conversion of the second access-in point information to generate the second audio-frequency information of assigned frequency.Correspondingly, when second is whole When end parses the second audio-frequency information, the frequency that can include based on the second audio-frequency information, between the character and frequency Corresponding relationship in, obtain corresponding character, to obtain the second access-in point information, realize the parsing of the second audio-frequency information.
It can also include the information such as access point password furthermore the first access-in point information not only may include access point identity. When the first access-in point information includes access point identity, second terminal is based on the first access-in point information, sends nothing to first terminal When line network connecting request, second terminal can be directly based upon access point identity, send wireless network connection to first terminal and ask It asks.And when the first access-in point information further includes access point password, first terminal is based on the first access-in point information, generates specified frequency Before second audio-frequency information of rate, further includes: first terminal is pressed according to designated character string, access point identity and access point password According to specified format, the first access-in point information is generated.Correspondingly, when second terminal is based on the first access-in point information, to first terminal When sending wireless network connection request, second terminal can parse the first access-in point information, obtain according to specified format Access point identity and access point password are based on access point identity and access point password, send wireless network connection to first terminal Request.
For example, the first access-in point information not only includes access point identity myssid, it further include access point password mima2233, Designated character string is jiexie, and specified rule is " designated character string # access point identity # access point password ", at this point, according to access Point identification myssid, access point password mima2233 and designated character string jiexie generate the first access point according to specified rule Information is jiexie#myssid#mima2233.Correspondingly, when second terminal is based on the first access-in point information jiexie# Myssid#mima2233, when sending wireless network connection request to first terminal, second terminal can be right according to specified format First access-in point information jiexie#myssid#mima2233 is parsed, and access point identity myssid and access point password are obtained Mima2233 is based on access point identity myssid and access point password mima2233, sends wireless network connection to first terminal Request.
In embodiments of the present invention, when setting wireless access point (AP for first terminal;Access Point) mode when, First terminal can be used as the core of hotspot network, and broadcast the second audio-frequency information.Optionally, it can be wrapped in general terminal The function of hotspot is included, so, in embodiments of the present invention, user can be by opening the included hotspot of first terminal Function, set hotspot mode for first terminal.
In addition, hotspot network can be WIFI (Wireless Fidelity;Wireless Fidelity) network may be used also certainly Think other networks, as long as being not necessarily to the network of data traffic, the embodiment of the present invention is not specifically limited in this embodiment.Again Person, access point identity can be SSID (Service Set Identifier;Service set), access point identity can be should The title of access point, factory number of the access point etc., and to can be user prior for access point identity and access point password It is arranged in first terminal, is also possible to first terminal default setting, the embodiment of the present invention does not do specific limit equally to this It is fixed.
It should be noted that second terminal can carry second eventually into the wireless network connection request that first terminal is sent The address information etc. at end, the embodiment of the present invention is not specifically limited in this embodiment.In addition, the data being related in embodiments of the present invention Flow is generated data traffic of being surfed the Internet by mobile communication technology, and works as terminal and use the data traffic, is needed to the number Certain expense is paid according to operator belonging to flow.In practical applications, user can by buy data traffic set meal, When terminal uses the data traffic in set meal, extra-pay will not be generated for user, when the data traffic used is more than set When data traffic in meal, user needs to pay extra-pay.Therefore, the method provided through the embodiment of the present invention, will not The data traffic of user is expended, and then avoids generating extra-pay for user.
Step 302: first terminal broadcasts the first audio-frequency information by the local area network.
Specifically, first terminal can be broadcast periodically the first audio-frequency information by the local area network.For example, first is whole End can be every first audio-frequency information of broadcast in 5 seconds.
Step 303: passing through the first audio of the assigned frequency of the LAN broadcast when second terminal receives first terminal When information, it is based on the first audio-frequency information, connection is sent to first terminal and establishes request.
In the case where the first connection is directly established the scene that information is converted to for first terminal by the first audio-frequency information, when It, can be to the first sound when second terminal receives first audio-frequency information of the first terminal by the assigned frequency of the LAN broadcast Frequency information is parsed, and is obtained the first connection and is established information.Information is established based on the first connection, connection is sent to first terminal and builds Vertical request.
It is under the second connection is established the scene that information is converted to by first terminal, when second in the first audio-frequency information When terminal receives first audio-frequency information of the first terminal by the assigned frequency of the LAN broadcast, the first audio can be believed Breath is parsed, and is obtained the second connection and is established information;The header information and trailer information of information are established based on the second connection, to the Two connections establish information and carry out fault-tolerant verifying;If the verification passes, then removal second connects the header information and tail for establishing information Portion's information obtains the first connection and establishes information;Information is established based on the first connection, connection is sent to first terminal and establishes request.
For example, the first audio-frequency information can be 10Hz15Hz11Hz25Hz15Hz11Hz20Hz14Hz5Hz5Hz40Hz5Hz 33Hz33Hz40Hz5Hz50Hz14Hz40Hz5Hz33Hz20Hz14Hz, according to the corresponding relationship between character and frequency, to One audio-frequency information is parsed, and obtains the second connection and establish information to be XY jiexie#211.144.172.14#200;Based on The header information XY and trailer information 00 of information are established in two connections, are established information to the second connection and are carried out fault-tolerant verifying;If tested Card passes through, then removes header information XY and trailer information 00 that information is established in the second connection, obtain the first connection and establish information jiexie#211.144.172.14#2;Information is established based on the first connection, connection is sent to first terminal and establishes request.
Wherein, second terminal establishes the header information and trailer information of information based on the second connection, establishes to the second connection Information carries out fault-tolerant verifying, comprising: obtains header information and trailer information that information is established in the second connection;If the head obtained Information is specified header information and the trailer information that obtains is specified trailer information, it is determined that it is logical that Information Authentication is established in the second connection It crosses, otherwise, it determines the second connection is established Information Authentication and do not passed through.
Further, when second terminal determines that the second connection is established Information Authentication and passed through, determine that the first audio-frequency information exists It does not malfunction in transmission process, determines that the first audio-frequency information is accurate, second terminal can remove the second connection in current period and establish The header information and trailer information of information obtain the first connection and establish information, so that sending connection to first terminal establishes request. When to determine that Information Authentication is established in the second connection obstructed out-of-date for second terminal, determine that the first audio-frequency information malfunctions in transmission process, It determines the first audio-frequency information inaccuracy, the can be received again when first terminal next cycle broadcasts the first audio-frequency information One audio-frequency information sends connection to first terminal and establishes request according still further to the above method.
Further, establishing information when the first connection is first terminal according to the address of designated character string, first terminal letter The port information of breath and first set of words object, when generating according to specified format, second terminal is based on the first connection and establishes information, Connection is sent to first terminal and establishes request, comprising: according to specified format, information is established to the first connection and is parsed, is obtained The address information of first terminal and the port information of first set of words object;Address information and the first socket based on first terminal The port information of object word sends connection to first terminal and establishes request.
For example, it is first terminal according to designated character string, the address information of first terminal and that information is established in the first connection The port information of one socket object word, generates according to specified format, then second terminal establishes the first connection according to specified format Information jiexie#211.144.172.14#2 is parsed, and the address information for obtaining first terminal is 211.144.172.14, the The port information of one socket object word is 2;The port information of address information and first set of words object based on first terminal, to First terminal sends connection and establishes request.
Wherein, it can store the corresponding relationship between character and frequency in second terminal, therefore, when second terminal is to When one audio-frequency information is parsed, the frequency that can include based on the first audio-frequency information is corresponding between the character and frequency In relationship, corresponding character is obtained, to obtain that information is established in the first connection or information is established in the second connection, realizes the first sound The parsing of frequency information.
It should be noted that second terminal is established in request to the connection that first terminal is sent can carry second terminal wound Second built is socketed the port information of object word, address information of second terminal etc., and the embodiment of the present invention is not done this specifically It limits.
Step 304: when first terminal, which receives second terminal, establishes request based on the connection that the first audio-frequency information is sent, Establish the connection between first set of words object and the second socket object word of second terminal creation.
In embodiments of the present invention, first terminal establishes the second socket of first set of words object and second terminal creation The method connected between object can refer to existing method, and the embodiment of the present invention no longer repeats this.
Step 305: first terminal is by the connection between first set of words object and the second socket object word, eventually with second End carries out file transmission.
First terminal carries out text with second terminal by the connection between first set of words object and the second socket object word Part transmission without saving the data traffic of user by operator, and then avoids generating extra-pay for user.
It should be noted that in embodiments of the present invention, the time that first terminal creates first set of words object can be It establishes after the wireless network connection between second terminal, and information is being established based on the first connection, generate assigned frequency Before first audio-frequency information, the time of second terminal creation the second socket object word can be based on the first audio-frequency information, to the One terminal sends connection and establishes before request, and the embodiment of the present invention is not specifically limited in this embodiment.In addition, when first terminal creation the After one socket object word, first terminal can know the port information of first set of words.When the second socket of second terminal creation After object word, second terminal can know the port information of the second socket.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.In addition, first terminal to First connection establishes information and adds specified header information and specified trailer information, obtains the second connection and establishes information, and second is connected It connects and establishes the first audio-frequency information that information is converted to assigned frequency.When second terminal receives the first audio-frequency information, to first Audio-frequency information is parsed, and is obtained the second connection and is established information, and establishes header information and the tail portion of information according to the second connection Information, judges whether the first audio-frequency information malfunctions during transmission, and then improves the reliability of file transmission.
Fig. 4 is a kind of file transfer means structural schematic diagram provided in an embodiment of the present invention.Referring to fig. 4, which includes:
First generation module 401, for being connected based on first when first terminal and second terminal be in same local area network Establish information, generate the first audio-frequency information of assigned frequency, the first connection establish the address information that information includes first terminal and The port information of the first set of words object of first terminal creation;
Broadcast module 402, for broadcasting the first audio-frequency information by the local area network;
First establishes module 403, is asked for that ought receive second terminal based on the connection foundation that the first audio-frequency information is sent When asking, the connection between first set of words object and the second socket object word of second terminal creation is established;
Transmission module 404, for being socketed the connection between object word by first set of words object and second, eventually with second End carries out file transmission.
Optionally, referring to Fig. 5, the first generation module 401 includes:
Adding unit 4011 is added specified header information and specified trailer information for establishing information to the first connection, is obtained Information is established to the second connection;
Converting unit 4012, for the first audio-frequency information that information is converted to assigned frequency to be established in the second connection.
Optionally, referring to Fig. 6, the device further include:
Second generation module 405, for the address information and first set of words object according to designated character string, first terminal Port information generate the first connection and establish information according to specified format.
Optionally, referring to Fig. 7, the device further include:
Second establishes module 405, for the wireless network connection between foundation and second terminal, makes first terminal and second Terminal is in same local area network;Alternatively,
Third establishes module 406, for establishing the wireless network between specified access point based on specified access-in point information Connection, specifying access point is currently attached or the to be connected access point of second terminal, is made at first terminal and second terminal In same local area network.
Optionally, referring to Fig. 8, second, which establishes module 405, includes:
Setting unit 4051, for setting wireless access dot pattern for first terminal;
Generation unit 4052 generates the second audio of assigned frequency for the first access-in point information based on first terminal Information, the first access-in point information include at least access point identity;
Radio unit 4053, for broadcasting the second audio-frequency information under wireless access dot pattern;
Unit 4054 is established, is asked for the wireless network connection that second terminal is sent based on the second audio-frequency information ought to be received When asking, the wireless network connection between second terminal is established.
Optionally, generation unit 4052 includes:
Subelement is added, for adding specified header information and specified tail portion letter to the first access-in point information of first terminal Breath, obtains the second access-in point information;
Conversion subunit, for the second access-in point information to be converted to the second audio-frequency information of assigned frequency.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Fig. 9 is a kind of file transfer means structural schematic diagram provided in an embodiment of the present invention.Referring to Fig. 9, which includes:
Receiving module 901, for when first terminal and second terminal be in same local area network, reception first terminal to pass through First audio-frequency information of the assigned frequency of LAN broadcast, the first audio-frequency information are based on the first connection for first terminal and establish information It generates, the end 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 Message breath;
Sending module 902, for be based on the first audio-frequency information, to first terminal send connection establish request, make first eventually The connection between first set of words object and the second socket object word of second terminal creation is established at end;
Transmission module 903, for being socketed the connection between object word by first set of words object and second, eventually with first End carries out file transmission.
Optionally, referring to Figure 10, sending module 902 includes:
Resolution unit 9021 obtains the second connection and establishes information for parsing to the first audio-frequency information;
Authentication unit 9022 is connected for being established the header information and trailer information of information based on the second connection to second It establishes information and carries out fault-tolerant verifying;
Removal unit 9023, for if the verification passes, then removing header information and tail portion that information is established in the second connection Information obtains the first connection and establishes information;
First transmission unit 9024 sends connection to first terminal and establishes request for establishing information based on the first connection.
Optionally, authentication unit 9022 includes:
Subelement is obtained, the header information and trailer information of information are established for obtaining the second connection;
Subelement is determined, if the header information for acquisition is specified header information and the trailer information that obtains is specified Trailer information, it is determined that the second connection is established Information Authentication and passed through, otherwise, it determines the second connection is established Information Authentication and do not passed through.
Optionally, the first transmission unit 9024 includes:
First parsing subunit obtains first eventually for establishing information to the first connection and parsing according to specified format The address information at end and the port information of first set of words object;
First transmission sub-unit, for the port information of address information and first set of words object based on first terminal, Connection, which is sent, to first terminal establishes request.
Optionally, referring to Figure 11, the device further include:
First establishes module 904, the wireless network connection for establishing between the first terminal, makes first end End and the second terminal are in same local area network;Alternatively,
Second establishes module 905, for establishing the wireless network between specified access point based on specified access-in point information Connection, the specified access point are currently attached or the to be connected access point of the first terminal, make the first terminal Same local area network is in the second terminal.
Optionally, referring to Figure 12, first, which establishes module 904, includes:
Receiving unit 9041, for receiving the second sound of the assigned frequency that first terminal is broadcasted under wireless access dot pattern Frequency information, the second audio-frequency information are that first terminal is generated based on the first access-in point information of first terminal, the first access-in point information Including at least access point identity;
Second transmission unit 9042 sends wireless network connection request to first terminal for being based on the second audio-frequency information, First terminal is set to establish the wireless network connection between second terminal, first terminal and second terminal are in same local area network.
Optionally, the second transmission unit 9042 includes:
Second parsing subunit obtains the second access-in point information for parsing to the second audio-frequency information;
Subelement is verified, for header information and trailer information based on the second access-in point information, the second access point is believed Breath carries out fault-tolerant verifying;
Subelement is removed, for if the verification passes, then removing the header information and trailer information of the second access-in point information, Obtain the first access-in point information of first terminal;
Second transmission sub-unit sends wireless network connection request to first terminal for being based on the first access-in point information.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
It should be understood that file transfer means provided by the above embodiment file transmit when, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, file transfer means provided by the above embodiment and document transmission method embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Figure 13 is a kind of structural schematic diagram of first terminal provided in an embodiment of the present invention.Referring to Figure 13, first terminal 1300 may include communication unit 1310, the memory 1320 for including one or more computer readable storage medium, Input unit 1330, display unit 1340, sensor 1350, voicefrequency circuit 1360, WIFI (Wireless Fidelity, wirelessly Fidelity) module 1370, the processor 1380 and the components such as power supply 1390 that include one or more than one processing core. It, can be with it will be understood by those skilled in the art that first terminal structure shown in Figure 13 does not constitute the restriction to first terminal Including perhaps combining certain components or different component layouts than illustrating more or fewer components.Wherein:
Communication unit 1310 can be used for receiving and sending messages or communication process in, signal sends and receivees, the communication unit 1310 can for RF (Radio Frequency, radio frequency) circuit, router, modem, etc. network communication equipments.Especially After receiving the downlink information of base station, one or more than one processor are transferred to when communication unit 1310 is RF circuit in ground 1380 processing;In addition, the data for being related to uplink are sent to base station.RF circuit usually as communication unit includes but unlimited In antenna, at least one amplifier, tuner, one or more oscillators, subscriber identity module (SIM) card, transceiver, coupling Clutch, LNA (Low Noise Amplifier, low-noise amplifier), duplexer etc..In addition, communication unit 1310 can also lead to Wireless communication is crossed to communicate with network and other equipment.Any communication standard or agreement can be used in described wirelessly communicate, including but It is not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message Service) etc..Memory 1320 can be used for storing software program and module, and processor 1380 is stored in memory by operation 1320 software program and module, thereby executing various function application and data processing.Memory 1320 can mainly include Storing program area and storage data area, wherein storing program area can application journey needed for storage program area, at least one function Sequence (such as sound-playing function, image player function etc.) etc.;Storage data area can store the use according to first terminal 1300 Data (such as audio data, phone directory etc.) created etc..In addition, memory 1320 may include high random access storage Device, can also include nonvolatile memory, and a for example, at least disk memory, flush memory device or other volatibility are solid State memory device.Correspondingly, memory 1320 can also include Memory Controller, to provide processor 1380 and input unit The access of 1330 pairs of memories 1320.
Input unit 1330 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Preferably, input unit 1330 may include touching Sensitive surfaces 1331 and other input equipments 1332.Touch sensitive surface 1331, also referred to as touch display screen or Trackpad collect User on it or nearby touch operation (such as user using any suitable object or attachment such as finger, stylus touch-sensitive Operation on surface 1331 or near touch sensitive surface 1331), and corresponding attachment device is driven according to preset formula. Optionally, touch sensitive surface 1331 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives processor 1380, and can reception processing Order that device 1380 is sent simultaneously is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch sensitive surface 1331.In addition to touch sensitive surface 1331, input unit 1330 can also include other input equipments 1332.Preferably, other input equipments 1332 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, one of operating stick etc. or a variety of.
Display unit 1340 can be used for showing information input by user or the information and first terminal that are supplied to user 1300 various graphical user interface, these graphical user interface can be by figure, text, icon, video and any combination thereof To constitute.Display unit 1340 may include display panel 1341, optionally, can use LCD (Liquid Crystal Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come Configure display panel 1341.Further, touch sensitive surface 1331 can cover display panel 1341, when touch sensitive surface 1331 detects After touch operation on it or nearby, processor 1380 is sent to determine the type of touch event, is followed by subsequent processing device 1380 Corresponding visual output is provided on display panel 1341 according to the type of touch event.Although in Figure 13, touch sensitive surface 1331 be to realize input and input function as two independent components with display panel 1341, but in some embodiments In, touch sensitive surface 1331 and display panel 1341 can be integrated and realize and output and input function.
First terminal 1300 may also include at least one sensor 1350, for example, optical sensor, motion sensor and its His sensor.Optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment light The light and shade of line adjusts the brightness of display panel 1341, and proximity sensor can close when first terminal 1300 is moved in one's ear Display panel 1341 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions The size of (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static It (for example pedometer, is struck using (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function Hit) etc.;Gyroscope, barometer, hygrometer, thermometer, infrared sensor for can also configure as first terminal 1300 etc. its His sensor, details are not described herein.
Voicefrequency circuit 1360, loudspeaker 1361, microphone 1362 can provide the audio between user and first terminal 1300 Interface.Electric signal after the audio data received conversion can be transferred to loudspeaker 1361, by loudspeaker by voicefrequency circuit 1360 1361 are converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 1362, by audio Circuit 1360 is converted to audio data after receiving, then by after the processing of audio data output processor 1380, through communication unit 1310 To be sent to such as another terminal, or audio data exported to memory 1320 to be further processed.Voicefrequency circuit 1360 are also possible that earphone jack, to provide the communication of peripheral hardware earphone Yu first terminal 1300.
In order to realize wireless communication, wireless communication unit 1370, the wireless communication unit can be configured on first terminal 1370 can be WIFI module.WIFI belongs to short range wireless transmission technology, the unit by wireless communication of first terminal 1300 1370 user can be helped to send and receive e-mail, browse webpage and access streaming video etc., it provides wireless width for user Band internet access.Although showing wireless communication unit 1370 in figure, but it is understood that, and it is not belonging to first eventually Must be configured into for end 1300, can according to need within the scope of not changing the essence of the invention completely and omits.
Processor 1380 is the control centre of first terminal 1300, utilizes each of various interfaces and connection whole mobile phone A part by running or execute the software program and/or module that are stored in memory 1320, and calls and is stored in storage Data in device 1320 execute the various functions and processing data of first terminal 1300, to carry out integral monitoring to mobile phone.It can Choosing, processor 1380 may include one or more processing cores;Preferably, processor 1380 can integrate application processor and tune Demodulation processor processed, wherein the main processing operation system of application processor, user interface and application program etc., modulatedemodulate is mediated Reason device mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1380 In.
First terminal 1300 further includes the power supply 1390 (such as battery) powered to all parts, it is preferred that power supply can be with It is logically contiguous by power-supply management system and processor 1380, thus by power-supply management system realize management charging, electric discharge, with And the functions such as power managed.Power supply 1360 can also include one or more direct current or AC power source, recharging system, The random components such as power failure detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, first terminal 1300 can also include camera, bluetooth module etc., and details are not described herein.
In the present embodiment, first terminal further include have one perhaps more than one program this or one with Upper program is stored in memory, and be configured to by one perhaps more than one processor execute it is one or one Procedure above includes the instruction for carrying out following document transmission method.
When first terminal and second terminal are in same local area network, information is established based on the first connection, generates specified frequency The first set of the address information that information includes first terminal and first terminal creation is established in first audio-frequency information of rate, the first connection Connect the port information of object word.
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, first set of words pair is established The connection between the second socket object word created as second terminal.
By the connection between first set of words object and the second socket object word, file transmission is carried out with second terminal.
Optionally, information is established based on the first connection, generates the first audio-frequency information of assigned frequency, comprising:
Information is established to the first connection and adds specified header information and specified trailer information, is obtained the second connection and is established letter Breath;
The first audio-frequency information that information is converted to assigned frequency is established into second connection.
Optionally, information is established based on the first connection, before the first audio-frequency information for generating assigned frequency, further includes:
According to designated character string, the port information of the address information of first terminal and first set of words object, according to specified Format generates the first connection and establishes information.
Optionally, when first terminal and second terminal are in same local area network, information is established based on the first connection, is generated Before first audio-frequency information of assigned frequency, further includes:
The wireless network connection between second terminal is established, first terminal and second terminal is made to be in same local area network; Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, specifying access point is the Currently attached or the to be connected access point of two terminals makes first terminal and second terminal be in same local area network.
Optionally, the wireless network connection between second terminal is established, comprising:
Wireless access dot pattern is set by first terminal;
The first access-in point information based on first terminal generates the second audio-frequency information of assigned frequency, the first access point letter Breath includes at least access point identity;
Under wireless access dot pattern, the second audio-frequency information is broadcasted;
When receiving the wireless network connection request that second terminal is sent based on the second audio-frequency information, establish with second eventually Wireless network connection between end.
Optionally, the first access-in point information based on first terminal generates the second audio-frequency information of assigned frequency, comprising:
Specified header information and specified trailer information are added to the first access-in point information of first terminal, obtains the second access Point information;
Second access-in point information is converted to the second audio-frequency information of assigned frequency.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Figure 14 is a kind of structural schematic diagram of second terminal provided in an embodiment of the present invention.Second terminal 1400 may include Communication unit 1410, the memory 1420 for including one or more computer readable storage medium, input unit 1430, Display unit 1440, sensor 1450, voicefrequency circuit 1460, WIFI (Wireless Fidelity, Wireless Fidelity) module 1470, the components such as processor 1480 and the power supply 1490 of processing core are included one or more than one.Art technology Personnel are appreciated that second terminal structure shown in Figure 14 does not constitute the restriction to second terminal, may include than diagram More or fewer components perhaps combine certain components or different component layouts.Wherein:
Communication unit 1410 can be used for receiving and sending messages or communication process in, signal sends and receivees, the communication unit 1410 can for RF (Radio Frequency, radio frequency) circuit, router, modem, etc. network communication equipments.Especially After receiving the downlink information of base station, one or more than one processor are transferred to when communication unit 1410 is RF circuit in ground 1480 processing;In addition, the data for being related to uplink are sent to base station.RF circuit usually as communication unit includes but unlimited In antenna, at least one amplifier, tuner, one or more oscillators, subscriber identity module (SIM) card, transceiver, coupling Clutch, LNA (Low Noise Amplifier, low-noise amplifier), duplexer etc..In addition, communication unit 1410 can also lead to Wireless communication is crossed to communicate with network and other equipment.Any communication standard or agreement can be used in described wirelessly communicate, including but It is not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message Service) etc..Memory 1420 can be used for storing software program and module, and processor 1480 is stored in memory by operation 1420 software program and module, thereby executing various function application and data processing.Memory 1420 can mainly include Storing program area and storage data area, wherein storing program area can application journey needed for storage program area, at least one function Sequence (such as sound-playing function, image player function etc.) etc.;Storage data area can store the use according to second terminal 1400 Data (such as audio data, phone directory etc.) created etc..In addition, memory 1420 may include high random access storage Device, can also include nonvolatile memory, and a for example, at least disk memory, flush memory device or other volatibility are solid State memory device.Correspondingly, memory 1420 can also include Memory Controller, to provide processor 1480 and input unit The access of 1430 pairs of memories 1420.
Input unit 1430 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Preferably, input unit 1430 may include touching Sensitive surfaces 1431 and other input equipments 1432.Touch sensitive surface 1431, also referred to as touch display screen or Trackpad collect User on it or nearby touch operation (such as user using any suitable object or attachment such as finger, stylus touch-sensitive Operation on surface 1431 or near touch sensitive surface 1431), and corresponding attachment device is driven according to preset formula. Optionally, touch sensitive surface 1431 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives processor 1480, and can reception processing Order that device 1480 is sent simultaneously is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch sensitive surface 1431.In addition to touch sensitive surface 1431, input unit 1430 can also include other input equipments 1432.Preferably, other input equipments 1432 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, one of operating stick etc. or a variety of.
Display unit 1440 can be used for showing information input by user or the information and second terminal that are supplied to user 1400 various graphical user interface, these graphical user interface can be by figure, text, icon, video and any combination thereof To constitute.Display unit 1440 may include display panel 1441, optionally, can use LCD (Liquid Crystal Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come Configure display panel 1441.Further, touch sensitive surface 1431 can cover display panel 1441, when touch sensitive surface 1431 detects After touch operation on it or nearby, processor 1480 is sent to determine the type of touch event, is followed by subsequent processing device 1480 Corresponding visual output is provided on display panel 1441 according to the type of touch event.Although in Figure 14, touch sensitive surface 1431 be to realize input and input function as two independent components with display panel 1441, but in some embodiments In, touch sensitive surface 1431 and display panel 1441 can be integrated and realize and output and input function.
Second terminal 1400 may also include at least one sensor 1450, for example, optical sensor, motion sensor and its His sensor.Optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment light The light and shade of line adjusts the brightness of display panel 1441, and proximity sensor can close when second terminal 1400 is moved in one's ear Display panel 1441 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions The size of (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static It (for example pedometer, is struck using (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function Hit) etc.;Gyroscope, barometer, hygrometer, thermometer, infrared sensor for can also configure as second terminal 1400 etc. its His sensor, details are not described herein.
Voicefrequency circuit 1460, loudspeaker 1461, microphone 1462 can provide the audio between user and second terminal 1400 Interface.Electric signal after the audio data received conversion can be transferred to loudspeaker 1461, by loudspeaker by voicefrequency circuit 1460 1461 are converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 1462, by audio Circuit 1460 is converted to audio data after receiving, then by after the processing of audio data output processor 1480, through communication unit 1410 To be sent to such as another terminal, or audio data exported to memory 1420 to be further processed.Voicefrequency circuit 1460 are also possible that earphone jack, to provide the communication of peripheral hardware earphone Yu second terminal 1400.
In order to realize wireless communication, wireless communication unit 1470, the wireless communication list can be configured in the second terminal Member 1470 can be WIFI module.WIFI belongs to short range wireless transmission technology, the unit by wireless communication of second terminal 1400 1470 user can be helped to send and receive e-mail, browse webpage and access streaming video etc., it provides wireless width for user Band internet access.Although showing wireless communication unit 1470 in figure, but it is understood that, and it is not belonging to second eventually Must be configured into for end 1400, can according to need within the scope of not changing the essence of the invention completely and omits.
Processor 1480 is the control centre of second terminal 1400, utilizes each of various interfaces and connection whole mobile phone A part by running or execute the software program and/or module that are stored in memory 1420, and calls and is stored in storage Data in device 1420 execute the various functions and processing data of second terminal 1400, to carry out integral monitoring to mobile phone.It can Choosing, processor 1480 may include one or more processing cores;Preferably, processor 1480 can integrate application processor and tune Demodulation processor processed, wherein the main processing operation system of application processor, user interface and application program etc., modulatedemodulate is mediated Reason device mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1480 In.
Second terminal 1400 further includes the power supply 1490 (such as battery) powered to all parts, it is preferred that power supply can be with It is logically contiguous by power-supply management system and processor 1480, thus by power-supply management system realize management charging, electric discharge, with And the functions such as power managed.Power supply 1460 can also include one or more direct current or AC power source, recharging system, The random components such as power failure detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, second terminal 1400 can also include camera, bluetooth module etc., and details are not described herein.
In the present embodiment, second terminal further include have one perhaps more than one program this or one with Upper program is stored in memory, and be configured to by one perhaps more than one processor execute it is one or one Procedure above includes the instruction for carrying out following document transmission method.
When first terminal and second terminal are in same local area network, the finger that first terminal passes through the LAN broadcast is received Determine the first audio-frequency information of frequency, the first audio-frequency information is based on the first connection for first terminal and establishes information generation, the first connection Establish the port information of the first set of words object of address information and first terminal creation that information includes first terminal.
Based on the first audio-frequency information, connection is sent to first terminal and establishes request, first terminal is made to establish first set of words Connection between object and the second socket object word of second terminal creation.
By the connection between first set of words object and the second socket object word, file transmission is carried out with first terminal.
Optionally, it is based on the first audio-frequency information, connection is sent to first terminal and establishes request, comprising:
First audio-frequency information is parsed, the second connection is obtained and establishes information;
The header information and trailer information that information is established based on the second connection are established information to the second connection and carry out fault-tolerant test Card;
If the verification passes, then removal second connects the header information and trailer information for establishing information, obtains the first connection Establish information;
Information is established based on the first connection, connection is sent to first terminal and establishes request.
Optionally, the header information and trailer information of information are established based on the second connection, to the second connection establish information into The fault-tolerant verifying of row, comprising:
Obtain header information and trailer information that information is established in the second connection;
If the header information obtained is specified header information and the trailer information that obtains is specified trailer information, it is determined that Second connection is established Information Authentication and is passed through, otherwise, it determines the second connection is established Information Authentication and do not passed through.
Optionally, information is established based on the first connection, sends connection to first terminal and establishes request, comprising:
According to specified format, information is established to the first connection and is parsed, the address information and first of first terminal is obtained It is socketed the port information of object word;
The port information of address information and first set of words object based on first terminal sends connection to first terminal and builds Vertical request.
Optionally, when first terminal and second terminal are in same local area network, it is wide by local area network to receive first terminal Before first audio-frequency information of the assigned frequency broadcast, further includes:
The wireless network connection between first terminal is established, first terminal and second terminal is made to be in same local area network; Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, specifying access point is the Currently attached or the to be connected access point of one terminal makes first terminal and second terminal be in same local area network.
Optionally, the wireless network connection between first terminal is established, comprising:
Receive the second audio-frequency information of the assigned frequency that first terminal is broadcasted under wireless access dot pattern, the second audio letter Breath is that first terminal is generated based on the first access-in point information of first terminal, and the first access-in point information includes at least access point mark Know;
Based on the second audio-frequency information, wireless network connection request is sent to first terminal, establishes first terminal and second Wireless network connection between terminal, first terminal and second terminal are in same local area network.
Optionally, it is based on the second audio-frequency information, sends wireless network connection request to first terminal, comprising:
Second audio-frequency information is parsed, the second access-in point information is obtained;
Header information and trailer information based on the second access-in point information carry out fault-tolerant verifying to the second access-in point information;
If the verification passes, then the header information and trailer information for removing the second access-in point information, obtain first terminal First access-in point information;
Based on the first access-in point information, wireless network connection request is sent to first terminal.
In embodiments of the present invention, when first terminal and second terminal are in same local area network, first terminal is based on the Information is established in one connection, generates the first audio-frequency information of assigned frequency, and by the local area network, is broadcasted the first audio-frequency information, made Second terminal receives first audio-frequency information.And by local area network, the time for broadcasting the first audio-frequency information is shorter, fast speed, Make second terminal that can also rapidly receive the first audio-frequency information, so as to rapidly establish the first socket of first terminal Connection between object word and the second socket object word of second terminal, improves file transmission efficiency.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (22)

1. a kind of document transmission method, which is characterized in that be applied to first terminal, which comprises
When the first terminal and second terminal are in same local area network, according to designated character string, the ground of the first terminal The port information of location information and the first set of words object of first terminal creation generates the first connection according to specified format Establish information, wherein the designated character string is set in advance between the first terminal and the second terminal, and described Second terminal can recognize first connection according to the designated character string and establish information, and information is established in first connection The port information of address information and the first set of words object including the first terminal;
Information is established to first connection and adds specified header information and specified trailer information, is obtained the second connection and is established letter Second connection is established the first audio-frequency information that information is converted to assigned frequency by breath, the specified header information and described Specified trailer information is that the first terminal and the second terminal are set in advance;
By the local area network, it is broadcast periodically first audio-frequency information, by the second terminal to first audio Information is parsed, and is obtained second connection and is established information, the header information and tail of information are established based on second connection Portion's information establishes information to second connection and carries out fault-tolerant verifying, if verifying does not pass through, one under the first terminal When the first audio-frequency information described in a periodic broadcasting, first audio-frequency information is received again, and be based on first audio-frequency information, Connection, which is sent, to the first terminal establishes request;
When receiving the connection foundation request that the second terminal is sent based on first audio-frequency information, described first is established The connection being socketed between object word and the second socket object word of second terminal creation;
By the connection between the first set of words object and the second socket object word, text is carried out with the second terminal Part transmission.
2. the method as described in claim 1, which is characterized in that described when the first terminal and second terminal are in same office When domain is netted, according to the first set of words pair of designated character string, the address information of the first terminal and the first terminal creation The port information of elephant generates the first connection and establishes before information according to specified format, further includes:
The wireless network connection between the second terminal is established, the first terminal and the second terminal is made to be in same Local area network;Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, the specified access point is institute Currently attached or the to be connected access point of second terminal is stated, the first terminal and the second terminal is made to be in same office Domain net.
3. method according to claim 2, which is characterized in that the wireless network between the foundation and the second terminal connects It connects, comprising:
Wireless access dot pattern is set by the first terminal;
The first access-in point information based on the first terminal generates the second audio-frequency information of assigned frequency, first access Point information includes at least access point identity;
Under the wireless access dot pattern, second audio-frequency information is broadcasted;
When receiving the wireless network connection request that the second terminal is sent based on second audio-frequency information, foundation and institute State the wireless network connection between second terminal.
4. method as claimed in claim 3, which is characterized in that first access-in point information based on the first terminal, Generate the second audio-frequency information of assigned frequency, comprising:
Specified header information and specified trailer information are added to the first access-in point information of the first terminal, obtains the second access Point information;
Second access-in point information is converted to the second audio-frequency information of assigned frequency.
5. a kind of document transmission method, which is characterized in that be applied to second terminal, which comprises
When first terminal and the second terminal are in same local area network, receive the first terminal and pass through the local net week First audio-frequency information of the assigned frequency broadcasted to phase property, first audio-frequency information are that the first terminal builds the second connection Vertical information is converted to, and second connection establishes information and establishes the specified head of information addition to the first connection for the first terminal Portion's information and specified trailer information obtain, and it is the first terminal according to designated character string, institute that information is established in first connection The port information for stating the address information of first terminal and the first set of words object of first terminal creation, according to specified format It generates, wherein the specified header information and the specified trailer information are that the first terminal and the second terminal are prior It is arranged, the designated character string is set in advance between the first terminal and the second terminal, and described second is whole End can recognize first connection according to the designated character string and establish information, and it includes institute that information is established in first connection State the address information of first terminal and the port information of the first set of words object;
Based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request, and the first terminal is made to establish institute State the connection between first set of words object and the second socket object word of second terminal creation;
By the connection between the first set of words object and the second socket object word, text is carried out with the first terminal Part transmission;
Wherein, described to be based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request, comprising:
First audio-frequency information is parsed, second connection is obtained and establishes information;
The header information and trailer information that information is established based on second connection are established information to second connection and held Mistake verifying;
If verifying does not pass through, when the first terminal next cycle broadcasts first audio-frequency information, receive again First audio-frequency information, and it is based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request.
6. method as claimed in claim 5, which is characterized in that described to be based on first audio-frequency information, Xiang Suoshu first is eventually End sends connection and establishes request, comprising:
If the verification passes, then header information and trailer information that information is established in second connection are removed, obtains described first Information is established in connection;
Information is established based on first connection, Xiang Suoshu first terminal sends connection and establishes request.
7. method as claimed in claim 5, which is characterized in that the header information for establishing information based on second connection And trailer information, information is established to second connection and carries out fault-tolerant verifying, comprising:
Obtain header information and trailer information that information is established in second connection;
If the header information obtained is specified header information and the trailer information that obtains is specified trailer information, it is determined that described Second connection is established Information Authentication and is passed through, otherwise, it determines second connection is established Information Authentication and do not passed through.
8. method as claimed in claim 6, which is characterized in that described to establish information based on first connection, Xiang Suoshu the One terminal sends connection and establishes request, comprising:
According to specified format, information is established to first connection and is parsed, obtain the first terminal address information and The port information of the first set of words object;
The port information of address information and the first set of words object based on the first terminal, Xiang Suoshu first terminal hair Connection is sent to establish request.
9. method as claimed in claim 5, which is characterized in that described when first terminal and the second terminal are in same office When domain is netted, receive the assigned frequency that the first terminal is broadcast periodically by the local area network the first audio-frequency information it Before, further includes:
The wireless network connection between the first terminal is established, the first terminal and the second terminal is made to be in same Local area network;Alternatively,
Based on specified access-in point information, the wireless network connection between specified access point is established, the specified access point is institute Currently attached or the to be connected access point of first terminal is stated, the first terminal and the second terminal is made to be in same office Domain net.
10. method as claimed in claim 9, which is characterized in that the wireless network between the foundation and the first terminal Connection, comprising:
Receive the second audio-frequency information of the assigned frequency that the first terminal is broadcasted under wireless access dot pattern, second sound Frequency information is that the first terminal is generated based on the first access-in point information of the first terminal, and first access-in point information is extremely It less include access point identity;
Based on second audio-frequency information, Xiang Suoshu first terminal sends wireless network connection request, builds the first terminal Wireless network connection between the vertical and described second terminal.
11. method as claimed in claim 10, which is characterized in that described to be based on second audio-frequency information, Xiang Suoshu first Terminal sends wireless network connection request, comprising:
Second audio-frequency information is parsed, the second access-in point information is obtained;
Based on the header information and trailer information of second access-in point information, fault-tolerant test is carried out to second access-in point information Card;
If the verification passes, then the header information and trailer information for removing second access-in point information obtain described first eventually First access-in point information at end;
Based on first access-in point information, Xiang Suoshu first terminal sends wireless network connection request.
12. a kind of file transfer means, which is characterized in that be applied to first terminal, described device includes:
First generation module, for when the first terminal and second terminal are in same local area network, according to designated character string, The port information of the address information of the first terminal and the first set of words object of first terminal creation, according to specified lattice Formula generates the first connection and establishes information, establishes information based on first connection, generates the first audio-frequency information of assigned frequency, Wherein, the designated character string is set in advance between the first terminal and the second terminal, and the second terminal First connection can be recognized according to the designated character string and establishes information, and it includes described that information is established in first connection The port information of the address information of first terminal and the first set of words object;
Broadcast module, for first audio-frequency information being broadcast periodically, by the second terminal pair by the local area network First audio-frequency information is parsed, and is obtained the second connection and is established information, and the head of information is established based on second connection Information and trailer information establish information to second connection and carry out fault-tolerant verifying, if verifying does not pass through, described first When terminal next cycle broadcasts first audio-frequency information, first audio-frequency information is received again, and be based on described first Audio-frequency information, Xiang Suoshu first terminal send connection and establish request;
First establishes module, is asked for that ought receive the second terminal based on the connection foundation that first audio-frequency information is sent When asking, the connection between the first set of words object and the second socket object word of second terminal creation is established;
Transmission module, it is and described for by the connection between the first set of words object and the second socket object word Second terminal carries out file transmission;
Wherein, first generation module includes:
Adding unit adds specified header information and specified trailer information for establishing information to first connection, obtains institute It states the second connection and establishes information, the specified header information and the specified trailer information are the first terminal and described second Terminal is set in advance;
Converting unit, for the first audio-frequency information that information is converted to assigned frequency to be established in second connection.
13. device as claimed in claim 12, which is characterized in that described device further include:
Second establishes module, and the wireless network connection for establishing between the second terminal makes the first terminal and institute It states second terminal and is in same local area network;Alternatively,
Third establishes module, for establishing the wireless network connection between specified access point, institute based on specified access-in point information Stating specified access point is currently attached or the to be connected access point of the second terminal, makes the first terminal and described the Two terminals are in same local area network.
14. device as claimed in claim 13, which is characterized in that described second, which establishes module, includes:
Setting unit, for setting wireless access dot pattern for the first terminal;
Generation unit generates the second audio-frequency information of assigned frequency for the first access-in point information based on the first terminal, First access-in point information includes at least access point identity;
Radio unit, for broadcasting second audio-frequency information under the wireless access dot pattern;
Unit is established, is asked for the wireless network connection that the second terminal is sent based on second audio-frequency information ought to be received When asking, the wireless network connection between the second terminal is established.
15. device as claimed in claim 14, which is characterized in that the generation unit includes:
Subelement is added, for adding specified header information and specified tail portion letter to the first access-in point information of the first terminal Breath, obtains the second access-in point information;
Conversion subunit, for second access-in point information to be converted to the second audio-frequency information of assigned frequency.
16. a kind of file transfer means, which is characterized in that be applied to second terminal, described device includes:
Receiving module leads to for when first terminal and the second terminal be in same local area network, receiving the first terminal The first audio-frequency information of the assigned frequency that the local area network is broadcast periodically is crossed, first audio-frequency information is described first whole End is established information to the second connection and is converted to, and it is that the first terminal is established to the first connection that information is established in second connection Information adds specified header information and specified trailer information obtains, first connection establish information be the first terminal according to The port letter of the first set of words object of designated character string, the address information of the first terminal and first terminal creation Breath, generates according to specified format, wherein the specified header information and the specified trailer information are the first terminal and institute It is set in advance to state second terminal, the designated character string is arranged in advance between the first terminal and the second terminal , and the second terminal can recognize first connection according to the designated character string and establish information, described first connects Connect the port information for establishing address information and the first set of words object that information includes the first terminal;
Sending module, for being based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request, makes described the One terminal establishes the connection between the first set of words object and the second socket object word of second terminal creation;
Transmission module, it is and described for by the connection between the first set of words object and the second socket object word First terminal carries out file transmission;
Wherein, the sending module includes:
Resolution unit obtains second connection and establishes information for parsing to first audio-frequency information;
Authentication unit, for establishing the header information and trailer information of information based on second connection, to second connection It establishes information and carries out fault-tolerant verifying;
Wherein, the sending module is also used to:
If verifying does not pass through, when the first terminal next cycle broadcasts first audio-frequency information, receive again First audio-frequency information, and it is based on first audio-frequency information, Xiang Suoshu first terminal sends connection and establishes request.
17. device as claimed in claim 16, which is characterized in that the sending module includes:
Removal unit establishes the header information and trailer information of information for if the verification passes, then removing second connection, It obtains first connection and establishes information;
First transmission unit, for establishing information based on first connection, Xiang Suoshu first terminal sends connection and establishes request.
18. device as claimed in claim 17, which is characterized in that the authentication unit includes:
Subelement is obtained, the header information and trailer information of information are established for obtaining second connection;
Subelement is determined, if the header information for acquisition is specified header information and the trailer information that obtains is specified tail portion Information, it is determined that second connection is established Information Authentication and passed through, otherwise, it determines to establish Information Authentication obstructed for second connection It crosses.
19. device as claimed in claim 17, which is characterized in that first transmission unit includes:
First parsing subunit obtains described for establishing information to first connection and parse according to specified format The port information of the address information of one terminal and the first set of words object;
First transmission sub-unit, the port for address information and the first set of words object based on the first terminal are believed Breath, Xiang Suoshu first terminal send connection and establish request.
20. device as claimed in claim 16, which is characterized in that described device further include:
First establishes module, and the wireless network connection for establishing between the first terminal makes the first terminal and institute It states second terminal and is in same local area network;Alternatively,
Second establishes module, for establishing the wireless network connection between specified access point, institute based on specified access-in point information Stating specified access point is currently attached or the to be connected access point of the first terminal, makes the first terminal and described the Two terminals are in same local area network.
21. device as claimed in claim 20, which is characterized in that described first, which establishes module, includes:
Receiving unit, the second audio for receiving the assigned frequency that the first terminal is broadcasted under wireless access dot pattern are believed Breath, second audio-frequency information are that the first terminal is generated based on the first access-in point information of the first terminal, described the One access-in point information includes at least access point identity;
Second transmission unit, for being based on second audio-frequency information, Xiang Suoshu first terminal sends wireless network connection request, The first terminal is set to establish the wireless network connection between the second terminal, the first terminal and the second terminal In same local area network.
22. device as claimed in claim 21, which is characterized in that second transmission unit includes:
Second parsing subunit obtains the second access-in point information for parsing to second audio-frequency information;
Subelement is verified, for header information and trailer information based on second access-in point information, to second access Point information carries out fault-tolerant verifying;
Subelement is removed, for if the verification passes, then removing the header information and trailer information of second access-in point information, Obtain the first access-in point information of the first terminal;
Second transmission sub-unit, for being based on first access-in point information, Xiang Suoshu first terminal sends wireless network connection Request.
CN201510081000.3A 2015-02-13 2015-02-13 Document transmission method and device Active CN104702678B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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
CN104142868B (en) Establish the method and device of connection
CN106791892A (en) It is a kind of to take turns the live methods, devices and systems of wheat
CN105933904A (en) Network connection method and device
CN106714207B (en) A kind of information processing method and terminal device
CN104581993B (en) It is wirelessly connected the method and terminal of the method established, data transmission
CN104702678B (en) Document transmission method and device
CN103458408A (en) Network connection method and network sharing method and device
CN106791955B (en) A kind of method and system of determining live streaming duration
CN104967608B (en) Play method, mobile terminal and the fixed terminal of multimedia file
CN104135728B (en) Method for connecting network and device
CN106161176A (en) Cluster conversation message treatment method and device
CN104519197A (en) User login method, user login device and terminal devices
CN106068020A (en) Hinting abnormal states method and device
CN104820665A (en) Method, terminal and server for exhibiting recommendation information
CN106658354B (en) A kind of data transmission method and equipment
CN106603740B (en) It is connected to the network abnormal processing method and terminal device
CN106303605B (en) A kind of methods, devices and systems to send a notification message
CN106254910A (en) A kind of method and apparatus recording image
CN106454976B (en) A kind of switching method of wireless network, device and terminal
CN106658657A (en) Network access method and device
CN105704712A (en) Network resource sharing method, mobile terminal, and server
CN106161147B (en) Establish the method and device of network connection
CN105630517A (en) Configuration information setting method, configuration information setting device and communication system
CN103227832B (en) Share method for processing resource and device
CN108270764A (en) A kind of application login method, server and mobile terminal

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