CN105763516B - The method and apparatus that terminal sends data to net external equipment out of WLAN - Google Patents

The method and apparatus that terminal sends data to net external equipment out of WLAN Download PDF

Info

Publication number
CN105763516B
CN105763516B CN201410790326.9A CN201410790326A CN105763516B CN 105763516 B CN105763516 B CN 105763516B CN 201410790326 A CN201410790326 A CN 201410790326A CN 105763516 B CN105763516 B CN 105763516B
Authority
CN
China
Prior art keywords
data packet
data
wlan
terminal
target string
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
CN201410790326.9A
Other languages
Chinese (zh)
Other versions
CN105763516A (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.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201410790326.9A priority Critical patent/CN105763516B/en
Publication of CN105763516A publication Critical patent/CN105763516A/en
Application granted granted Critical
Publication of CN105763516B publication Critical patent/CN105763516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A method of terminal sends data to net external equipment out of WLAN, it include: that terminal generates starting ip data packet and the corresponding IP data packet of target string, these data packets are arranged to multicast IP data packet, and destination address and/or backpack body length are used to carry the serial number of itself identity information and data according to the encoded radio and character of each character in data length variable quantity information before and after the encryption mechanism encryption in the WLAN data communication process or target string in target string;Further, the starting ip data packet and the corresponding IP data packet of the target string are successively sent to the wireless access points of the WLAN by terminal.The data that the terminal that the equipment outside WLAN is recognized accurately can in WLAN in the above method is sent.In addition, also providing a kind of device corresponding with the above method and a kind of method and apparatus for receiving the data that terminal is sent to net external equipment out of WLAN.

Description

The method and apparatus that terminal sends data to net external equipment out of WLAN
Technical field
The present invention relates to network technique field, more particularly to one kind, terminal is sent to net external equipment out of WLAN The method and apparatus of data, and it is related to a kind of method for receiving the data that terminal is sent to net external equipment out of WLAN And device.
Background technique
WLAN (Wireless Local Area Networks;WLAN) number is transmitted in the sky using wireless technology According to, speech and vision signal.As a kind of alternative solution or extension of traditional wiring network, WLAN is user from fixation Position, which has been liberated, to be come out, so that user can obtain information whenever and wherever possible in WLAN coverage area.
Wireless access points (Access Point, AP) are most common when being current establishment micro radio local area network to be set It is standby.Wireless access points carry the role of the bridge of connection wired network and wireless network, and by each wireless network terminal (nothing Line terminal, and can be described as wireless stations) connect together.The wireless terminal of WLAN is accessed in wireless access points It can be communicated by wireless access points in coverage area.
Each WLAN has the service set (SSID, Service Set Identifier) of oneself, That is, the name of WLAN.Wireless terminal needs to set respective wireless local area network for the wireless network card of itself SSID could access the WLAN.If the WLAN has access pin, wireless terminal also needs wireless to this The wireless access points of local area network send the access pin and test in order to which wireless access points carry out identity to wireless terminal Card, after authentication passes through, wireless terminal could access the WLAN.
Had during the intercommunication of the wireless terminal in secure data area, WLAN and is added Close mechanism and corresponding decryption mechanisms, wireless network card can be according to certain Encryption Algorithm according to wireless before sending IP data packet The access pin of local area network encrypts the backpack body of IP data packet, and wireless network card can be according to right after receiving IP data packet The decipherment algorithm answered is decrypted the backpack body of IP data packet according to the access pin of WLAN, thus outside WLAN Even if equipment capture the wireless terminal in WLAN transmission data packet, can not also be recognized accurately included in it The information content.
Summary of the invention
Based on this, it is necessary to provide method from data to net external equipment and one kind that a kind of terminal out of WLAN sends Terminal sends the device of data to net external equipment out of WLAN, so that the equipment outside WLAN can be recognized accurately The data that terminal in WLAN is sent.
In addition, there is a need to provide a kind of method for receiving the data that terminal is sent to net external equipment out of WLAN With a kind of device for receiving terminal is sent to net external equipment out of WLAN data so that the equipment outside WLAN The data that the terminal that can be recognized accurately in WLAN is sent.
A method of terminal sends data to net external equipment out of WLAN, comprising the following steps:
The terminal obtains the target string for needing to send;
The terminal constructions starting ip data packet, the first segment of the destination address of the starting ip data packet are arranged to indicate The IP data packet is multicast IP data packet, and latter three sections of the destination address of the starting ip data packet are configured to meet and about shape Formula, before indicating that the IP data packet carries data according to the encryption mechanism encryption in the WLAN data communication process The backpack body length of data length variable quantity information and the starting ip data packet is about definite value afterwards;
The terminal generates the corresponding IP data packet of each character in the target string, the mesh in the IP data packet The first segment of mark address is arranged to indicate that the IP data packet is multicast IP data packet, the destination address in the IP data packet It is arranged to indicate the serial number of the encoded radio and corresponding character of corresponding character in the target string, the IP for three sections afterwards The length of data packet backpack body meets preset condition to indicate the IP data packet for the corresponding IP data packet of the target string;
The starting ip data packet and the corresponding IP data packet of the target string are successively sent to by the terminal The wireless access points of the WLAN, by the wireless access points broadcast the starting ip data packet and The corresponding IP data packet of the target string, so that the equipment that wireless network card is under listening mode can capture The starting ip data packet and the corresponding IP data packet of the target string.
A method of receiving the data that terminal is sent to net external equipment out of WLAN, comprising the following steps:
The equipment is accessed by the accessing wirelessly that the wireless network card under listening mode captures the WLAN The IP data packet of point broadcast, the IP data packet are sent to the accessing wirelessly by the terminal in the WLAN and access Point;
Whether latter three sections of the destination address for the IP data packet that the unit check captures meet agreement form, with determination Whether the IP data packet is to carry data according to the encryption mechanism encryption front and back in the WLAN data communication process The starting ip data packet of data length variable quantity information, if capturing the starting ip data packet, by the starting ip data The backpack body length of packet and the difference of about definite value add as data according to the encryption mechanism in the WLAN data communication process The length variable quantity of close front and back data;
The length and the length for the IP data packet backpack body that unit check captures after the starting ip data packet become Change amount difference whether meet preset condition with the determination IP data packet whether be out of WLAN to outside WLAN The corresponding IP data packet of the target string of transmission, after the destination address for obtaining the corresponding IP data packet of the target string The serial number of the encoded radio of correspondence character represented by three sections and corresponding character in the target string;The equipment according to Serial number of the encoded radio and each character of each character obtained in the target string restores the target string.
A kind of terminal out of WLAN sends the device of data to net external equipment, comprising:
Character string obtains module, for obtaining the target string for needing to send.
Starting ip data packet constructing module, for constructing starting ip data packet, the destination address of the starting ip data packet First segment is arranged to indicate that the IP data packet is multicast IP data packet, and latter three sections of the destination address of the starting ip data packet It is configured to meet agreement form, to indicate that the IP data packet carries data according to the WLAN data communication process In encryption mechanism encryption front and back data length variable quantity information and the starting ip data packet backpack body length be agreement Value;
Target IP data packet generation module, for generating the corresponding IP data packet of each character in target string, wherein The first segment of destination address in IP data packet is arranged to indicate the IP data packet for multicast IP data packet, in IP data packet Latter three sections of destination address are arranged to indicate the serial number of the encoded radio and corresponding character of corresponding character in target string, The length of IP data packet meets preset condition to indicate IP data packet for the corresponding IP data packet of the target string;
Packet sending module, for successively by the starting ip data packet and the corresponding IP number of the target string It is sent to the wireless access points of the WLAN according to packet, broadcasts the starting ip by the wireless access points Data packet and the corresponding IP data packet of the target string, so that wireless network card is in the equipment under listening mode The starting ip data packet and the corresponding IP data packet of the target string can be captured.
A kind of device receiving the data that terminal is sent to net external equipment out of WLAN, comprising:
Data packet obtains module, for capturing the wireless visit of WLAN by the wireless network card under listening mode Ask that the IP data packet of access point broadcast, IP data packet are sent to wireless access points by the terminal in WLAN;
First examines processing module, for examining whether latter three sections of destination address of the IP data packet captured meet about Setting formula, to determine whether the IP data packet is to carry data according to the encryption in the WLAN data communication process The starting ip data packet of data length variable quantity information before and after encryption mechanism, if the starting ip data packet is captured, by institute The difference of the backpack body length and about definite value of stating starting ip data packet is as data according in the WLAN data communication process Encryption mechanism encryption front and back data length variable quantity;
Second examines processing module, for examining the IP data packet backpack body captured after the starting ip data packet Whether it is from WLAN that whether length and the difference of the length variable quantity meet preset condition with the determination IP data packet The interior corresponding IP data packet of target string sent to outside WLAN, obtains the corresponding IP data of the target string The encoded radio of correspondence character represented by latter three sections of the destination address of packet and corresponding character are in the target string Serial number;
Character string recovery module, for each character and each character according to acquisition in the target string Serial number restores the target string.
Based on the method and apparatus that the above-mentioned terminal out of WLAN sends data to net external equipment, what terminal generated is risen The first segment of the destination address of beginning IP data packet and the corresponding IP data packet of target string is set as indicating the IP data packet It is so that wireless access points can broadcast these IP data packets after receiving these IP data packets for multicast IP data packet The equipment that wireless network card is under listening mode outside WLAN captures the IP data packet and provides basis;Also, starting ip The backpack body length of data packet is about definite value, so that after WLAN external equipment captures starting ip data packet, it can basis The backpack body length of starting ip data packet determines data according to the encryption mechanism encryption front and back in WLAN data communication process Data length variable quantity, so that it is determined that the corresponding IP data packet backpack body of target string is before encrypting original according to the encryption mechanism Length;The serial number of the encoded radio and character of each character of target string in target string is arranged in correspondence terminal In IP data packet in latter three sections of destination address, due to only having backpack body according to WLAN in the IP data packet of terminal transmission Access pin is encrypted, and the packet header of IP data packet will not be encrypted, so that destination address therein will not be encrypted, because This, even after the equipment for not knowing outside the WLAN of the access pin of WLAN captures IP data packet, it can also To obtain the serial number of the encoded radio and character of character in character string from latter three sections of the destination address of IP data packet, thus Get the target string of wireless terminal transmission;In addition, the length for the IP data packet that terminal generates meets preset condition with table Show that IP data packet is the IP data packet sent out of WLAN to outside WLAN, so that equipment can be based only upon this A little data packets obtain the target string of the transmission of the wireless terminal in WLAN, rather than are captured based on it all Data packet obtains target strings, so that equipment finally be made accurately to identify WLAN from the IP data packet that it is captured The target string that interior wireless terminal is sent.
Correspondingly, method and dress based on the above-mentioned reception data that terminal is sent to net external equipment out of WLAN It sets, the wireless network card of equipment is in listening mode to can also capture the nothing of WLAN even if not accessing WLAN The IP data packet of line access points broadcast, whether the IP data packet that takes of unit check capture is starting ip data packet, according to rising The backpack body length of beginning IP data packet determines data according to the encryption mechanism encryption front and back number in WLAN data communication process According to length variable quantity;It is according to the IP data packet that length variable quantity inspection captures after starting ip data packet further No is the corresponding IP data packet of target string, and the volume of corresponding character is obtained from the corresponding IP data packet of target string The serial number of code value and corresponding character in target string;Finally, equipment according to the encoded radio of each character of acquisition with And serial number of each character in target string restores target string, so as to from the IP data packet that it is captured accurately Identify the target string that the wireless terminal in WLAN is sent.
Detailed description of the invention
The method that Figure 1A sends data to net external equipment for the terminal of the invention in one embodiment out of WLAN With the running environment schematic diagram for the method for receiving the data that terminal is sent to net external equipment out of WLAN;
Figure 1B is the schematic diagram of internal structure of the terminal 102 of Figure 1A in one embodiment;
Fig. 1 C is the schematic diagram of internal structure of the equipment 106 of Figure 1A in one embodiment;
Fig. 2 shows for the process for the method that terminal in the slave WLAN in one embodiment sends data to net external equipment It is intended to;
Fig. 3 is the flow diagram of the step S206 in one embodiment in Fig. 2;
Fig. 4 is the method for the reception data that terminal is sent to net external equipment out of WLAN in one embodiment Flow diagram;
Fig. 5 shows for the structure for the device that terminal in the slave WLAN in one embodiment sends data to net external equipment It is intended to;
Fig. 6 is the structural schematic diagram of the Target IP data packet generation module 506 in one embodiment in Fig. 5;
Fig. 7 is the device of the reception data that terminal is sent to net external equipment out of WLAN in one embodiment Structural schematic diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
The method that Figure 1A sends data to net external equipment for the terminal of the invention in one embodiment out of WLAN With the running environment schematic diagram for the method for receiving the data that terminal is sent to net external equipment out of WLAN.
Terminal in WLAN of the present invention refer to having accessed WLAN i.e. with WLAN Wireless access points establish communication connection terminal;And the equipment outside WLAN then refers to not yet accessing wireless office The equipment of domain net.Wireless access points of the present invention can be wireless router.
Communication connection, equipment 106 has been established in the wireless access points 104 of terminal 102 and WLAN in Figure 1A It not yet establishes and communicates to connect with wireless access points 104.
As shown in Figure 1A, terminal 102 obtains the target string for needing to send, and generates destination address and carries target character The IP data packet of string information, is sent to wireless access points 104 for IP data packet.Wireless access points 104 broadcast the IP Data packet, equipment 106 captures the IP data packet by the wireless network card under listening mode, and parses from IP data packet Target string information out.
Terminal (including terminal 102 shown in figure 1A) of the present invention can be mobile phone, laptop, tablet computer etc. The intelligent subscriber terminal of Wireless LAN can be arbitrarily interacted and can access with user.In one embodiment, terminal 102 Internal structure it is as shown in Figure 1B, the terminal 102 include by system bus connect processor, storage medium, memory, network Interface, display screen and input mechanism.The input mechanism of terminal 102 triggers dependent instruction, user terminal 102 according to user's operation Display screen relevant information is then showed into user.Terminal 102 by its network interface and wireless access points 104 into Row communication.It stores in the storage medium of terminal 102 for realizing the terminal of the invention out of WLAN to net peripheral hardware preparation The software instruction of the method for data is sent, the processor of terminal 102 executes these instructions to realize the present invention out of WLAN The method that terminal sends data to net external equipment.
Wireless access points (including terminal 102 shown in figure 1A) of the present invention can be wireless router etc..
Equipment (including the equipment 106 in Figure 1A) of the present invention can for television set, camera, printer, intelligent lamp, The equipment of the arbitrary accessible WLAN such as intelligence beginning.In one embodiment, the internal junction of the equipment 106 in Figure 1A Structure is as shown in Figure 1 C, which includes control chip, work functions mechanism, wireless network card and storage medium.Wherein, it controls The work of chip coordinated control work functions mechanism, wireless network card and storage medium, work functions mechanism is for realizing equipment 104 Basic function, such as the work functions mechanism of camera at least has the function of capturing image etc.;Wireless network card, which has, to be monitored Mode and general mode, wireless network card can capture all IP data that neighbouring wireless access points are sent in the listen mode It wraps and does not filter any IP data packet, in the normal mode, it is not to send in the IP data packet of capture that wireless network card, which filters out, To the IP data packet of oneself;Terminal is stored for realizing reception of the invention out of WLAN in storage medium to net peripheral hardware The software instruction of the method for the data that preparation is sent, control chip execute these instructions to realize that the present invention is received from WLAN The method for the data that interior terminal is sent to net external equipment.
As shown in Fig. 2, a kind of method that terminal out of WLAN sends data to net external equipment, including following step It is rapid:
Step S202, terminal obtain the target string for needing to send.
In one embodiment, target string includes the service set (SSID) and access pin of WLAN, So that equipment can access WLAN after getting service set and access pin.
Before step S202, the above-mentioned terminal out of WLAN further includes to the method that net external equipment sends data Step: terminal obtains the access pin for the WLAN being currently accessed.In one embodiment, terminal can be shown for inputting The interface of the access pin for the WLAN that terminal is currently accessed, and obtain the access pin that user is inputted by the interface.
Further in step S202, terminal can obtain the SSID for the WLAN being currently accessed, and by the SSID Target string is combined into according to preset format with the access pin for the WLAN being currently accessed.For example, SSID is SSID and access pin can be combined into target string: REXCHANG by REXCHANG, access pin 123 | and 123.
Step S204, terminal constructions starting ip data packet, the first segment of the destination address of the starting ip data packet are set To indicate that the IP data packet is multicast IP data packet, and latter three sections of the destination address of the starting ip data packet are configured to meet Agreement form, to indicate that the IP data packet carries data according to the encryption mechanism in the WLAN data communication process The backpack body length of encryption front and back data length variable quantity information and starting ip data packet is about definite value.
IP data packet is the minimum unit that data are transmitted on the internet, is made of packet header and backpack body, wherein packet header has Regular length, including check information, source address, destination address etc., backpack body then include the specific data carried.
The destination address of IP data packet is the IP address of intended recipient, and usually available " dotted decimal notation " is expressed as by sentence The form of decimal integer string between 4 0~255 of point separation, for example, 100.4.5.6;Wherein, each integer corresponds to mesh One section for marking address, the first integer corresponds to first segment, and second integer corresponds to second segment, and so on.
In a wireless local area network, due to wireless access points in the form of radio wave propagation data, as long as Wireless access points carry the radio wave of IP data packet to external radiation, that is, broadcast IP data packet.Multicast IP data Packet is the terminal in local area network to the data packet for belonging to same group of other terminals propagation, and wireless access points receive multicast IP After data packet, the multicast IP data packet can be broadcasted.Starting ip data packet is arranged to multicast IP data packet, purpose in the present invention It is that the IP data packet can be broadcasted so that wireless access points are after receiving starting ip data packet.Below by target character The purpose that corresponding IP data packet is arranged to multicast IP data packet of going here and there is identical.
The first segment (number) of the destination address of multicast IP data packet is normally in 224~239 ranges, according to IEEE 802.11 (the general standard of WLAN now, it is wireless as defined in international motor electronic Engineering society (IEEE) The standard of network communication), the first segment (number) of destination address is 239, it is rear three sections be any 0~255 number IP data Packet is multicast IP data packet.
In one embodiment, the of the destination address of starting ip data packet and the corresponding IP data packet of target string One section is arranged to 239, thus rear the three of the destination address of starting ip data packet and the corresponding IP data packet of target string Section can be used for carrying specify information.
In one embodiment, 239.0.0.0 can be set by the destination address of starting ip data packet.
Before transmitting due to IP data packet, backpack body is by wireless network card according to certain Encryption Algorithm according to wireless local area The access pin of net is encrypted, and after encryption, the length of backpack body can change, and backpack body length variable quantity is by Encryption Algorithm It uniquely determines, the corresponding backpack body length variable quantity of specific Encryption Algorithm is fixed value.It is used since terminal may be unaware that Encryption Algorithm, if terminal does not know used Encryption Algorithm, so that backpack body length variable quantity can not just be known in advance.Terminal The initial length that can arrange the backpack body of starting ip data packet between equipment is about definite value, the starting ip data packet that equipment receives Backpack body be by encrypted backpack body, equipment can obtain the backpack body length of the starting ip data packet received and the difference of about definite value As data according to the data length variable quantity of the encryption mechanism encryption front and back in WLAN data communication process.
In one embodiment, 0 can be set by the backpack body length of starting ip data packet, so that equipment may make to capture The backpack body length of starting ip data packet be data length variable quantity before and after above-mentioned encryption.
Step S206, terminal generate the corresponding IP data packet of each character in target string, wherein in IP data packet The first segment of destination address is arranged to indicate the IP data packet for multicast IP data packet, after the destination address in IP data packet Three sections are arranged to indicate the serial number of the encoded radio and corresponding character of corresponding character in target string, IP data packet backpack body Length meet preset condition to indicate that IP data packet is the target character sent out of WLAN to outside WLAN Go here and there corresponding IP data packet.
As shown in figure 3, in one embodiment, step S206 the following steps are included:
Step S302 obtains the sequence of the encoded radio and each character of each character in target word string in target word string Number.
In one embodiment, the corresponding UTF-8 encoded radio of each character in target string can be obtained, wherein UTF-8 (8-bit Unicode Transformation Format) is a kind of variable length character coding for Unicode.
By taking target string " REXCHANG | 123 " as an example, the UTF-8 that can get each character in target string is compiled Code value is as shown in table 1 below:
Table 1
R E X C H A N G | 1 2 3
82 69 88 67 72 65 78 71 124 49 50 51
Step S304 constructs the packet header of the corresponding IP data packet of each character, by the first segment of the destination address in packet header It is set as the coding for indicating that IP data packet is multicast IP data packet, and latter three sections of destination address being set as indicating corresponding character The serial number of value and corresponding character in target string.
In one embodiment, the second segment of the destination address of the corresponding IP data packet of each character and third section are set To indicate serial number of the corresponding character in target string, the 4th section of encoded radio for being arranged to indicate corresponding character.At one In embodiment, second segment number can be used as a high position for serial number, third number of segment word can be used as the low level of serial number, when third number of segment word not At three, foot, three can be supplied with 0 before third number of segment word.For example, destination address are as follows: 239.1.2.82 then corresponds to character and exists Serial number 1002 in target string.
Step S306 constructs the backpack body of the corresponding IP data packet of each character, so that the backpack body length of IP data packet meets Preset condition is to indicate that IP data packet is the IP data packet sent out of WLAN to outside WLAN.
In one embodiment, the backpack body length of the corresponding IP data packet of each character is equal to the fixed value of agreement, with table Show that IP data packet is the IP data packet sent out of WLAN to outside WLAN;
In another embodiment, the backpack body length of the corresponding IP data packet of each character is equal to corresponding character in target word The sum of serial number and the encoded radio of corresponding character in symbol string, with indicate IP data packet for out of WLAN to WLAN The IP data packet of outer transmission;
So that the equipment outside WLAN can be picked out from the IP data packet of capture with above-mentioned special characteristic IP data packet, and further therefrom identification in target string.
For example, by taking target string " REXCHANG | 123 " as an example, serial number, correspondence of each character in target string The destination address of IP data packet, the relationship between the corresponding encrypted length of IP data packet it is as shown in table 2 below:
Table 2
Step S308, by the packet header of the corresponding IP data packet of each character IP data corresponding with the backpack body each character of composition Packet.
Starting ip data packet and the corresponding IP data packet of target string are successively sent to wirelessly by step S208, terminal The wireless access points of local area network broadcast starting ip data packet by wireless access points and target string are corresponding IP data packet, so that the equipment that wireless network card is under listening mode can capture starting ip data packet and target character Go here and there corresponding IP data packet.
Terminal sends the corresponding IP data packet of target string after sending starting ip data packet.About it is scheduled on transmission starting The corresponding IP data packet of target string is sent after IP data packet, then WLAN external equipment captures starting ip data packet Later, that is, it may know that the terminal in WLAN will send the corresponding IP data packet of target string.
In one embodiment, the above-mentioned terminal out of WLAN further includes to the method that net external equipment sends data Following steps: terminal obtains the physical label code of equipment, according to physical label code to the coding of character each in target string Value is encrypted;The encoded radio of correspondence character represented by destination address in IP data packet is the encrypted volume of corresponding character Code value.
Physical label code can unique identification equipment, the physical label code of any two distinct device is all different.
In one embodiment, terminal can show the interface of the physical label code for input equipment, and it is logical to obtain user Cross the physical label code of the equipment of interface input.In another embodiment, the corresponding two dimensional code of physical label code of equipment It can be printed on label appended by equipment body, terminal scans to obtain the physical label code of equipment by scanning means.
In the present embodiment, the encoded radio of correspondence character represented by the destination address in IP data packet is according to the equipment of input Physical label code encrypted, thus only the corresponding equipment of physical label code capture IP data packet after could identify Character is corresponded to out, therefore improves the safety of data transmission.
In one embodiment, the above-mentioned terminal out of WLAN further includes walking to the method that net external equipment sends data It is rapid:
After terminating to send the corresponding each IP data packet of target string, sending terminates IP data packet, this terminates IP The first segment of the destination address of data packet is arranged to indicate that the IP data packet is multicast IP data packet, and terminates IP data packet Latter three sections of destination address are configured to meet agreement form to indicate that IP data packet is sent.
For example, 239.255.255.255 can be set by the destination address for terminating IP data packet.
To which WLAN external equipment captures after terminating IP data packet, then may know that corresponding IP in target character The epicycle transmission of data packet is over.WLAN external equipment can according to receive starting ip data packet and terminate IP data Received IP data packet restores target string during packet
In one embodiment, above-mentioned target string also includes terminal IP address in a wireless local area network and end The port numbers for being communicated with equipment at end, so that after equipment access WLAN data packet can be sent to terminal.Terminal The IP of terminal in a wireless local area network can be added being combined into target string by the SSID and access pin of WLAN The port numbers for being communicated with equipment of address and terminal.For example, the IP address of terminal in a wireless local area network is 192.168.1.102, the port numbers for communicating with equipment of terminal are 8080, with above-mentioned target string " REXCHANG | Based on 123 ", 192.168.1.102 and 8080 can be added in the target string, form final target string: REXCHANG|123|192.168.1.102|8080。
The method that terminal sends data to net external equipment in above-mentioned slave WLAN is further comprising the steps of: terminal is followed Ring sends the corresponding IP data packet of each character in starting ip data packet and target string, until receiving equipment transmission Indicate the feedback information packet of equipment successful data reception.
If terminal do not receive feedback information packet just stop send starting ip data packet and target string it is corresponding IP data packet, then equipment is likely due to IP data-bag lost, damage or the of short duration failure and other reasons of equipment and causes not receiving Starting ip data packet or the corresponding all IP data packets of target string.And the present embodiment cycle through starting ip data packet with And the corresponding IP data packet of each character in target string, the expression equipment until receiving equipment transmission have been properly received number According to feedback information packet, it can be ensured that equipment receives initial data packet and the corresponding all IP data packets of target string.
Corresponding to the method that the above-mentioned terminal out of WLAN sends data to net external equipment, outside WLAN Equipment receives net in the angle of data that sends of terminal set out, terminal that the present invention also provides a kind of receptions out of WLAN to The method for the data that net external equipment is sent.
As shown in figure 4, a kind of method for receiving the data that terminal is sent to net external equipment out of WLAN, including with Lower step:
Step S402, equipment are accessed by the accessing wirelessly that the wireless network card under listening mode captures WLAN The IP data packet of point broadcast, IP data packet are sent to wireless access points by the terminal in WLAN.
Whether latter three sections of step S404, the destination address for the IP data packet that unit check captures meet agreement form, To determine whether the IP data packet is before carrying data according to the encryption mechanism encryption in WLAN data communication process The starting ip data packet of data length variable quantity information afterwards, if capturing starting ip data packet, by the packet of starting ip data packet The difference of body length and about definite value is as data according to the encryption mechanism encryption front and back data in WLAN data communication process Length variable quantity.
For example, equipment can examine whether rear three sections (numbers) of the destination address of the IP data packet captured are all 0.It is preferred that , equipment can examine whether the destination address of the IP data packet captured is 239.0.0.0.If so, the IP data packet is Beginning IP data packet.
IP data packet due to IP data packet before transmitting, backpack body is calculated by terminal wireless network interface card according to certain encryption Method is encrypted according to the access pin of WLAN, and IP data packet original length of backpack body before the ciphering process is About definite value, after encryption, the length of backpack body can change, and length variable quantity is uniquely determined by Encryption Algorithm.What equipment captured Starting ip data packet is encrypted IP data packet, and the difference of the starting ip data packet and about definite value is that the length of backpack body changes Amount is also data according to the length variable quantity of the encryption mechanism encryption front and back data in WLAN data communication process.
Step S406, the length and above-mentioned length of the IP data packet backpack body that unit check captures after starting ip data packet Degree variable quantity difference whether meet preset condition with determine IP data packet whether be out of WLAN to outside WLAN The corresponding IP data packet of the target string of transmission obtains latter three sections of the destination address of the corresponding IP data packet of target string The serial number of the encoded radio of represented correspondence character and corresponding character in target string.
The length of the IP data packet backpack body captured and the difference of above-mentioned length variable quantity are that the IP data packet adds above-mentioned The original length of backpack body before close process.
In one embodiment, the difference of the length and above-mentioned length variable quantity that can examine the IP data packet backpack body captured is The no fixed value for being equal to agreement, if so, judging IP data packet for the mesh that sends out of WLAN into WLAN Mark the corresponding IP data packet of character string.
In one embodiment, the number of the second segment and third section that can obtain the destination address in IP data packet is combined into One number.It wherein, can be using second segment number as high-order digit, third number of segment word as low order digit, when third number of segment word When less than three, three can be supplied with 0 before third number of segment word.
Further, it can examine whether the length of the IP data packet backpack body captured is equal to the destination address of the IP data packet Second segment and the number that combines of third section and the 4th number of segment word and, if so, determining IP data packet for from wireless local area The corresponding IP data packet of target string sent in net to outside WLAN.
In one embodiment, destination address second segment and third section group that target string corresponds to IP data packet can be obtained Serial number of the number of synthesis as correspondence character in target string, and obtain the 4th section of number conduct pair of destination address Answer the encoded radio of character.Step S408, equipment is according to the encoded radio and each character of each character of acquisition in target character Serial number in string restores target string.
In one embodiment, can using the encoded radio of the correspondence character obtained from the destination address of IP data packet as pair The UTF-8 encoded radio for answering character, the corresponding character of encoded radio that acquisition is parsed according to UTF-8 coding rule.
In one embodiment, encoded radio represented by destination address is according to equipment in the IP data packet that equipment captures Physical label code carried out encryption.In the present embodiment, above-mentioned reception terminal out of WLAN is sent to net external equipment The method of data is further comprised the steps of: in the coding for getting correspondence character represented by latter three sections of the destination address of IP data packet After value, equipment is decrypted the encoded radio according to the physical label code of equipment, and word used in equipment reduction target string Symbol is acquired according to the encoded radio after decryption.
In one embodiment, the method for the above-mentioned reception data that terminal is sent to net external equipment out of WLAN is also Comprising steps of whether latter three sections of the destination address for the IP data packet that unit check captures after starting ip data packet meet Agreement form is to determine whether the IP data packet is the end IP number for indicating the corresponding IP data packet of target string and being sent According to packet, target string is restored according to received IP data packet during receiving starting ip data packet and terminating IP data packet.
For example, when the destination address of IP data packet is 239.255.255.255, it may be determined that the IP data packet is to terminate IP Data packet.
The present embodiment can avoid the indefinite capturing IP data packets of equipment to identify the situation of target string.
In one embodiment, in the target string that equipment restores comprising WLAN service set and Access pin;The method of the above-mentioned reception data that terminal is sent to net external equipment out of WLAN further comprises the steps of: equipment WLAN is accessed according to service set and access pin.Before equipment accesses WLAN, equipment can will be built in it Wireless network card general mode is adjusted to by listening mode, so that equipment is led to by wireless network card and wireless access points Letter.
In the present embodiment, even if equipment does not have input mechanism, such as touch screen etc. can also be got in WLAN Service set and access pin, to be linked into WLAN.
In one embodiment, also comprising sending the terminal of IP data packet in wireless office in the target string restored The port numbers for being communicated with equipment of IP address and terminal in the net of domain;Above-mentioned reception out of WLAN terminal to net The method for the data that external equipment is sent, which further comprises the steps of: equipment, indicates that equipment has become to terminal transmission according to IP address and port numbers The feedback information packet of function reception data.To may make terminal to be not repeated to send the corresponding IP data packet of target string.
The present invention also provides a kind of terminal, which is used to execute in the slave WLAN in any of the above-described embodiment eventually Hold the method for sending data to net external equipment.
The present invention also provides a kind of equipment, which is used to execute the reception in any of the above-described embodiment from WLAN The method for the data that interior terminal is sent to net external equipment.
As shown in figure 5, a kind of terminal out of WLAN sends the device of data to net external equipment, which is located at should In terminal, including character string obtains module 502, starting ip data packet constructing module 504, Target IP data packet generation module 506 With packet sending module 508:
Character string obtains module 502 and is used to obtain the target string for needing to send.
In one embodiment, target string includes the service set (SSID) and access pin of WLAN, So that equipment can access WLAN after getting service set and access pin.
In one embodiment, the device of the above-mentioned terminal out of WLAN to net external equipment transmission data further includes connecing Enter password and obtain module (not shown), for obtaining the access pin for the WLAN being currently accessed.Implement at one In example, access pin, which obtains module, can obtain the access pin that user is inputted by interface, and the interface is current for input terminal The access pin of the WLAN of access.
Further, character string, which obtains module 502, can obtain the SSID of the WLAN being currently accessed, and by the SSID Target string is combined into according to preset format with the access pin for the WLAN being currently accessed.
Starting ip data packet constructing module 504 is for constructing starting ip data packet, the destination address of the starting ip data packet First segment be arranged to indicate that the IP data packet is multicast IP data packet, and rear the three of the destination address of the starting ip data packet Section is configured to meet agreement form, to indicate that the IP data packet carries data according to the WLAN data communication mistake The backpack body length of encryption mechanism encryption front and back data length variable quantity information and starting ip data packet in journey is about definite value.
IP data packet is the minimum unit that data are transmitted on the internet, is made of packet header and backpack body, wherein packet header has Regular length, including check information, source address, destination address etc., backpack body then include the specific data carried.
The destination address of IP data packet is the IP address of intended recipient, and usually available " dotted decimal notation " is expressed as by sentence The form of decimal integer string between 4 0~255 of point separation, for example, 100.4.5.6;Wherein, each integer corresponds to mesh One section for marking address, the first integer corresponds to first segment, and second integer corresponds to second segment, and so on.
In a wireless local area network, due to wireless access points in the form of radio wave propagation data, as long as Wireless access points carry the radio wave of IP data packet to external radiation, that is, broadcast IP data packet.Multicast IP data Packet is the terminal in local area network to the data packet for belonging to same group of other terminals propagation, and wireless access points receive multicast IP After data packet, the multicast IP data packet can be broadcasted.Starting ip data packet is arranged to multicast IP data packet, purpose in the present invention It is that the IP data packet can be broadcasted so that wireless access points are after receiving starting ip data packet.Below by target character The purpose that corresponding IP data packet is arranged to multicast IP data packet of going here and there is identical.
The first segment (number) of the destination address of multicast IP data packet is normally in 224~239 ranges, according to IEEE 802.11 (the general standard of WLAN now, it is wireless as defined in international motor electronic Engineering society (IEEE) The standard of network communication), the first segment (number) of destination address is 239, it is rear three sections be any 0~255 number IP data Packet is multicast IP data packet.
In one embodiment, the of the destination address of starting ip data packet and the corresponding IP data packet of target string One section is arranged to 239, thus rear the three of the destination address of starting ip data packet and the corresponding IP data packet of target string Section can be used for carrying specify information.
In one embodiment, the destination address of starting ip data packet can be arranged for starting ip data packet constructing module 504 For 239.0.0.0.
Before transmitting due to IP data packet, backpack body is by wireless network card according to certain Encryption Algorithm according to wireless local area The access pin of net is encrypted, and after encryption, the length of backpack body can change, and backpack body length variable quantity is by Encryption Algorithm It uniquely determines, the corresponding backpack body length variable quantity of specific Encryption Algorithm is fixed value.It is adopted by may be unaware that in terminal Encryption Algorithm, so that backpack body length variable quantity can not also be known in advance.It can arrange starting ip data between terminal and equipment The initial length of the backpack body of packet is about definite value, the backpack body for the starting ip data packet that equipment receives be by encrypted backpack body, Equipment can obtain the starting ip data packet received backpack body length and about definite value difference as data according to wireless local area netting index According to the data length variable quantity of the encryption mechanism encryption front and back in communication process.
In one embodiment, the backpack body length of starting ip data packet can be arranged for starting ip data packet constructing module 504 It is 0, so that the backpack body length for the starting ip data packet that may make equipment to capture is data length change before and after above-mentioned encryption Change amount.
Target IP data packet generation module 506 for generating the corresponding IP data packet of each character in target string, In, the first segment of the destination address in IP data packet is arranged to indicate that the IP data packet is multicast IP data packet, IP data packet In latter three sections of the destination address encoded radios for being arranged to indicate corresponding character and corresponding character in target string Serial number, the length of IP data packet backpack body meet preset condition to indicate that IP data packet is out of WLAN to WLAN The corresponding IP data packet of the target string of outer transmission.
As shown in fig. 6, in one embodiment, Target IP data packet generation module 506 includes that encoded radio and serial number obtain Module 602, packet header constructing module 604, backpack body constructing module 606 and data packet constitute module 608, in which:
Encoded radio and serial number obtain encoded radio and each word that module 602 is used to obtain each character in target word string Accord with the serial number in target word string.
In one embodiment, encoded radio and serial number obtain module 602 for that can obtain each character in target string Corresponding UTF-8 encoded radio.
Packet header constructing module 604 is used to construct the packet header of the corresponding IP data packet of each character, by the target in packet header The first segment of location is set as indicating that IP data packet is multicast IP data packet, and latter three sections of destination address are set as indicating to correspond to The serial number of the encoded radio of character and corresponding character in target string.
In one embodiment, the second segment of the destination address of the corresponding IP data packet of each character and third section are set To indicate serial number of the corresponding character in target string, the 4th section of encoded radio for being arranged to indicate corresponding character.At one In embodiment, second segment number can be used as a high position for serial number, third number of segment word can be used as the low level of serial number, when third number of segment word not At three, foot, three can be supplied with 0 before third number of segment word.For example, destination address are as follows: 239.1.2.82 then corresponds to character and exists Serial number 1002 in target string.
Backpack body constructing module 606 is used to construct the backpack body of the corresponding IP data packet of each character, so that the packet of IP data packet Body length meets preset condition to indicate that IP data packet is the IP data packet sent out of WLAN to outside WLAN.
In one embodiment, the backpack body length of the corresponding IP data packet of each character is equal to the fixed value of agreement, with table Show that IP data packet is the IP data packet sent out of WLAN to outside WLAN;
In another embodiment, the backpack body length of the corresponding IP data packet of each character is equal to corresponding character in target word The sum of serial number and the encoded radio of corresponding character in symbol string, with indicate IP data packet for out of WLAN to WLAN The IP data packet of outer transmission;
So that the equipment outside WLAN can be picked out from the IP data packet of capture with above-mentioned special characteristic IP data packet, and further therefrom identification in target string.
Data packet constitutes module 608 and is used to the packet header of the corresponding IP data packet of each character and backpack body constituting each character Corresponding IP data packet.
Packet sending module 508 is for successively sending out starting ip data packet and the corresponding IP data packet of target string The wireless access points for giving WLAN broadcast starting ip data packet and target character by wireless access points Go here and there corresponding IP data packet so that the equipment that wireless network card is under listening mode can capture starting ip data packet and The corresponding IP data packet of target string.
Packet sending module 508 sends the corresponding IP data packet of target string after sending starting ip data packet. It is about scheduled on after sending starting ip data packet and sends the corresponding IP data packet of target string, then WLAN external equipment captures To after starting ip data packet, that is, it may know that the terminal in WLAN will send the corresponding IP data of target string Packet.
In one embodiment, the device of terminal to net external equipment transmission data further includes mark in above-mentioned WLAN To know code and obtains module and encrypting module (not shown), identification code obtains the physical label code that module is used to obtain equipment, Encrypting module according to encoded radio of the physical label code to character each in target string for encrypting;Data packet sends mould The encoded radio of correspondence character represented by the destination address in IP data packet that block 508 is sent is the encrypted volume of corresponding character Code value.
Physical label code can unique identification equipment, the physical label code of any two distinct device is all different.
In one embodiment, identification code, which obtains module, can obtain the physical label for the equipment that user is inputted by interface Code, the interface are the interface of the physical label code for input equipment.In another embodiment, the physical label code of equipment is right The two dimensional code answered can be printed on label appended by equipment body, and identification code acquisition module can be scanned by scanning means to be set Standby physical label code.
In the present embodiment, the encoded radio of correspondence character represented by the destination address in IP data packet is according to the equipment of input Physical label code encrypted, thus only the corresponding equipment of physical label code capture IP data packet after could identify Character is corresponded to out, therefore improves the safety of data transmission.
In one embodiment, packet sending module 508 is also used to send target string in end corresponding each After IP data packet, sending terminates IP data packet, which is arranged to indicate to be somebody's turn to do IP data packet is multicast IP data packet, and latter three sections of destination address for terminating IP data packet be configured to meet agreement form with Indicate that IP data packet is sent.
For example, the destination address for terminating IP data packet is 239.255.255.255.
To which WLAN external equipment captures after terminating IP data packet, then may know that corresponding IP in target character The epicycle transmission of data packet is over.WLAN external equipment can according to receive starting ip data packet and terminate IP data Received IP data packet restores target string during packet
In one embodiment, above-mentioned target string also includes terminal IP address in a wireless local area network and end The port numbers for being communicated with equipment at end, so that after equipment access WLAN data packet can be sent to terminal.Character String obtain module 502 be also used to by the SSID and access pin of WLAN be combined into target string add terminal exist The port numbers for being communicated with equipment of IP address and terminal in WLAN.
The device of terminal to net external equipment transmission data further includes loop control module (in figure in above-mentioned WLAN It is not shown), each character in starting ip data packet and target string is cycled through for control data bag sending module 508 Corresponding IP data packet, the feedback information packet of the expression equipment successful data reception until receiving equipment transmission.
If terminal do not receive feedback information packet just stop send starting ip data packet and target string it is corresponding IP data packet, then equipment is likely due to IP data-bag lost, damage or the of short duration failure and other reasons of equipment and causes not receiving Starting ip data packet or the corresponding all IP data packets of target string.And the present embodiment cycle through starting ip data packet with And the corresponding IP data packet of each character in target string, the expression equipment until receiving equipment transmission have been properly received number According to feedback information packet, it can be ensured that equipment receives initial data packet and the corresponding all IP data packets of target string.
The device for sending data to net external equipment corresponding to the above-mentioned terminal out of WLAN, outside WLAN Equipment receives net in the angle of data that sends of terminal set out, terminal that the present invention also provides a kind of receptions out of WLAN to The device for the data that net external equipment is sent.
As shown in fig. 7, a kind of device for receiving the data that terminal is sent to net external equipment out of WLAN, the device In the equipment, including data packet obtains module 702, first and processing module 704, second is examined to examine 706 and of processing module Character string recovery module 708, in which:
Data packet obtains module 702 and is used to capture the wireless of WLAN by the wireless network card under listening mode The IP data packet of access points broadcast, IP data packet are sent to wireless access points by the terminal in WLAN.
First inspection processing module 704 is used to examine whether latter three sections of the destination address of the IP data packet captured to meet Agreement form, to determine whether the IP data packet is to carry data according to the encryption equipment in WLAN data communication process The starting ip data packet of system encryption front and back data length variable quantity information, if capturing starting ip data packet, by starting ip number It is encrypted as data according to the encryption mechanism in WLAN data communication process according to the backpack body length of packet and the difference of about definite value The length variable quantity of front and back data.
For example, the first inspection processing module 704 can examine latter three sections (numbers of the destination address of the IP data packet captured Word) it whether is all 0.Preferably, first inspection processing module 704 can examine the IP data packet captured destination address whether be 239.0.0.0.If so, the IP data packet is starting ip data packet.
IP data packet due to IP data packet before transmitting, backpack body is calculated by terminal wireless network interface card according to certain encryption Method is encrypted according to the access pin of WLAN, and IP data packet original length of backpack body before the ciphering process is About definite value, after encryption, the length of backpack body can change, and length variable quantity is uniquely determined by Encryption Algorithm.What equipment captured Starting ip data packet is encrypted IP data packet, and the difference of the starting ip data packet and about definite value is that the length of backpack body changes Amount is also data according to the length variable quantity of the encryption mechanism encryption front and back data in WLAN data communication process.
Second inspection processing module 706 is used to examine the length of the IP data packet backpack body captured after starting ip data packet Whether the difference of degree and above-mentioned length variable quantity meets preset condition to determine whether IP data packet is out of WLAN to nothing The corresponding IP data packet of target string sent outside line local area network, with obtaining the target of the corresponding IP data packet of target string The serial number of the encoded radio of correspondence character represented by latter three sections of location and corresponding character in target string.
The length of the IP data packet backpack body captured and the difference of above-mentioned length variable quantity are that the IP data packet adds above-mentioned The original length of backpack body before close process.
In one embodiment, the second inspection processing module 706 can examine the length of the IP data packet backpack body captured with Above-mentioned length variable quantity difference whether be equal to agreement fixed value, if so, judge IP data packet for out of WLAN to The corresponding IP data packet of target string sent in WLAN.
In one embodiment, the second inspection processing module 706 can obtain the second segment of the destination address in IP data packet A number is combined into the number of third section.It wherein, can be using second segment number as high-order digit, third number of segment word as low Bit digital can supply three before third number of segment word when third number of segment word is less than three with 0.
Further, the second inspection processing module 706 can examine whether the length of the IP data packet backpack body captured is equal to The second segment and third section of the destination address of the IP data packet combine number with the 4th number of segment word and, if so, judgement IP data packet is the corresponding IP data packet of target string sent out of WLAN to outside WLAN.
In one embodiment, the second inspection processing module 706 can obtain the target that target string corresponds to IP data packet The digital serial number as corresponding character in target string that address second segment is combined into third section, and obtain destination address The 4th section number as correspondence character encoded radio.Character string recovery module 708 is used for according to each character of acquisition The serial number of encoded radio and each character in target string restores target string.
In one embodiment, the correspondence that character string recovery module 708 can will be obtained from the destination address of IP data packet UTF-8 encoded radio of the encoded radio of character as corresponding character, the encoded radio for parsing acquisition according to UTF-8 coding rule are corresponding Character.
In one embodiment, data packet obtains volume represented by destination address in the IP data packet that module 702 captures Code value carried out encryption according to the physical label code of equipment.In the present embodiment, in the present embodiment, above-mentioned reception is from wireless local area The device for the data that equipment is sent to net external equipment in netting further includes deciphering module (not shown), for the object according to equipment The encoded radio for the character that the second inspection processing module 706 obtains is decrypted in reason identification code, and character string recovery module 708 is also Character used in former target string is acquired according to the encoded radio after decryption.
In one embodiment, the second inspection processing module 706 is also used to examine captures after starting ip data packet Latter three sections of destination address of IP data packet whether meet agreement form to determine whether the IP data packet is to indicate target word Symbol goes here and there the end IP data packet that corresponding IP data packet is sent, and character string recovery module 708 is according to receiving starting ip number Target string is restored according to packet IP data packet corresponding with target string received during terminating IP data packet.
For example, second examines processing module 706 can be true when the destination address of IP data packet is 239.255.255.255 The fixed IP data packet is to terminate IP data packet.
The present embodiment can avoid the indefinite capturing IP data packets of equipment to identify the situation of target string.
In one embodiment, character string recovery module 708 restores in obtained target string comprising WLAN Service set and access pin;The device of the above-mentioned reception data that terminal is sent to net external equipment out of WLAN is also Including LAN optimization module (not shown), for accessing WLAN according to service set and access pin.In Before equipment accesses WLAN, the wireless network card built in it can be adjusted to general mode by listening mode by equipment, to set It is standby to be communicated by wireless network card with wireless access points.
In the present embodiment, even if equipment does not have input mechanism, such as touch screen etc. can also be got in WLAN Service set and access pin, to be linked into WLAN.
In one embodiment, character string recovery module 708 restores in obtained target string also comprising sending IP number According to the terminal IP address in a wireless local area network of packet and the port numbers for being communicated with equipment of terminal;Above-mentioned reception is from nothing The device for the data that terminal is sent to net external equipment in line local area network further includes feedback module (not shown), for according to IP Address and port numbers send the feedback information packet for indicating equipment successful data reception to terminal.To may make that terminal is no longer heavy Recurrence send target string corresponding IP data packet.
The method and apparatus of data are sent to net external equipment based on the above-mentioned terminal out of WLAN and are executed above-mentioned Terminal sends the terminal of the method for data to net external equipment out of WLAN, the starting ip data packet and mesh that terminal generates The first segment of the destination address of the corresponding IP data packet of mark character string is set as indicating that the IP data packet is multicast IP data packet, with So that wireless access points can broadcast these IP data packets after receiving these IP data packets, it is in for wireless network card and monitors mould Equipment under formula outside WLAN captures the IP data packet and provides basis;Also, the backpack body length of starting ip data packet is About definite value, so that after WLAN external equipment captures starting ip data packet, it can be according to the backpack body of starting ip data packet Length determines that data encrypt front and back data length variable quantity according to the encryption mechanism in WLAN data communication process, thus Determine the corresponding IP data packet backpack body of target string according to encryption mechanism original length before encrypting;Terminal is by target character Serial number setting of the encoded radio and character of each character of string in target string destination address in corresponding IP data packet Latter three sections in, only backpack body is encrypted according to the access pin of WLAN in the IP data packet that is sent due to terminal, And the packet header of IP data packet will not be encrypted, so that destination address therein will not be encrypted, therefore, even not knowing nothing It, can also be from the target of IP data packet after equipment outside the WLAN of the access pin of line local area network captures IP data packet The serial number of the encoded radio and character of character in character string is obtained in latter three sections of address, to get wireless terminal transmission Target string;In addition, the length for the IP data packet that terminal generates meets preset condition to indicate that IP data packet is from wireless The IP data packet sent in local area network to outside WLAN, so that equipment can be based only upon these data packets to obtain wirelessly The target string that wireless terminal in local area network is sent, rather than target is obtained based on all data packets that it is captured String, so that equipment finally be made accurately to identify that the wireless terminal in WLAN is sent from the IP data packet that it is captured Target string.
Correspondingly, the method and apparatus based on the above-mentioned reception data that terminal is sent to net external equipment out of WLAN And the equipment for executing the method for above-mentioned reception data that terminal is sent to net external equipment out of WLAN, equipment it is wireless Network interface card is in listening mode to can also capture the wireless access points of WLAN even if not accessing WLAN The IP data packet of broadcast, whether the IP data packet that unit check capture takes is starting ip data packet, according to starting ip data packet Backpack body length determines that data change according to the length of the encryption mechanism encryption front and back data in WLAN data communication process Amount;Further examine whether the IP data packet captured after starting ip data packet is target character according to the length variable quantity It goes here and there corresponding IP data packet, and obtains the encoded radio and correspondence of corresponding character from the corresponding IP data packet of target string Serial number of the character in target string;Finally, equipment exists according to the encoded radio and each character of each character of acquisition Serial number in target string restores target string, so as to accurately identify wireless office from the IP data packet that it is captured The target string that wireless terminal in the net of domain is sent.
Only several embodiments of the present invention are expressed for above embodiments, and the description thereof is more specific and detailed, but can not Therefore limitations on the scope of the patent of the present invention are interpreted as.It should be pointed out that for those of ordinary skill in the art, Without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection model of the invention It encloses.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (14)

1. a kind of method that terminal out of WLAN sends data to net external equipment, comprising the following steps:
The terminal obtains the target string for needing to send;
The terminal constructions starting ip data packet, the first segment of the destination address of the starting ip data packet are arranged to indicate the IP Data packet is multicast IP data packet, and latter three sections of the destination address of the starting ip data packet are configured to meet agreement form, To indicate that the IP data packet carries data according to the encryption mechanism encryption front and back in the WLAN data communication process Data length variable quantity information, and encrypting the backpack body length of the preceding starting ip data packet is that about definite value, the about definite value are The initial length of the starting ip data packet before agreement encrypts between the terminal and equipment;
The terminal generates the corresponding IP data packet of each character in the target string, the target in the IP data packet The first segment of location is arranged to indicate that the IP data packet is multicast IP data packet, rear three of the destination address in the IP data packet Section is arranged to indicate the serial number of the encoded radio and corresponding character of corresponding character in the target string, the IP data The length of packet backpack body meets preset condition to indicate the IP data packet for the corresponding IP data packet of the target string;
The starting ip data packet and the corresponding IP data packet of the target string are successively sent to described by the terminal The wireless access points of WLAN broadcast the starting ip data packet and described by the wireless access points The corresponding IP data packet of target string so that the equipment that wireless network card is under listening mode can capture it is described Starting ip data packet and the corresponding IP data packet of the target string;The starting ip data packet captured is used for When the difference of the length and the length variable quantity that determine the IP data packet backpack body meets preset condition, according to the IP data packet The serial number of the encoded radio of middle corresponding character and corresponding character in the target string restores the target string.
2. the method that the terminal according to claim 1 out of WLAN sends data to net external equipment, feature exist In further comprising the steps of:
The terminal obtains the physical label code of the equipment, according to the physical label code to each in the target string The encoded radio of character is encrypted;
The encoded radio of correspondence character represented by destination address in the IP data packet is the encrypted coding of corresponding character Value.
3. the method that the terminal according to claim 1 out of WLAN sends data to net external equipment, feature exist In further comprising the steps of:
After terminating to send the corresponding each IP data packet of the target string, sending terminates IP data packet, the end The first segment of the destination address of IP data packet is arranged to indicate that the IP data packet is multicast IP data packet, and the end IP number It is configured to meet agreement form to indicate that IP data packet is sent according to latter three sections of the destination address of packet.
4. the method that the terminal according to claim 1 out of WLAN sends data to net external equipment, feature exist In the target string includes the service set and access pin of the WLAN, so that the equipment obtains It can access the WLAN after to the service set and access pin.
5. the method that the terminal according to claim 4 out of WLAN sends data to net external equipment, feature exist In, the target string also include IP address and the terminal of the terminal in the WLAN for The port numbers of the equipment communication, so that the equipment can send data to the terminal after accessing the WLAN Packet;
The method also includes steps:
The terminal cycles through the corresponding IP data of each character in the starting ip data packet and the target string Packet, the feedback information packet until receiving expression equipment that the equipment is sent successful data reception.
6. a kind of method for receiving the data that terminal is sent to net external equipment out of WLAN, comprising the following steps:
The equipment is wide by the wireless access points that the wireless network card under listening mode captures the WLAN The IP data packet broadcast, the IP data packet are sent to the wireless access points by the terminal in the WLAN;
Whether latter three sections of the destination address for the IP data packet that the unit check captures meet agreement form, to determine the IP Whether data packet is to carry data according to the encryption mechanism encryption front and back data in the WLAN data communication process The starting ip data packet of length variable quantity information, if capturing the starting ip data packet, by the starting ip data packet Before the difference of backpack body length and about definite value is encrypted as data according to the encryption mechanism in the WLAN data communication process The length variable quantity of data afterwards;
The length for the IP data packet backpack body that unit check captures after the starting ip data packet and the length variable quantity Difference whether meet preset condition with the determination IP data packet be to send out of WLAN to outside WLAN The corresponding IP data packet of target string, obtain latter three sections of the destination address of the corresponding IP data packet of the target string The serial number of the encoded radio of represented correspondence character and corresponding character in the target string;The equipment is according to acquisition The serial number in the target string of encoded radio and each character of each character restore the target string.
7. the method according to claim 6 for receiving the data that terminal is sent to net external equipment out of WLAN, It is characterized in that, further comprises the steps of:
After the encoded radio for getting correspondence character represented by latter three sections of the destination address of IP data packet, the equipment according to The encoded radio is decrypted in the physical label code of the equipment, after restoring character used in the target string according to decryption Encoded radio acquire.
8. the method according to claim 6 for receiving the data that terminal is sent to net external equipment out of WLAN, It is characterized in that, whether latter three sections of the destination address for the IP data packet that unit check captures after the starting ip data packet Meet agreement form to determine whether the IP data packet is the end for indicating the corresponding IP data packet of target string and being sent IP data packet restores the target word according to received IP data packet during receiving starting ip data packet and terminating IP data packet Symbol string.
9. the method according to claim 6 for receiving the data that terminal is sent to net external equipment out of WLAN, It is characterized in that, the service set and access pin restored in obtained target string comprising the WLAN;
The method also includes steps:
The equipment accesses the WLAN according to the service set and access pin.
10. the method according to claim 9 for receiving the data that terminal is sent to net external equipment out of WLAN, It is characterized in that, it is described to restore in obtained target string also comprising sending the terminal of the IP data packet in the wireless local area The port numbers for being communicated with the equipment of IP address and the terminal in net;
The method also includes steps:
The equipment, which is sent to the terminal according to the IP address and the port numbers, indicates equipment successful data reception Feedback information packet.
11. the device that a kind of terminal out of WLAN sends data to net external equipment characterized by comprising
Character string obtains module, for obtaining the target string for needing to send;
Starting ip data packet constructing module, for constructing starting ip data packet, the first of the destination address of the starting ip data packet Section is arranged to indicate that the IP data packet is multicast IP data packet, and latter three sections of the destination address of the starting ip data packet are set It is set to and meets agreement form, to indicate that the IP data packet carries data according in the WLAN data communication process The backpack body length of encryption mechanism encryption front and back data length variable quantity information and the starting ip data packet is about definite value, institute State the initial length that about definite value arranges the starting ip data packet before encrypting between the terminal and equipment;
Target IP data packet generation module, for generating the corresponding IP data packet of each character in target string, wherein IP number It is arranged to indicate the target that the IP data packet is multicast IP data packet, in IP data packet according to the first segment of the destination address in packet Latter three sections of address are arranged to indicate the serial number of the encoded radio and corresponding character of corresponding character in target string, IP number Meet preset condition according to the length of packet to indicate IP data packet for the corresponding IP data packet of the target string;
Packet sending module, for successively by the starting ip data packet and the corresponding IP data packet of the target string The wireless access points of the WLAN are sent to, broadcast the starting ip data by the wireless access points Packet and the corresponding IP data packet of the target string so that wireless network card be in the equipment under listening mode can be with Capture the starting ip data packet and the corresponding IP data packet of the target string;The starting ip data captured Packet, for when the difference of the length that determines the IP data packet backpack body and the length variable quantity meets preset condition, according to institute It states the serial number of the encoded radio for corresponding to character in IP data packet and corresponding character in the target string and restores the target Character string.
12. a kind of device for receiving the data that terminal is sent to net external equipment out of WLAN characterized by comprising
Data packet obtains module, and the accessing wirelessly for capturing WLAN by the wireless network card under listening mode connects The IP data packet of access point broadcast, IP data packet are sent to wireless access points by the terminal in WLAN;
Whether first examines processing module, about shape for examining latter three sections of destination address of the IP data packet captured to meet Formula, to determine whether the IP data packet is to carry data according to the encryption mechanism in the WLAN data communication process The starting ip data packet of encryption front and back data length variable quantity information described will rise if capturing the starting ip data packet The difference of the backpack body length of beginning IP data packet and about definite value is as data according to adding in the WLAN data communication process The length variable quantity of data before and after close encryption mechanism;
Second examines processing module, for examining the length of the IP data packet backpack body captured after the starting ip data packet With the length variable quantity difference whether meet preset condition with the determination IP data packet whether be out of WLAN to The corresponding IP data packet of target string sent outside WLAN, obtains the corresponding IP data packet of the target string The serial number of the encoded radio of correspondence character represented by latter three sections of destination address and corresponding character in the target string;
Character string recovery module, for serial number of each character and each character according to acquisition in the target string Restore the target string.
13. a kind of computer readable storage medium is stored with computer program, when the computer program is executed by processor, So that the processor is executed such as the step of any one of claims 1 to 10 the method.
14. a kind of computer equipment, including memory and processor, the memory is stored with computer program, the calculating When machine program is executed by the processor, so that the processor is executed such as any one of claims 1 to 10 the method Step.
CN201410790326.9A 2014-12-17 2014-12-17 The method and apparatus that terminal sends data to net external equipment out of WLAN Active CN105763516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410790326.9A CN105763516B (en) 2014-12-17 2014-12-17 The method and apparatus that terminal sends data to net external equipment out of WLAN

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410790326.9A CN105763516B (en) 2014-12-17 2014-12-17 The method and apparatus that terminal sends data to net external equipment out of WLAN

Publications (2)

Publication Number Publication Date
CN105763516A CN105763516A (en) 2016-07-13
CN105763516B true CN105763516B (en) 2019-11-29

Family

ID=56339609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410790326.9A Active CN105763516B (en) 2014-12-17 2014-12-17 The method and apparatus that terminal sends data to net external equipment out of WLAN

Country Status (1)

Country Link
CN (1) CN105763516B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040059B (en) * 2018-01-05 2020-09-04 艾科立方(香港)公司 Protected TCP communication method, communication device and storage medium
CN113490209A (en) * 2021-06-29 2021-10-08 锐迪科创微电子(北京)有限公司 Data transmission method, system, transmitting device, receiving device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1592166A1 (en) * 2003-02-03 2005-11-02 Sony Corporation Broadcast encryption key distribution system
CN102655643A (en) * 2011-03-04 2012-09-05 希姆通信息技术(上海)有限公司 Wireless data encryption method and wireless data decryption method
CN103825788A (en) * 2014-01-29 2014-05-28 北京睿通慧联科技有限公司 WIFI network configuration method and system
CN104010327A (en) * 2014-06-18 2014-08-27 江勇 Method and system for quickly having access to WIFI wireless network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003110543A (en) * 2001-09-27 2003-04-11 Toshiba Corp Cryptographic key setting system, radio communication equipment, and cryptographic key setting method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1592166A1 (en) * 2003-02-03 2005-11-02 Sony Corporation Broadcast encryption key distribution system
CN102655643A (en) * 2011-03-04 2012-09-05 希姆通信息技术(上海)有限公司 Wireless data encryption method and wireless data decryption method
CN103825788A (en) * 2014-01-29 2014-05-28 北京睿通慧联科技有限公司 WIFI network configuration method and system
CN104010327A (en) * 2014-06-18 2014-08-27 江勇 Method and system for quickly having access to WIFI wireless network

Also Published As

Publication number Publication date
CN105763516A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
CN103945369B (en) A kind of length by checking WIFI packets realizes the Internet-surfing configuration method of WIFI equipment
CN104469660B (en) Network-building method based on bluetooth
US8285994B2 (en) Two-way authentication between two communication endpoints using a one-way out-of-band (OOB) channel
JP6370985B2 (en) Method, apparatus and system for establishing a connection by a terminal
CN103765847A (en) Apparatus and methods for media access control header compression
JP2004178187A (en) Radio communication authentication device
CN104837132A (en) Wi-Fi (Wireless-Fidelity) network sharing method and device
CN207766561U (en) A kind of system of control terminal and equipment access network
CN106657136B (en) Terminal device, communication method of hidden channel and device thereof
CN108476131A (en) Data transmission method, device and equipment
CN105119900A (en) Information secure transmission method, network access method and corresponding terminals
CN110784865A (en) Network distribution method and terminal of Internet of things equipment, Internet of things equipment and network distribution system
KR20070010048A (en) Method of and system for storage of i-wlan temporary indentities
CN105763516B (en) The method and apparatus that terminal sends data to net external equipment out of WLAN
CN105120454A (en) Information transmission method, network access method and corresponding terminals
CN108430091A (en) A kind of efficient smart home wifi distribution method and apparatus
CN107454591A (en) Ensure the method, apparatus and system of WIFI LAN communication safeties
CN207652705U (en) A kind of system of control terminal and the equipment access network based on wifi Beacon frames
CN105764050B (en) The method and apparatus that terminal sends data to net external equipment out of WLAN
WO2016119624A1 (en) Data transmission method and apparatus thereof
CN105657640A (en) Wireless network access parameter obtaining method and device of intelligent communication devices
CN106060801B (en) Data communication method, device and system based on Wi-Fi device
WO2021147659A1 (en) Wireless communication device and wireless communication method
CN114826591A (en) Cross-device data transmission method, system and terminal
CN106899600A (en) The data processing method and device of water purifier

Legal Events

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