CN116074916A - Flow data processing method, device and system and electronic equipment - Google Patents

Flow data processing method, device and system and electronic equipment Download PDF

Info

Publication number
CN116074916A
CN116074916A CN202211676305.5A CN202211676305A CN116074916A CN 116074916 A CN116074916 A CN 116074916A CN 202211676305 A CN202211676305 A CN 202211676305A CN 116074916 A CN116074916 A CN 116074916A
Authority
CN
China
Prior art keywords
network
flow
data
equipment
network card
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.)
Pending
Application number
CN202211676305.5A
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202211676305.5A priority Critical patent/CN116074916A/en
Publication of CN116074916A publication Critical patent/CN116074916A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/18Communication route or path selection, e.g. power-based or shortest path routing based on predicted events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention provides a flow data processing method, a flow data processing device, a flow data processing system and electronic equipment. The method comprises the following steps: receiving first flow data sent by second equipment through network card equipment; identifying a target flow from the first flow data based on a preset flow processing rule; carrying a preset sending path into the target flow, and sending the target flow to an external network so as to send the target flow according to the sending path through the external network. In the method, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives the flow data sent by the second device, and identifies the target flow from the flow data and controls the sending path of the flow according to the preset flow processing rule, so that the intervention of the application program in the host device on the data flow of the client device is realized, and the function expansion of the client device and the application program is facilitated.

Description

Flow data processing method, device and system and electronic equipment
Technical Field
The present invention relates to the field of computer networks, and in particular, to a method, an apparatus, a system, and an electronic device for processing flow data.
Background
The mobile intelligent equipment capable of networking, such as a mobile phone, a plane computer and the like, can establish a hot spot sharing network, and other network equipment can be connected with the Internet by connecting the hot spot sharing network. Devices that establish a hotspot sharing network are referred to as hosting devices, and devices that connect to the hotspot sharing network are referred to as client devices. After the host device obtains the data traffic sent by the client device through the hotspot sharing network, the host device forwards the data traffic to the Internet through a network interface of the host device. The host device has an operating system running therein, in which various applications can be installed. Because the operating system does not provide relevant interfaces for the application program, the application program cannot acquire the data traffic from the client device, and when the application program is associated with the functions of the client device, the application program cannot process the data traffic of the client device, so that the function realization of the client device and the application program is limited.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, an apparatus, a system and an electronic device for processing traffic data, so as to solve the problem that a host device cannot interfere with traffic data of a client device after the client device is connected to a wireless network shared by the host device.
In a first aspect, an embodiment of the present invention provides a method for processing traffic data, where the method is applied to a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device, and the method comprises the following steps: receiving first flow data sent by second equipment through network card equipment; identifying a target flow from the first flow data based on a preset flow processing rule; carrying a preset sending path into the target flow, and sending the target flow to an external network so as to send the target flow according to the sending path through the external network.
In a second aspect, an embodiment of the present invention provides a device for processing flow data, where the device is disposed in a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device, and the device comprises: the first sending module is used for receiving the first flow data sent by the second equipment through the network card equipment; the first identification module is used for identifying the target flow from the first flow data based on a preset flow processing rule; the second sending module is used for carrying the preset sending path into the target flow, and sending the target flow to the external network so as to send the target flow according to the sending path through the external network.
In a third aspect, an embodiment of the present invention provides a processing system for traffic data, where the system includes a first device, a network card device, and a second device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, and the processor executes the machine executable instructions to implement the method for processing flow data described above.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, and the processor executes the machine executable instructions to implement the method for processing flow data described above.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a flow data processing method, a flow data processing device, a flow data processing system and electronic equipment. The method is applied to a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device, and the method comprises the following steps: receiving first flow data sent by second equipment through network card equipment; identifying a target flow from the first flow data based on a preset flow processing rule; carrying a preset sending path into the target flow, and sending the target flow to an external network so as to send the target flow according to the sending path through the external network. In the method, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives the flow data sent by the second device, and identifies the target flow from the flow data and controls the sending path of the flow according to the preset flow processing rule, so that the intervention of the application program in the host device on the data flow of the client device is realized, and the function expansion of the client device and the application program is facilitated.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a hardware scenario of a method for processing flow data according to an embodiment of the present invention;
FIG. 2 is a flow chart of a flow data processing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a network card device according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of multiparty interaction in a process of establishing communication between a first device and a second device according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of multiparty interaction in a process of completing communication between a first device and a second device according to an embodiment of the present invention;
FIG. 6 is a flowchart of a method for processing flow data according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a flow data conversion manner according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a traffic data transmission manner according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a communication flow provided by an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a flow data processing device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related art, after a client device is connected to a wireless network shared by a host device through a hotspot, due to the limitation of the current mainstream operating system (for example, android or iOS), the operating system running in the host device cannot provide a related interface for an application program, and the traffic data of the client device can only be automatically sent from a default network outlet of the host device to the internet according to the system configuration, so that some application programs associated with the client device cannot contact and interfere with the network traffic of the client device, thereby limiting the function implementation of the client device and the application programs.
Based on this, the method, the device, the system and the electronic device for processing traffic data provided by the embodiments of the present invention may be applied to a scenario in which a client device accesses the internet through a host device when the host device is in communication connection with the client device, for example, when the client device is a host device for a game, the host device may be a terminal device, and the terminal device processes traffic data of the host device.
For the convenience of understanding the present embodiment, first, a hardware scenario of a traffic data processing method disclosed in the present embodiment is described, as shown in fig. 1, where a first device is communicatively connected to an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device, wherein the first device is the host device, the second device is the client device, the external network generally refers to a data communication network outside the wireless network established by the network card device, and the external network is provided with a specified flow data transmission path and a network server.
Then, a detailed description is made of a method for processing flow data disclosed in the embodiment of the present invention, as shown in fig. 2, where the method is applied to a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device. The processing method of the flow data comprises the following steps:
step S202, receiving first flow data sent by second equipment through network card equipment;
the network card is a computer hardware device designed to allow intelligent devices such as mobile phones, tablets, computers and the like to communicate on a computer network, and is divided into a wired network card and a wireless network card, wherein the wireless network card can be divided into a USB (universal serial bus), a PCI (Component Interconnect, peripheral component interconnect standard), a PCI-E (Peripheral Component Interconnect-express, high-speed serial bus) interface and the like according to the interface type of the interface with the intelligent devices. In this embodiment, the network card device may be a USB (Universal Serial BUS ) wireless network card. Here, the USB network card device is designed with different hardware facilities according to the difference of running an operating system in the intelligent device to which it is connected, for example: aiming at the Android operating system, the network card equipment main control chip can use a USB network card chip disclosed in the industry, and the chip can support hot spot network establishment of a 5Ghz frequency band; for the iOS operating system, the USB network card must include an MFi dedicated chip provided by apple. After the network card device is connected with the intelligent device through the network card interface, an operating system of the intelligent device can not only call a corresponding network card driving program to drive the network card to enable the device to be networked, but also enable other intelligent devices to be connected with the Internet through establishing a hot spot in a mode of connecting a hot spot network. In actual implementation, the second device may be a game host device, and the first device has an application program associated with the game host device running therein. After the first equipment is networked through the network card equipment and establishes communication connection between the wireless network and the second equipment, the second equipment can transmit flow data to the first equipment through the wireless network, and the first equipment and a network communication interface of an external network are utilized for transmitting and receiving data flow so as to realize network communication.
In this step, after the first device and the second device implement network communication, the first device may receive, through the network card device, first traffic data sent by the second device, where the first traffic may include: target traffic requiring special handling and normal traffic not requiring special handling.
Step S204, identifying a target flow from the first flow data based on a preset flow processing rule;
the target flow rate is a flow rate marked with specific use and specific information, for example: the game traffic used to accelerate the designated game is marked with the designated traffic destination network address, binding information of domain name and host, etc. The traffic processing rule is a basis for screening the target traffic from the first traffic data, and includes traffic screening information, where the traffic screening information may be a traffic destination network address, binding information between a domain name and a host, and the like.
After receiving the first flow data sent by the second device through the network card device, the first device screens out flow data matching flow screening information in the flow processing rule from the first flow according to a preset flow processing rule, and determines the flow data as a target flow.
In this step, the target flow in the first flow is distinguished from the normal flow according to a preset flow processing rule, which is a precondition for the subsequent special processing of the target flow data.
Step S206, carrying the preset sending path into the target flow, and sending the target flow to the external network so as to send the target flow according to the sending path through the external network.
After screening out the target flow, before the target flow is sent to an external network, the target flow is packaged according to actual requirements, and intervention on the flow data is realized. For example: and designating the network address of the proxy server on the target traffic data carrier, so that the target traffic data can be forwarded to the proxy server to realize network traffic acceleration requirements and the like.
In this step, a preset transmission path is carried into a target flow, and the target flow is transmitted to an external network, so that the target flow is transmitted through the external network according to the transmission path, and it is to be noted that the transmission path is different from a default transmission path of a common flow in the first flow, so that the intervention of the first device on the data flow of the second device is realized.
According to the processing method of the flow data, the first flow data sent by the second equipment is received through the network card equipment; identifying a target flow from the first flow data based on a preset flow processing rule; carrying a preset sending path into the target flow, and sending the target flow to an external network so as to send the target flow according to the sending path through the external network. In the method, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives the flow data sent by the second device, and identifies the target flow from the flow data and controls the sending path of the flow according to the preset flow processing rule, so that the intervention of the application program in the host device on the data flow of the client device is realized, and the function expansion of the client device and the application program is facilitated.
Before the first device intervenes in the traffic data of the second device, the operating system of the first device needs to complete preparation work of establishing the wireless network, communication connection with the second device, and the like.
The following embodiments take a USB network card device as an example, and introduce a specific implementation manner in which the first device establishes a wireless network through the USB network card device.
First, a USB network card device needs to be customized, and the network card device needs to have a unified hardware standard and be configured with a corresponding driver.
In this embodiment, the main control chip of the USB network card device uses the USB network card chip disclosed in the industry to support the establishment of a hotspot network in the 5Ghz band, and if the operating system of the first device is an iOS operating system, the network card also needs to include an MFi dedicated chip provided by apple. In addition, the network card device further has a USB type c male port and a USB type c female port (for the iOS platform, may be a Lightning male port), as shown in fig. 3, where the male port is used to connect to the first device, so that the first device may communicate with the USB network card device, and meanwhile, the first device may also supply power to the USB network card device. The female port is used for connecting an external data line and can supply power for the network card device and the first device simultaneously, and in the scene, the USB type c male port supplies power from the first device to the network card device, and the network card device is changed into the network card device to supply power for the first device. Further, a USB network card driver is obtained, where the network card driver is a special program that enables the intelligent device to communicate with the network card device, and the operating system of the first device can only control the operation of the USB network card device through the special program. When the first device is a mobile intelligent device such as a mobile phone or a notebook computer, only an application program of user mode authority is allowed to run on the mobile device, so that a linux kernel mode driver corresponding to hardware needs to be rewritten into the user mode driver to realize the control operation of the first device on the data flow of the second device. In the mode, the network card equipment is provided with a unified hardware standard and a driver program with authority matched, so that various problems of inconsistent standard, excessively complex software codes and the like caused by hardware fragmentation are avoided.
Further, the operating system of the first device implements hardware initialization and basic hardware communication functions using drivers. For example, according to the hardware initialization and basic hardware communication functions implemented by a USB API (Application Programming Interface, application program interface) provided by a first device operating system platform (such as iOS or Android system platform), it is detected whether a USB network card is connected to the first device and an underlying communication connection is established with the USB network card through the USB API.
Further, after the USB network card device is connected to the first device, the operating system of the first device establishes a wireless network using the USB network card driver. Specifically, detecting that the network card equipment and the first equipment establish communication connection, and acquiring network card information of the network card equipment; wherein, this network card information includes: one or more of hardware version, support function specification, and physical address; based on the network card information, configuring a firmware program for the network card equipment, and initializing a hardware register of the network card equipment; setting a network frequency band and a network encryption mode, broadcasting wireless signals, and obtaining a wireless network.
Specifically, the physical address, i.e., the MAC address, is an access control address of the traffic. Each network card device has a determined hardware version and corresponding support function specifications and physical addresses. When the USB network card device is detected to establish communication connection with the first device, one or more of hardware version, support function specification and MAC address in the network card information of the network card device are acquired,
Further, according to the acquired network card information, the first device operating system uses the user mode driver to configure a firmware program for the network card device, so that the operating system of the first device realizes operation according to the configured firmware program.
Further, the hardware registers of the network card device are initialized, and it can be understood that the related functions of the hardware of the USB network card are controlled by reading and writing the related register values, and different hardware registers are defined differently, so that the hardware registers of the network card device need to be initialized.
Finally, setting a proper frequency band, a network frequency band and a network encryption mode according to the requirement, starting SSID (Service Set Identifier, service set identification) signal broadcasting, and starting a hot spot to obtain a wireless network.
The following examples provide implementations in which a first device establishes a communication connection with a second device.
After the operating system of the first device uses the user mode driver to start the hotspot network, the wireless local area network protocol needs to be continuously realized, so that the client device is supported to connect with the hotspot, and data is transmitted. In this embodiment, the wireless lan protocol is an 802.11 protocol, and the implementation process includes the following steps:
1) The drive code uses USB protocol to read and write USB network card equipment, and the read and written data format is 802.11 packet packaged by hardware drive;
2) According to different USB network card hardware, encrypting and decrypting the drive head to obtain an 802.11 packet;
3) The following settings are made to the first device to cause the second device to discover the hotspot signal:
a. the USB network card device is driven to regularly broadcast a beacon packet, and then the client device can see wifi signals of the first device hotspot network in a wifi list;
b. when the second device actively transmits a probe detection packet (probe is an action or object used to detect the network state in telecommunication terminology), the probe is used to detect information about a wifi signal, for example: signal strength, device name, etc., and the first device driver replies to the detection request after receiving it.
It will be appreciated that when the second device requests to establish a communication connection with the first device, password authentication is required, and the first device confirms that authentication is successful and then establishes a communication connection with the second device. Specifically, receiving a connection verification request sent by a second device through a network card device; wherein the connection verification request comprises an encryption password of the wireless network; verifying the encryption password in the connection verification request, and if the encryption password is verified to be correct, sending a response data packet which is successfully verified to the second device; and receiving a connection request sent by the second equipment, determining that the second equipment meets a preset condition, sending a response message of successful connection to the second equipment, and establishing communication connection corresponding to a preset wireless local area network protocol with the second equipment.
Illustratively, the process includes;
1) When the second device prepares to connect to the wireless network, sending an auth authentication request, wherein auth is a basic user authentication, and the connection authentication request comprises an encryption password of the wireless network;
2) After the first device receives the verification request, the driving code checks whether the password is correct, if the encrypted password is verified to be correct, an auth success response packet is replied to the second device, and if not, connection is refused;
3) After the first equipment is successfully verified, the second equipment sends a connection request to join the wireless network;
4) And receiving a connection request sent by the second equipment, determining whether the second equipment meets a preset condition, replying an allowed passing message after meeting the condition, and establishing communication connection corresponding to an 802.11 protocol between the first equipment and the second equipment until the 802.11 connection is successful, wherein data packets are received and transmitted between the first equipment and the second equipment through the 802.11, so that high-speed transmission of data is realized.
Correspondingly, when the second device prepares to disconnect the wireless network, a disconnection request is sent to request for disconnecting the hot spot notification, and after the first device receives the notification, relevant resources applied for the device before the first device is emptied are recovered to confirm the disconnection request, and the relevant resources are released.
Fig. 4 shows a schematic diagram of multiparty interaction in the whole process of establishing communication between the first device and the second device in this embodiment, where the process is implemented by interaction between the first device and the second device, specifically including the following steps:
step S402, a first device driving code uses a USB protocol to read and write USB network card devices, and the read and written data format is an 802.11 packet packaged by a hardware driver;
step S404, the first equipment encrypts and decrypts the drive head according to different USB network card hardware to obtain an 802.11 packet;
step S406, the first device drives the USB network card device to periodically broadcast a beacon packet, so that the client device can see wifi signals of the first device hotspot network in a wifi list;
step S408, the second device actively transmits a probe detection packet for detecting related information of a wifi signal;
in step S410, the driver of the first device replies to the detection request after receiving the probe detection packet.
Step S412, when the second device prepares to connect to the wireless network, an auth verification 5 request is sent to the first device, wherein the connection verification request comprises an encryption password of the wireless network;
step S414, after the first device receives the verification request, the drive code checks whether the password is correct, if the encrypted password is verified to be correct, the second device is replied with an auth success response packet, otherwise, the connection is refused;
Step S416, after the first equipment is successfully verified, the second equipment sends a connection request to join the wireless network;
step S418, receiving the connection request sent by the second device, and determining whether the second device meets the pre-set
And setting a condition, and replying to allow the message to pass after the condition is met.
Up to this, 802.11 connection is successful, and the first equipment establishes the communication connection that 802.11 protocol corresponds with the second equipment, and data package is received and sent through 802.11 between first equipment and the second equipment, realizes the high-speed transmission of data.
And 5, in the interaction process of the first equipment and the second equipment, the first equipment drives the USB network card equipment by using a driving program of the USB network card equipment, so that a transmitting hot spot is realized, communication connection is established with the second equipment, and a foundation is laid for subsequently controlling the data flow of the second equipment.
After the first device and the second device establish a communication connection corresponding to a preset wireless local area network protocol, 0, for connectivity of communication between the two devices, the first device needs to allocate various network parameters to the connected second device, and specifically needs to perform the following settings:
1) Realizing a virtual gateway;
it will be appreciated that the second device needs to be connected to the network and a gateway device, for example, the driver of the first device may be configured as a network address (IP address) of the gateway, for example 5.192.168.0.1.
2) Realizing the network protocol of the local area network, and distributing network addresses for the second equipment:
specifically, a network card device receives a discovery message of a local area network protocol sent by a second device; determining the number of devices connected by the first device through a wireless network; if the number of the devices is less than the preset number threshold, a reply message of the normal message is sent to the second device; the reply message includes: a network address assigned to the second device and a gateway address of the first device; and receiving a use request of the network address sent by the second equipment, determining whether the use request is legal, and if the use request is legal, determining that the network address allocation is successful.
In this embodiment, the lan protocol is a DHCP lan protocol, and when the second device is successfully connected to the first device through the lan protocol, a discovery packet is sent, for example: the dhcp discover packet is intended to dynamically apply for an IP address. After the first device receives the discovery message through the USB network card virtual gateway, the number of devices connected by the first device through the wireless network is checked.
In one case, if the first device finds that the current connected devices are less than the preset number threshold, the first device directly sends a reply message, for example: the dhcp offer packet includes the network address to be allocated to the second device and the IP address of the gateway. The second device checks whether the second device is used after receiving the dhcp offer data packet, and after selecting the use, the second device needs to send a dhcp request message to the virtual gateway to request to use the IP address. The USB network card virtual gateway of the first device checks whether the data packet of the dhcp request is legal or not after receiving the data packet of the dhcp request, if the use request is legal, the device can reply to the dhcp ack message, and the second device can confirm that the IP address and other information allocated to the device can be allowed to be used only after receiving the reply message. So far, the IP address assignment is successful, and the second device obtains the network address.
In another case, if the first device finds that the number of the currently connected devices is greater than or equal to the preset number threshold, the discovery message of the local area network protocol sent by the second device is ignored.
3) Transmitting the MAC address of the virtual gateway to the second device;
specifically, receiving an address inquiry request sent by the second device; generating a reply message of the address inquiry request, and sending the reply message to the second device; wherein the reply message includes the physical address of the second device.
Here, the second device needs to forward the IP address transmission request through the virtual gateway of the first device, so it is also necessary to know the physical address of the virtual gateway IP address of the first device. When the first device sends an address query request, for example: when the first device receives the arp request through the USB network card device and inquires the arp address of the virtual gateway, the first device constructs an arp response message to reply and inform the MAC address of the virtual gateway. When the second device knows the MAC address of the gateway, normal communication can be constructed.
Fig. 5 shows a schematic diagram of multiparty interaction in a process of perfecting communication between a first device and a second device in this embodiment, where the process is implemented by interaction between the first device and the second device, specifically including the following steps:
Step S502, the driver of the first device is configured as the network address of the gateway;
step S504, after the second device is successfully connected with the first device through the local area network protocol, a discovery message is sent;
step S506, after the first device receives the discovery message through the USB network card virtual gateway, checking the number of devices connected by the first device through the wireless network; if the number of the devices is greater than or equal to a preset number threshold, not processing the discovery message.
Step S508, if the number of devices is less than the preset number threshold, a reply message of the normal message is sent to the second device, where the reply message includes: a network address assigned to the second device and a gateway address of the first device;
step S510, the second device checks whether to use after receiving the reply message, and if the second device selects to use, the second device sends a request for using the network address to the virtual gateway of the first device;
step S512, the first device receives the use request of the network address sent by the second device, determines whether the use request is legal, and if the use request is legal, determines that the network address allocation is successful;
step S514, the second equipment sends an address inquiry request;
step S516, after receiving the address inquiry request through the USB network card device, the first device generates a reply message of the address inquiry request, and sends the reply message to the second device to inform the MAC address of the virtual gateway;
And step S518, after the second equipment receives the MAC address of the gateway, constructing normal communication of the wireless local area network protocol.
In the interaction process of the first device and the second device, the first device realizes a three-layer virtual gateway by using a driving program of the USB network card device, realizes an ARP/DHCP basic protocol, distributes various network parameters for the connected second device, and ensures the most basic connectivity.
After the operating system of the first device establishes a wireless network through the network card driver and ensures basic communication connectivity with the second device, the operating system starts to intervene in the data flow of the second device. In one embodiment, as shown in fig. 6, a specific flow of a method for processing flow data provided in the embodiment of the present application is described by taking a USB network card device as an example.
Step S602, receiving first flow data sent by a second device through network card equipment;
the step is the same as step S202, and thus will not be described in detail.
Step S604, obtaining the common flow except the target flow from the first flow data; the common traffic is sent to an external network, so that the common traffic is sent through the external network according to a default path; wherein the default path is different from the transmit path;
The normal traffic is traffic which does not need special processing, the traffic does not pass through information marks such as a destination network address, the normal traffic is sent to an external network, and the traffic is sent to an original destination of the traffic according to a default path through a default network outlet (for example, wi-Fi/5G/4G network) of the first device, wherein the default path is different from a sending path of the target traffic.
Step S606, the flow processing rule comprises flow screening information; the traffic screening information comprises a destination network address or binding information of a domain name and a host; screening target flow matched with the flow screening information from the first flow data;
the traffic processing rule is a traffic processing rule which is received in advance through an external network and issued by a preset network server. The first device receives a flow processing rule issued by a preset network server through an external network. The traffic handling rules include traffic screening information including destination network addresses, or binding information of domain names and hosts. For example: the binding information of the specified destination IP address or domain name and the host machine can be issued based on a specified cloud network game server of the developer. And screening the target flow matched with the first flow data according to the flow screening information.
It should be noted that, the target traffic is traffic of the transport layer, that is, before the target traffic is identified, the first traffic data needs to be converted, specifically, the first traffic data is converted into a first data packet corresponding to a preset wireless lan protocol; converting the first data packet into a second data packet corresponding to a preset internet protocol; and converting the second data packet into a transport layer data packet, and determining the transport layer data packet as the converted target traffic.
In one embodiment, the wlan protocol is an 802.11 protocol, and the above traffic data conversion manner is shown in fig. 7, namely:
1) Reading an original data packet of the USB network card device acquired by the driver, and converting the original data packet into an 802.11 format packet;
2) Converting the read 802.11 format packet into an IP packet;
3) The IP packets are converted into transport layer packets (TCP/UDP/ICMP).
Step 608, encapsulating the target flow through a preset protocol to obtain an encapsulated target flow; the encapsulated target flow carries a network address of a preset proxy server; based on a network address of a preset proxy server, the target traffic is sent to the proxy server so as to be sent to a final address through the proxy server.
That is, the target traffic needs to be encapsulated according to the protocol, the encapsulated target traffic carries the network address of the preset proxy server, the target traffic is sent to the proxy server according to the network address of the preset proxy server, and then the target traffic is sent to the final address through the proxy server. In one embodiment, as shown in fig. 8, taking the target traffic as the game traffic for acceleration as an example, for the game traffic that needs acceleration, after the game traffic is encapsulated by the own protocol, the game traffic is sent to the own proxy server for forwarding, where the game traffic is sent by using the default network outlet of the mobile intelligent device, and only the destination of the traffic is not the original destination but the own proxy server. After receiving the game flow, the proxy server unpacks according to own protocol to obtain the original flow and the original destination, and then sends the flow to the original destination of the flow.
In the mode, the functions of client equipment network flow and the like are processed by using the driving program of the USB equipment in the first equipment, so that the complete control of the client equipment network flow is realized, and the directional forwarding of part of client equipment network flow is further realized.
Step S610, receiving second traffic data from an external network; encapsulating preset protocol header data for the second traffic data to obtain encapsulated data, and transmitting the encapsulated data to second equipment through network card equipment; wherein the protocol header data includes: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data.
That is, after the first device receives the second traffic data returned from the external network, the first device performs a protocol header encapsulation on the second traffic, including: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data. For example, the second traffic data is sequentially added with the transport layer header/the IP header/the 802.11 header, written back into the USB network card device through USB communication, and the second traffic data is all sent back to the second device, so as to complete the internet communication flow of the second device.
As shown in fig. 9, the flow of the internet communication flow of the second device is shown in the flow of the network data: and the common flow and the target flow are screened out from the second equipment to the USB network card hardware and then to the driving software of the first equipment, data transmission and reception are carried out through each path in the external network, and finally the data are reversely transmitted back to the USB network card equipment, and finally the data are returned to the second equipment.
In the method for processing the flow data, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the flow data sent by the second device is received by the network card device, the target flow is identified from the flow data according to the preset flow processing rule and is sent to the external network, so that the intervention of the data flow of the second device is realized, and the function realization of the application programs in the second device and the first device is promoted.
It should be noted that, in this solution, the function of controlling the flow rate and speed may also be performed according to different application scenarios of the first device.
Specifically, if the related flow data of the second device is received, controlling the related flow data to be sent based on a preset flow speed threshold; wherein the related traffic data comprises: the first traffic data transmitted by the second device or the second traffic data from the external network.
It can be understood that the traffic data is processed by the application program on the first device, so that the speed of the traffic of the second device can be controlled by controlling the related traffic data transmission through the preset traffic speed threshold value only in the logic of the application program, for example, the playing speed or the downloading speed of the game naturally drops to zero when the first traffic data transmitted to the second device or the second traffic data from the external network is suspended in the logic of the application program during the game playing process.
In the mode, according to different application scenes of the first equipment, the function of controlling the flow speed is achieved, and the power consumption of the USB network card is dynamically adjusted according to the requirement.
In addition, the scheme is also provided with a mechanism for detecting and avoiding the first equipment from being connected with the USB network card hot spot of the first equipment through WiFi, so that the traffic circulation deadlock is prevented.
Corresponding to the above method embodiment, referring to fig. 10, a schematic diagram of a flow data processing apparatus is shown, where the apparatus includes:
a first sending module 1002, configured to receive, by using a network card device, first traffic data sent by a second device;
a first identifying module 1004, configured to identify a target flow from the first flow data based on a preset flow processing rule;
the second sending module 1006 is configured to carry a preset sending path to the target traffic, send the target traffic to the external network, and send the target traffic according to the sending path through the external network.
In the mode, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives flow data sent by the second device, and identifies target flow from the flow data according to a preset flow processing rule and sends the target flow to an external network, so that intervention on the data flow of the second device is realized, and function realization of application programs in the second device and the first device is promoted.
The wireless network is established by the following modes: detecting that the network card equipment and the first equipment establish communication connection, and acquiring network card information of the network card equipment; wherein, the network card information includes: one or more of hardware version, support function specification, and physical address; based on the network card information, configuring a firmware program for the network card equipment, and initializing a hardware register of the network card equipment; setting a network frequency band and a network encryption mode, broadcasting wireless signals, and obtaining a wireless network.
The first device establishes communication connection with the second device by the following method: receiving a connection verification request sent by a second device through network card equipment; wherein the connection verification request comprises an encryption password of the wireless network; verifying the encryption password in the connection verification request, and if the encryption password is verified to be correct, sending a response data packet which is successfully verified to the second device; and receiving a connection request sent by the second equipment, determining that the second equipment meets a preset condition, sending a response message of successful connection to the second equipment, and establishing communication connection corresponding to a preset wireless local area network protocol with the second equipment.
The device also comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for receiving a discovery message of a local area network protocol sent by the second device through the network card device; determining the number of devices connected by the first device through a wireless network; if the number of the devices is less than the preset number threshold, a reply message of the normal message is sent to the second device; the reply message includes: a network address assigned to the second device and a gateway address of the first device; and receiving a use request of the network address sent by the second equipment, determining whether the use request is legal, and if the use request is legal, determining that the network address allocation is successful.
The device also comprises a third sending module, a second sending module and a third sending module, wherein the third sending module is used for receiving an address inquiry request sent by the second equipment; generating a reply message of the address inquiry request, and sending the reply message to the second device; wherein the reply message includes the physical address of the second device.
The method further comprises the following steps: if the number of the devices is greater than or equal to a preset number threshold, not processing the discovery message.
The device also comprises a first issuing module, which is used for receiving the flow processing rule issued by the preset network server through the external network.
The device also comprises a second determining module, a second determining module and a first determining module, wherein the second determining module is used for converting the first flow data into a first data packet corresponding to a preset wireless local area network protocol; converting the first data packet into a second data packet corresponding to a preset internet protocol; and converting the second data packet into a transport layer data packet, and determining the transport layer data packet as the converted target traffic.
The flow processing rule comprises flow screening information; the flow screening information comprises a destination network address or binding information of a domain name and a host; the first identification module is further configured to screen a target flow matched with the flow screening information from the first flow data.
The second sending module is further configured to perform encapsulation processing on the target traffic through a preset protocol, so as to obtain an encapsulated target traffic; the encapsulated target flow carries a network address of a preset proxy server; based on a network address of a preset proxy server, the target traffic is sent to the proxy server so as to be sent to a final address through the proxy server.
The device also comprises a fourth sending module, a second sending module and a third sending module, wherein the fourth sending module is used for obtaining common flow except the target flow from the first flow data; the common traffic is sent to an external network, so that the common traffic is sent through the external network according to a default path; wherein the default path is different from the transmit path.
The apparatus further comprises a fifth transmitting module for receiving second traffic data from the external network; encapsulating preset protocol header data for the second traffic data to obtain encapsulated data, and transmitting the encapsulated data to the second device through the network card device; wherein the protocol header data includes: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data.
The device further comprises a sixth sending module, configured to control sending of the related traffic data based on a preset traffic speed threshold if the related traffic data of the second device is received; wherein the related traffic data comprises: the first traffic data transmitted by the second device or the second traffic data from the external network.
The second device includes: a game host device; the first device has an application program running therein that is associated with the game host device.
The embodiment also provides a processing system of the flow data, which comprises a first device, a network card device and a second device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through a wireless network established by the network card device.
The embodiment also provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for processing flow data. The electronic device may be a server or a terminal device.
Referring to fig. 11, the electronic device includes a processor 100 and a memory 101, the memory 101 storing machine executable instructions that can be executed by the processor 100, the processor 100 executing the machine executable instructions to implement the above-described flow data processing method.
Further, the electronic device shown in fig. 11 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102. The memory 101 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is implemented via at least one communication interface 103 (which may be wired or wireless), and may use the internet, a wide area network, a local network, a metropolitan area network, etc. Bus 102 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 11, but not only one bus or type of bus. The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 100 or by instructions in the form of software. The processor 100 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and, in combination with its hardware, performs the steps of the method of the previous embodiment.
In the mode, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives flow data sent by the second device, and identifies target flow from the flow data according to a preset flow processing rule and sends the target flow to an external network, so that intervention on the data flow of the second device is realized, and function realization of application programs in the second device and the first device is promoted.
The wireless network is established by the following modes: detecting that the network card equipment and the first equipment establish communication connection, and acquiring network card information of the network card equipment; wherein, the network card information includes: one or more of hardware version, support function specification, and physical address; based on the network card information, configuring a firmware program for the network card equipment, and initializing a hardware register of the network card equipment; setting a network frequency band and a network encryption mode, broadcasting wireless signals, and obtaining a wireless network.
The first device establishes communication connection with the second device by the following method: receiving a connection verification request sent by a second device through network card equipment; wherein the connection verification request comprises an encryption password of the wireless network; verifying the encryption password in the connection verification request, and if the encryption password is verified to be correct, sending a response data packet which is successfully verified to the second device; and receiving a connection request sent by the second equipment, determining that the second equipment meets a preset condition, sending a response message of successful connection to the second equipment, and establishing communication connection corresponding to a preset wireless local area network protocol with the second equipment.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: receiving a discovery message of a local area network protocol sent by a second device through network card equipment; determining the number of devices connected by the first device through a wireless network; if the number of the devices is less than the preset number threshold, a reply message of the normal message is sent to the second device; the reply message includes: a network address assigned to the second device and a gateway address of the first device; and receiving a use request of the network address sent by the second equipment, determining whether the use request is legal, and if the use request is legal, determining that the network address allocation is successful.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: receiving an address inquiry request sent by second equipment; generating a reply message of the address inquiry request, and sending the reply message to the second device; wherein the reply message includes the physical address of the second device.
The method further comprises the following steps: if the number of the devices is greater than or equal to a preset number threshold, not processing the discovery message.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: and receiving a flow processing rule issued by a preset network server through the external network.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: converting the first flow data into a first data packet corresponding to a preset wireless local area network protocol; converting the first data packet into a second data packet corresponding to a preset internet protocol; and converting the second data packet into a transport layer data packet, and determining the transport layer data packet as the converted target traffic.
The flow processing rule comprises flow screening information; the flow screening information comprises a destination network address or binding information of a domain name and a host; the processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: and screening the target flow matched with the flow screening information from the first flow data.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: the target flow is packaged through a preset protocol, and the packaged target flow is obtained; the encapsulated target flow carries a network address of a preset proxy server; based on a network address of a preset proxy server, the target traffic is sent to the proxy server so as to be sent to a final address through the proxy server.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: acquiring common flow except the target flow from the first flow data; the common traffic is sent to an external network, so that the common traffic is sent through the external network according to a default path; wherein the default path is different from the transmit path.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: receiving second traffic data from said external network; encapsulating preset protocol header data for the second traffic data to obtain encapsulated data, and transmitting the encapsulated data to the second device through the network card device; wherein the protocol header data includes: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data.
The processor in the electronic device may implement the following operations of the flow data processing method by executing machine executable instructions: if the related flow data of the second equipment are received, controlling the related flow data to be sent based on a preset flow speed threshold; wherein the related traffic data comprises: the first traffic data transmitted by the second device or the second traffic data from the external network.
The second device includes: a game host device; the first device has an application program running therein that is associated with the game host device.
The present embodiment also provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described method of processing traffic data.
In the mode, after the first device is in communication connection with the second device according to the wireless network established by the network card device, the network card device receives flow data sent by the second device, and identifies target flow from the flow data according to a preset flow processing rule and sends the target flow to an external network, so that intervention on the data flow of the second device is realized, and function realization of application programs in the second device and the first device is promoted.
The wireless network is established by the following modes: detecting that the network card equipment and the first equipment establish communication connection, and acquiring network card information of the network card equipment; wherein, the network card information includes: one or more of hardware version, support function specification, and physical address; based on the network card information, configuring a firmware program for the network card equipment, and initializing a hardware register of the network card equipment; setting a network frequency band and a network encryption mode, broadcasting wireless signals, and obtaining a wireless network.
The first device establishes communication connection with the second device by the following method: receiving a connection verification request sent by a second device through network card equipment; wherein the connection verification request comprises an encryption password of the wireless network; verifying the encryption password in the connection verification request, and if the encryption password is verified to be correct, sending a response data packet which is successfully verified to the second device; and receiving a connection request sent by the second equipment, determining that the second equipment meets a preset condition, sending a response message of successful connection to the second equipment, and establishing communication connection corresponding to a preset wireless local area network protocol with the second equipment.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: receiving a discovery message of a local area network protocol sent by a second device through network card equipment; determining the number of devices connected by the first device through a wireless network; if the number of the devices is less than the preset number threshold, a reply message of the normal message is sent to the second device; the reply message includes: a network address assigned to the second device and a gateway address of the first device; and receiving a use request of the network address sent by the second equipment, determining whether the use request is legal, and if the use request is legal, determining that the network address allocation is successful.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: receiving an address inquiry request sent by second equipment; generating a reply message of the address inquiry request, and sending the reply message to the second device; wherein the reply message includes the physical address of the second device.
The method further comprises the following steps: if the number of the devices is greater than or equal to a preset number threshold, not processing the discovery message.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: and receiving a flow processing rule issued by a preset network server through the external network.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: converting the first flow data into a first data packet corresponding to a preset wireless local area network protocol; converting the first data packet into a second data packet corresponding to a preset internet protocol; and converting the second data packet into a transport layer data packet, and determining the transport layer data packet as the converted target traffic.
The flow processing rule comprises flow screening information; the flow screening information comprises a destination network address or binding information of a domain name and a host; the machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: and screening the target flow matched with the flow screening information from the first flow data.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: the target flow is packaged through a preset protocol, and the packaged target flow is obtained; the encapsulated target flow carries a network address of a preset proxy server; based on a network address of a preset proxy server, the target traffic is sent to the proxy server so as to be sent to a final address through the proxy server.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: acquiring common flow except the target flow from the first flow data; the common traffic is sent to an external network, so that the common traffic is sent through the external network according to a default path; wherein the default path is different from the transmit path.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: receiving second traffic data from said external network; encapsulating preset protocol header data for the second traffic data to obtain encapsulated data, and transmitting the encapsulated data to the second device through the network card device; wherein the protocol header data includes: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data.
The machine-executable instructions stored in the machine-readable storage medium may implement the following operations in the method for processing flow data by executing the machine-executable instructions: if the related flow data of the second equipment are received, controlling the related flow data to be sent based on a preset flow speed threshold; wherein the related traffic data comprises: the first traffic data transmitted by the second device or the second traffic data from the external network.
The second device includes: a game host device; the first device has an application program running therein that is associated with the game host device.
The method, the device, the system and the computer program product of the electronic device for processing flow data provided by the embodiments of the present invention include a computer readable storage medium storing program codes, and instructions included in the program codes may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment and will not be repeated herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In addition, in the description of embodiments of the present invention, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood by those skilled in the art in specific cases.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention for illustrating the technical solution of the present invention, but not for limiting the scope of the present invention, and although the present invention has been described in detail with reference to the foregoing examples, it will be understood by those skilled in the art that the present invention is not limited thereto: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (18)

1. A method for processing traffic data, wherein the method is applied to a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with a second device through the wireless network established by the network card device, and the method comprises the following steps:
Receiving first flow data sent by the second device through the network card device;
identifying a target flow from the first flow data based on a preset flow processing rule;
carrying a preset sending path into the target flow, and sending the target flow to the external network so as to send the target flow according to the sending path through the external network.
2. The method of claim 1, wherein the wireless network is established by:
detecting that the network card equipment and the first equipment establish communication connection, and acquiring network card information of the network card equipment; wherein, the network card information includes: one or more of hardware version, support function specification, and physical address;
based on the network card information, configuring a firmware program for the network card equipment, and initializing a hardware register of the network card equipment;
setting a network frequency band and a network encryption mode, broadcasting wireless signals, and obtaining the wireless network.
3. The method of claim 1, wherein the first device establishes a communication connection with the second device by:
Receiving a connection verification request sent by the second device through the network card device; wherein the connection verification request comprises an encryption password of the wireless network;
verifying the encryption password in the connection verification request, and if the encryption password is verified to be correct, sending a response data packet which is successfully verified to the second equipment;
and receiving a connection request sent by the second equipment, determining that the second equipment meets a preset condition, sending a response message of successful connection to the second equipment, and establishing communication connection corresponding to a preset wireless local area network protocol with the second equipment.
4. A method according to claim 3, wherein after the step of establishing a communication connection corresponding to a predetermined wireless local area network protocol with the second device, the method further comprises:
receiving a discovery message of a local area network protocol sent by the second equipment through the network card equipment;
determining the number of devices connected by the first device through the wireless network;
if the number of the devices is less than a preset number threshold, sending a reply message of the normal message to the second device; the reply message includes: a network address assigned to the second device and a gateway address of the first device;
And receiving a use request of the network address sent by the second equipment, determining whether the use request is legal, and if the use request is legal, determining that the network address allocation is successful.
5. The method of claim 4, wherein after the step of determining that the network address assignment was successful if the use request is legitimate, the method further comprises:
receiving an address inquiry request sent by the second equipment;
generating a reply message of the address inquiry request, and sending the reply message to the second device; wherein the reply message includes a physical address of the second device.
6. The method according to claim 4, wherein the method further comprises: and if the number of the devices is greater than or equal to a preset number threshold, not processing the discovery message.
7. The method of claim 1, wherein prior to the step of identifying a target flow from the first flow data based on a preset flow processing rule, the method comprises: and receiving the flow processing rule issued by a preset network server through the external network.
8. The method of claim 1, wherein prior to the step of identifying a target flow from the first flow data based on a preset flow processing rule, the method further comprises:
converting the first flow data into a first data packet corresponding to a preset wireless local area network protocol;
converting the first data packet into a second data packet corresponding to a preset internet protocol;
and converting the second data packet into a transport layer data packet, and determining the transport layer data packet as the converted target flow.
9. The method of claim 1, wherein the traffic processing rules include traffic screening information; the flow screening information comprises a destination network address or binding information of a domain name and a host;
the step of identifying a target flow from the first flow data based on a preset flow processing rule includes: and screening the target flow matched with the flow screening information from the first flow data.
10. The method of claim 1, wherein the step of carrying a preset transmission path into the target traffic, and transmitting the target traffic to the external network to transmit the target traffic through the external network according to the transmission path, comprises:
Packaging the target flow through a preset protocol to obtain the packaged target flow; the encapsulated target flow carries a network address of a preset proxy server;
and transmitting the target traffic to the proxy server based on the network address of the preset proxy server so as to transmit the target traffic to a final address through the proxy server.
11. The method of claim 1, wherein after the step of receiving, by the network card device, the first traffic data sent by the second device, the method further comprises:
acquiring common flow except the target flow from the first flow data;
the common traffic is sent to the external network, so that the common traffic is sent through the external network according to a default path; wherein the default path is different from the transmission path.
12. The method according to claim 1, wherein the method further comprises:
receiving second traffic data from the external network;
encapsulating the preset protocol header data of the second traffic data to obtain encapsulated data, and transmitting the encapsulated data to the second device through the network card device; wherein the protocol header data includes: transport layer protocol header data, internet protocol header data, and wireless local area network protocol header data.
13. The method according to claim 1, wherein the method further comprises:
if the related flow data of the second equipment are received, controlling the related flow data to be sent based on a preset flow speed threshold; wherein the related traffic data comprises: the first traffic data sent by the second device or the second traffic data from the external network.
14. The method of claim 1, wherein the second device comprises: a game host device; the first device has an application program running therein that is associated with the game host device.
15. A processing device for flow data, characterized in that the device is arranged on a first device; the first device is in communication connection with an external network; the first device is also connected with network card equipment; the network card equipment is used for establishing a wireless network; the first device is in communication connection with a second device through the wireless network established by the network card device, and the apparatus comprises:
the first sending module is used for receiving the first flow data sent by the second equipment through the network card equipment;
the first identification module is used for identifying target flow from the first flow data based on a preset flow processing rule;
And the second sending module is used for carrying a preset sending path into the target flow, and sending the target flow to the external network so as to send the target flow according to the sending path through the external network.
16. The flow data processing system is characterized by comprising a first device, a network card device and a second device;
the first device is in communication connection with an external network; the first device is also connected with the network card device; the network card equipment is used for establishing a wireless network; the first device is in communication connection with the second device through the wireless network established by the network card device.
17. An electronic device comprising a processor and a memory, the memory storing machine-executable instructions executable by the processor to perform the method of processing traffic data according to any one of claims 1-14.
18. A machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement a method of processing traffic data according to any one of claims 1 to 14.
CN202211676305.5A 2022-12-26 2022-12-26 Flow data processing method, device and system and electronic equipment Pending CN116074916A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211676305.5A CN116074916A (en) 2022-12-26 2022-12-26 Flow data processing method, device and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211676305.5A CN116074916A (en) 2022-12-26 2022-12-26 Flow data processing method, device and system and electronic equipment

Publications (1)

Publication Number Publication Date
CN116074916A true CN116074916A (en) 2023-05-05

Family

ID=86172577

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211676305.5A Pending CN116074916A (en) 2022-12-26 2022-12-26 Flow data processing method, device and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN116074916A (en)

Similar Documents

Publication Publication Date Title
US11838203B2 (en) Multipath data transmission method and device
US12021823B2 (en) Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
US11582230B2 (en) Dynamic MAC address change mechanism for wireless communications
KR101376829B1 (en) Methods and apparatuses for ip address allocation
JP5421394B2 (en) Multi-layer wireless home mesh network authentication
JP2012517737A (en) Wireless home mesh network bridge adapter
US20210204202A1 (en) Network access technology indication
US9370031B2 (en) Wireless network setup and configuration distribution system
CN112272958A (en) Network address policy information received in pre-association state
WO2018157551A1 (en) Data transmission method and apparatus
CN110086839B (en) Dynamic access method and device for remote equipment
CN116963054B (en) WLAN multilink TDLS key derivation
CN111669309A (en) VxLAN establishing method, wireless controller and switch
CN116074916A (en) Flow data processing method, device and system and electronic equipment
CN108307683B (en) Communication method, micro base station controller, terminal and system
WO2024139145A1 (en) Method, apparatus and system for processing traffic data, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination