Data processing method, device and relay equipment

By merging and processing the data packets of the relay device and processing the mode-based processing, the problem of slow data processing speed of the relay device is solved, and a more efficient data processing speed is achieved.

CN115174473BActive Publication Date: 2025-03-14SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210948373.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2025-03-14
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

The relay device is slow to process data, mainly because it processes it every time it receives, resulting in inefficiency.

Method used

By acquiring the working mode of the relay device, a plurality of data packets to be processed are obtained, and a combined process is performed based on the address information of these data packets to form one or more second data packets. These merged packets are then processed according to the working mode.

Benefits of technology

This method can process multiple packets at once instead of processing every time a packet is received, significantly improving the speed of data processing by the relay device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115174473B_ABST
    Figure CN115174473B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, device and relay device. The method includes: obtaining the working mode of the relay device, the working mode includes a transparent transmission mode and a routing mode; according to the working mode, obtaining multiple first data packets to be processed; according to the address information of the multiple first data packets, merging and processing the multiple first data packets to obtain at least one second data packet, the second data packet includes at least one first data packet; processing the at least one second data packet according to the working mode. The speed of the relay device processing data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a data processing method, apparatus, and relay device. Background Art

[0002] During data transmission, the relay device may be used to process the data so that the data is sent from the terminal device to the core network or from the core network to the terminal device.

[0003] In the related art, data can be processed in the following manner: a relay device receives a transmitted data packet and processes the data packet. According to the processing result, the data packet is sent to a terminal device or a core network. In the above process, since each received data packet is processed, the relay device processes data at a relatively slow speed. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus and relay device, which are used to solve the problem that the relay device processes data slowly.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a relay device, and the method includes:

[0006] Acquire the working mode of the relay device, where the working mode includes a transparent transmission mode and a routing mode;

[0007] According to the working mode, obtaining a plurality of first data packets to be processed;

[0008] Merge the plurality of first data packets according to address information of the plurality of first data packets to obtain at least one second data packet, wherein the second data packet includes at least one first data packet;

[0009] The at least one second data packet is processed according to the working mode.

[0010] In a possible implementation, merging the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet includes:

[0011] According to the address information of the plurality of first data packets, the plurality of first data packets are grouped to obtain at least one data packet group, wherein the address information of the first data packets in one of the data packet groups is the same;

[0012] The address information in the at least one data packet group is merged respectively to obtain the at least one second data packet.

[0013] In a possible implementation manner, for any second data packet, processing the second data packet according to the working mode includes:

[0014] If the working mode is the transparent transmission mode, obtaining a transmission protocol of the second data packet, and processing the second data packet according to the transmission protocol;

[0015] If the working mode is the routing mode, routing preprocessing is performed on the second data packet, and the second data packet is forwarded.

[0016] In a possible implementation, processing the second data packet according to the transmission protocol includes:

[0017] If the transmission protocol is a local area network protocol, storing the second data packet in a protocol stack;

[0018] If the transmission protocol is not the local area network protocol, forwarding processing is performed on the second data packet according to the destination address of the second data packet.

[0019] In a possible implementation manner, performing routing preprocessing on the second data packet includes:

[0020] Acquire a data type of the second data packet, the data type comprising: from a public network to a private network, and from a private network to a public network;

[0021] Perform routing preprocessing on the second data packet according to the data type.

[0022] In a possible implementation, performing routing preprocessing on the second data packet according to the data type includes:

[0023] If the data type is from a public network to a private network, performing routing preprocessing on each first data packet in the second data packet;

[0024] If the data type is from a private network to a public network, routing preprocessing is performed on the first first data in the second data packet.

[0025] In a possible implementation, the routing preprocessing includes at least one of the following: protocol stack Internet Protocol IP header parsing, firewall filtering, searching a network address translation NAT table, searching a routing table, and searching an address resolution protocol ARP table.

[0026] In a possible implementation, obtaining a plurality of first data packets to be processed according to the working mode includes:

[0027] If the working mode is the transparent transmission mode, obtaining the plurality of first data packets in the buffer area;

[0028] If the working mode is the routing mode, the multiple first data packets are obtained from a sub-buffer in the buffer, and the buffer includes multiple sub-buffers.

[0029] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0030] A first acquisition module is used to acquire the working mode of the relay device, where the working mode includes a transparent transmission mode and a routing mode;

[0031] A second acquisition module, used for acquiring a plurality of first data packets to be processed according to the working mode;

[0032] A first processing module, configured to merge the plurality of first data packets according to address information of the plurality of first data packets to obtain at least one second data packet, wherein the second data packet includes at least one first data packet;

[0033] The second processing module is used to process the at least one second data packet according to the working mode.

[0034] In a possible implementation manner, the first processing module is specifically configured to:

[0035] According to the address information of the plurality of first data packets, the plurality of first data packets are grouped to obtain at least one data packet group, wherein the address information of the first data packets in one of the data packet groups is the same;

[0036] The address information in the at least one data packet group is merged respectively to obtain the at least one second data packet.

[0037] In a possible implementation manner, the second processing module is specifically configured to:

[0038] If the working mode is the transparent transmission mode, obtaining a transmission protocol of the second data packet, and processing the second data packet according to the transmission protocol;

[0039] If the working mode is the routing mode, routing preprocessing is performed on the second data packet, and the second data packet is forwarded.

[0040] In a possible implementation manner, the second processing module is specifically configured to:

[0041] If the transmission protocol is a local area network protocol, storing the second data packet in a protocol stack;

[0042] If the transmission protocol is not the local area network protocol, forwarding processing is performed on the second data packet according to the destination address of the second data packet.

[0043] In a possible implementation manner, the second processing module is specifically configured to:

[0044] Acquire a data type of the second data packet, the data type comprising: from a public network to a private network, and from a private network to a public network;

[0045] Perform routing preprocessing on the second data packet according to the data type.

[0046] In a possible implementation manner, the second processing module is specifically configured to:

[0047] If the data type is from a public network to a private network, performing routing preprocessing on each first data packet in the second data packet;

[0048] If the data type is from a private network to a public network, routing preprocessing is performed on the first first data in the second data packet.

[0049] In a possible implementation, the routing preprocessing includes at least one of the following: protocol stack Internet Protocol IP header parsing, firewall filtering, searching a network address translation NAT table, searching a routing table, and searching an address resolution protocol ARP table.

[0050] In a possible implementation manner, the second acquisition module is specifically configured to:

[0051] If the working mode is the transparent transmission mode, obtaining the plurality of first data packets in the buffer area;

[0052] If the working mode is the routing mode, the multiple first data packets are obtained from a sub-buffer in the buffer, and the buffer includes multiple sub-buffers.

[0053] In a third aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the method as described in any one of the first aspects is implemented.

[0054] In a fourth aspect, the present application provides a chip module having a computer program stored thereon, and when the computer program is executed by the chip module, the method as described in any one of the first aspects is implemented.

[0055] In a fifth aspect, an embodiment of the present application provides a relay device, including:

[0056] at least one processor; and

[0057] a memory communicatively connected to the at least one processor; wherein,

[0058] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any method described in the first aspect.

[0059] In a sixth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the methods in the first aspect.

[0060] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0061] The data processing method, device and relay device provided by the embodiment of the present application can merge and process multiple data packets to be processed. According to the working mode of the relay device, the merged data packets are processed accordingly. In the above process, multiple data packets can be processed at one time, instead of processing each data packet received, thereby improving the speed of data processing of the relay device. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0063] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of the cache area structure provided in an embodiment of the present application;

[0065] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application;

[0066] Figure 5A A schematic diagram of a data processing process provided by an embodiment of the present application;

[0067] Figure 5B A schematic diagram of another data processing process provided in an embodiment of the present application;

[0068] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0069] Figure 7 A schematic diagram of the structure of a relay device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0071] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0072] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , including a terminal device 101, a relay device 102 and a server 103. The terminal device 101 can be a host, a mobile phone, a tablet computer, etc. The relay device 102 can be a router. During data transmission, the terminal device 101 can send a data packet to the relay device, and the relay device 102 processes the data packet and sends it to the server 103 through the core network. The server 103 can send a data packet to the relay device through the core network, and the relay device 102 processes the data packet and sends it to the terminal device 101.

[0073] In the related art, data can be processed in the following manner: a relay device receives a transmitted data packet and processes the data packet. According to the processing result, the data packet is sent to a terminal device or a core network. In the above process, since each received data packet is processed, the relay device processes data at a relatively slow speed.

[0074] In an embodiment of the present application, the relay device can merge multiple data packets to be processed. According to the working mode of the relay device, the merged data packets are processed accordingly. In the above process, multiple data packets can be processed at one time, rather than processing each data packet received, thereby improving the speed of data processing by the relay device.

[0075] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application. Figure 2, the method may include:

[0076] S201: Obtain the working mode of the relay device.

[0077] The execution subject of the embodiment of the present application may be a relay device, or a chip, chip module or data processing device set in the relay device. The data processing device may be implemented by software, or by a combination of software and hardware. The relay device may be a router.

[0078] The working mode includes transparent mode and routing mode. You can get the working mode of the router according to the network configuration.

[0079] S202: Acquire a plurality of first data packets to be processed according to the working mode.

[0080] Multiple first data packets to be processed can be obtained in the following manner: if the working mode is a transparent transmission mode, multiple first data packets are obtained in the cache area; if the working mode is a routing mode, multiple first data packets are obtained in a sub-cache area in the cache area, and the cache area includes multiple sub-cache areas.

[0081] The data packets can be received by using a USB driver / WIFI driver or a modem, and stored in the corresponding buffer area. The buffer area can be allocated and set in advance in the router according to the protocol stack of the router (Transmission Control Protocol / Internet Protocol, TCPIP). Multiple transmission protocols are stored in the protocol stack.

[0082] A sub-buffer can store a fixed number of data packets. When the number of data packets stored in a sub-buffer reaches the fixed number, if new data packets are to be stored, the new data packets are stored in a new sub-buffer.

[0083] For example, a sub-buffer can store 100 data packets. When receiving data packets, the 100 data packets can be stored in the same sub-buffer. When the 101st data packet is received, the data is stored in a new sub-buffer.

[0084] Next, combine Figure 3 , a method for storing data packets in a buffer area is described. Figure 3 This is a schematic diagram of the cache area structure provided in the embodiment of this application. Figure 3, including a buffer area 301. The buffer area 301 is set in the router. The buffer area includes a plurality of sub-buffers, namely, sub-buffer 1, sub-buffer 2 and sub-buffer 3. Each sub-buffer can store 20 data packets. After receiving 45 first data packets to be processed using the USB driver, the first 20 first data packets are stored in sub-buffer 1, the 21st to 40th first data packets are stored in sub-buffer 2, and the 41st to 45th first data packets are stored in sub-buffer 3.

[0085] If the working mode of the router is transparent transmission mode, when obtaining the 45 data packets, the router directly obtains the 35 first data packets in the buffer area 301. If the working mode of the router is routing mode, multiple first data packets are obtained in the sub-buffer area in the buffer area 301.

[0086] S203: Combine the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet.

[0087] The address information may include source address, source port, destination address, destination port and transport protocol.

[0088] The source address is the Internet Protocol (IP) address of the terminal device that sends the data packet. The destination address is the IP address of the terminal device that receives the data packet.

[0089] The source port is the port used by the terminal device to send data packets. The destination port is the port used by the terminal device to receive data packets.

[0090] The transmission protocol can ensure the security and reliability of data transmission. For example, the transmission protocol can be any protocol in the Transmission Control Protocol / Internet Protocol (TCP / IP) family.

[0091] For example, the first data packet may be specifically as shown in Table 1:

[0092] Table 1

[0093]

[0094]

[0095] The second data packet includes at least one first data packet.

[0096] The second data packet can be obtained in the following manner: grouping multiple first data packets according to their address information to obtain at least one data packet group, wherein the address information of the first data packets in one data packet group is the same; and merging the address information in at least one data packet group to obtain at least one second data packet.

[0097] For example, according to Table 1, it is determined that the address information of the first data packet 1 and the first data packet 3 are the same, and the address information of the first data packet 2 and the first data packet 4 are the same. The data packets with the same address information are merged to obtain the second data packet, which can be specifically shown in Table 2:

[0098] Table 2

[0099]

[0100] The obtained at least one second data packet is sent to the protocol stack.

[0101] S204. Process at least one second data packet according to the working mode.

[0102] The second data packet can be processed in the following manner: if the working mode is the transparent transmission mode, the transmission protocol of the second data packet is obtained, and the second data packet is processed according to the transmission protocol; if the working mode is the routing mode, the second data packet is routed preprocessed and the second data packet is forwarded.

[0103] For example, the router receives multiple second data packets, which may be specifically shown in Table 3:

[0104] Table 3

[0105]

[0106] If the router is in transparent transmission mode, the transmission protocols of Pkt0, Pkt1 and Pkt2 are obtained, which are DHCP, ARP and NDP respectively. The protocol stack of the router processes Pkt0, Pkt1 and Pkt2 respectively according to the transmission protocol. If the router is in routing mode, the protocol stack of the router performs routing preprocessing on Pkt0, Pkt1 and Pkt2 and forwards the second data packet.

[0107] The data processing method provided in the embodiment of the present application obtains the working mode of the relay device; obtains multiple first data packets to be processed according to the working mode; merges and processes the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet; and processes at least one second data packet according to the working mode. In the above process, multiple data packets can be processed at one time, rather than processing each data packet received, thereby improving the speed of the relay device in processing data.

[0108] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application. Figure 4 , the method may include:

[0109] S401: Obtain the working mode of the relay device.

[0110] If the working mode is the transparent transmission mode, execute S402-S405.

[0111] If the working mode is the relay mode, execute S406-S410.

[0112] It should be noted that the execution process of S401 refers to S201 and will not be repeated here.

[0113] S402: Acquire multiple first data packets in a buffer area.

[0114] S403: Combine the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet.

[0115] When merging a plurality of first data packets, all first data packets in the buffer area with the same address information are merged to obtain at least one second data packet.

[0116] S404: Obtain a transmission protocol of the second data packet.

[0117] The transmission protocol of the second data packet may be acquired according to the address information of the second data packet.

[0118] For example, the second data packet may be specifically as shown in Table 4:

[0119] Table 4

[0120]

[0121] According to Table 4, it can be determined that the transmission protocol of the second data packet Pkt0 is DHCP.

[0122] S403: Process the second data packet according to the transmission protocol.

[0123] For any second data packet, the second data packet can be processed in the following manner: if the transmission protocol is a local area network protocol, the second data packet is stored in the protocol stack; if the transmission protocol is not a local area network protocol, the second data packet is forwarded according to the destination address of the second data packet.

[0124] LAN protocols may include Dynamic Host Configuration Protocol (DHCP), Address Resolution Protocol (ARP), and Neighbor Discovery Protocols (NDP).

[0125] The second data packet stored in the protocol stack can be processed in the following manner: if the data transmission mode is uplink transmission, determine whether the destination address is a preset address; if so, process the second data packet according to the transmission protocol of the second data packet; if not, forward the second data packet according to the destination address of the second data packet.

[0126] If the data transmission mode is downlink transmission, the second data packet is processed according to the transmission protocol of the second data packet.

[0127] Uplink transmission refers to the transmission of data from the terminal device to the core network. Downlink transmission refers to the transmission of data from the core network to the terminal device.

[0128] The default address can be 10.0.25.240.

[0129] For example, the second data packet may be specifically as shown in Table 4 above. Assume that the router receives the second data packet sent by the terminal device and transmits the second data packet to the core network. According to Table 4, it is determined that the transmission protocol of the second data packet is the local area network protocol DHCP, and the destination address is the preset address 10.0.25.240. The second data packet is stored in the protocol stack, and the configuration information is sent to the terminal device according to the protocol DHCP.

[0130] The destination address and destination port of the second data packet can be obtained through the address information of the second data packet. The second data packet is sent to the corresponding destination address, and the receiving end (eg, terminal device) receives the second data packet using the destination port.

[0131] If the data transmission mode is uplink transmission, the second data packet is forwarded through the wide area network (WAN) port of the relay device. If the data transmission mode is downlink transmission, the second data packet is forwarded through the local area network (LAN) port of the relay device.

[0132] S406: Acquire multiple first data packets in the sub-buffer area.

[0133] S407: Combine the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet.

[0134] S408: Obtain the data type of the second data packet.

[0135] The data types include: from public network to private network, and from private network to public network.

[0136] The data type of the second data packet may be determined in the following manner: determining the source address and the destination address of the second data packet according to the address information of the second data packet, and determining the data type according to the source address and the destination address.

[0137] S409: Perform routing preprocessing on the second data packet according to the data type.

[0138] The routing preprocessing includes at least one of the following: protocol stack IP header parsing, firewall filtering, searching the Network Address Translation (NAT) table, searching the routing table, and searching the ARP table.

[0139] The second data packet can be routed preprocessed in the following manner: if the data type is from a public network to a private network, each first data packet in the second data packet is routed preprocessed; if the data type is from a private network to a public network, the first first data in the second data packet is routed preprocessed.

[0140] When the data type is from a public network to a private network, each first data packet in the second data packet needs to be NAT converted and filled with an Ethernet frame header.

[0141] For example, when the working mode of the router is the routing mode, the received second data packet may be specifically as shown in Table 5:

[0142] Table 5

[0143]

[0144] According to Table 5, it is determined that the source address of the second data packet Pkt1 belongs to the public network address, and it is determined that the destination address of the second data packet Pkt1 belongs to the private network address. According to the source address and destination address of the second data packet Pkt0, it is determined that the data type of the second data packet Pkt1 is from the public network to the private network. When performing route preprocessing on the second data packet Pkt0, route preprocessing is performed on each first data packet in the second data packet.

[0145] According to Table 5, it is determined that the source address of the second data packet Pkt0 belongs to the private network address, and it is determined that the destination address of the second data packet Pkt0 belongs to the public network address. According to the source address and the destination address of the second data packet Pkt0, it is determined that the data type of the second data packet Pkt0 is from the private network to the public network. When performing route preprocessing on the second data packet Pkt0, route preprocessing is performed on the first first data in the second data packet.

[0146] S410: forward the second data packet.

[0147] If the data transmission mode is uplink transmission, the second data packet is forwarded through the WAN port of the relay device. If the data transmission mode is downlink transmission, the second data packet is forwarded through the LAN port of the relay device.

[0148] The method for processing the second data packet provided in the embodiment of the present application selects a corresponding method to process and forward the second data packet according to the working mode. If the working mode is the transparent transmission mode, the transmission protocol of the second data packet is obtained, and the second data packet is processed according to the transmission protocol. If the working mode is the routing mode, the second data packet is routed preprocessed and the second data packet is forwarded. In the above process, multiple data packets can be processed at one time, instead of processing each data packet as it is received, thereby improving the speed at which the relay device processes data.

[0149] Based on any of the above embodiments, Figure 5A-Figure 5B , the process of data processing by relay equipment in different working modes is illustrated with examples.

[0150] Figure 5A A schematic diagram of a data processing process provided by an embodiment of the present application. Figure 5A , including a terminal device 501, a relay device 502 and a server 503. The terminal device 501 can be a mobile phone, a computer, etc. The relay device 502 can be a router, and a cache area and a protocol stack are set in the relay device 502. The cache area includes multiple sub-buffers. Data can be transmitted between the terminal device 501 and the server 503 through the core network. It is assumed that the working mode of the relay device 502 is the transparent transmission mode. There are two cases:

[0151] Case 1: The data transmission mode is uplink transmission.

[0152] The relay device 502 receives multiple first data packets to be processed sent by the terminal device 501 using a USB driver, and stores them in a buffer area pre-allocated by the protocol stack, and each sub-buffer area in the buffer area stores a fixed number of first data packets. All first data packets are obtained in the buffer area, and multiple first data packets are merged and processed according to the address information of the multiple first data packets to obtain at least one second data packet. The at least one second data packet is sent to the protocol stack of the relay device 502. The protocol stack determines the transmission protocol of the second data packet according to the address information of the second data packet. The second data packet whose transmission protocol is the local area network protocol is stored in the protocol stack. The second data packet whose transmission protocol is not the local area network protocol is forwarded to the server 503 through the WAN port of the relay device 502. For the second data packet in the protocol stack, it is determined whether the destination address is 10.0.25.240. If so, the second data packet is processed according to the transmission protocol of the second data packet. If not, the second data packet is forwarded to the server 503 through the WAN port of the relay device 502.

[0153] Case 2: The data transmission mode is downlink transmission.

[0154] The relay device 502 uses a modem to receive multiple first data packets to be processed sent by the server 503, and stores them in a buffer area pre-allocated by the protocol stack. Each sub-buffer in the buffer area stores a fixed number of first data packets. Multiple first data packets are obtained in the sub-buffer area, and multiple first data packets are merged and processed according to the address information of the multiple first data packets to obtain at least one second data packet. The at least one second data packet is sent to the protocol stack of the relay device 502. The protocol stack forwards the second data packet to the terminal device 501 through the LAN port of the relay device 502 according to the address information of the second data packet.

[0155] Figure 5B This is another data processing process diagram provided by the embodiment of the present application. Figure 5B , including a terminal device 501, a relay device 502 and a server 503. The terminal device 501 can be a mobile phone, a computer, etc. The relay device 502 can be a router, and a cache area and a protocol stack are set in the relay device 502. The cache area includes multiple sub-buffers. Data can be transmitted between the terminal device 501 and the server 503 through the core network. It is assumed that the working mode of the relay device 502 is the routing mode. There are two cases:

[0156] Case 1: The data transmission mode is uplink transmission.

[0157] The relay device 502 receives multiple first data packets to be processed sent by the terminal device 501 using a USB driver, and each sub-buffer in the buffer area stores a fixed number of first data packets. Multiple first data packets are obtained in the sub-buffer area, and multiple first data packets are merged and processed according to the address information of the multiple first data packets to obtain at least one second data packet. The at least one second data packet is sent to the protocol stack of the relay device 502. The protocol stack of the relay device 502 determines the source address and destination address of the second data packet according to the address information of the second data packet. The data type is determined according to the source address and the destination address. If the data type of the second data packet is from a shared network to a private network, each first data packet in the second data packet is routed preprocessed, NAT converted and filled with an Ethernet frame header. If the data type of the second data packet is from a private network to a shared network, the first first data in the second data packet is routed preprocessed. Among them, the route preprocessing includes at least one of the following: protocol stack IP header parsing, firewall filtering, NAT table search, routing table search, and ARP table search. After the processing is completed, the second data packet is forwarded to the server 503 through the WAN port of the relay device.

[0158] Case 2: The data transmission mode is downlink transmission.

[0159] The relay device 502 uses a modem to receive multiple first data packets to be processed sent by the server 503, and each sub-buffer in the buffer stores a fixed number of first data packets. Multiple first data packets are obtained in the sub-buffer, and multiple first data packets are merged and processed according to the address information of the multiple first data packets to obtain at least one second data packet. The at least one second data packet is sent to the protocol stack of the relay device 502. The processing process of the protocol stack is the same as the processing process of the uplink transmission, which will not be repeated here. After the processing is completed, the second data packet is forwarded to the terminal device 501 through the LAN port of the relay device.

[0160] The data processing method provided in the embodiment of the present application obtains multiple first data packets to be processed according to the working mode. According to the address information of the multiple first data packets, the multiple first data packets are merged and processed to obtain at least one second data packet. According to the working mode and the data transmission mode, the at least one second data packet is processed. In the above process, multiple data packets can be processed at one time, instead of processing each data packet received, thereby improving the speed of data processing of the relay device.

[0161] Figure 6 This is a schematic diagram of the structure of the data processing device provided in the embodiment of the present application. The data processing device can be a chip or a chip module. Figure 6 , the data processing device 10 may include:

[0162] A first acquisition module 11 is used to acquire a working mode of the relay device, where the working mode includes a transparent transmission mode and a routing mode;

[0163] A second acquisition module 12, configured to acquire a plurality of first data packets to be processed according to the working mode;

[0164] A first processing module 13 is used to merge the multiple first data packets according to the address information of the multiple first data packets to obtain at least one second data packet, where the second data packet includes at least one first data packet;

[0165] The second processing module 14 is configured to process the at least one second data packet according to the working mode.

[0166] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0167] In a possible implementation manner, the first processing module 13 is specifically configured to:

[0168] According to the address information of the plurality of first data packets, the plurality of first data packets are grouped to obtain at least one data packet group, wherein the address information of the first data packets in one of the data packet groups is the same;

[0169] The address information in the at least one data packet group is merged respectively to obtain the at least one second data packet.

[0170] In a possible implementation manner, the second processing module 14 is specifically configured to:

[0171] If the working mode is the transparent transmission mode, obtaining a transmission protocol of the second data packet, and processing the second data packet according to the transmission protocol;

[0172] If the working mode is the routing mode, routing preprocessing is performed on the second data packet, and the second data packet is forwarded.

[0173] In a possible implementation manner, the second processing module 14 is specifically configured to:

[0174] If the transmission protocol is a local area network protocol, storing the second data packet in a protocol stack;

[0175] If the transmission protocol is not the local area network protocol, forwarding processing is performed on the second data packet according to the destination address of the second data packet.

[0176] In a possible implementation manner, the second processing module 14 is specifically configured to:

[0177] Acquire a data type of the second data packet, the data type comprising: from a public network to a private network, and from a private network to a public network;

[0178] Perform routing preprocessing on the second data packet according to the data type.

[0179] In a possible implementation manner, the second processing module 14 is specifically configured to:

[0180] If the data type is from a public network to a private network, performing routing preprocessing on each first data packet in the second data packet;

[0181] If the data type is from a private network to a public network, routing preprocessing is performed on the first first data in the second data packet.

[0182] In a possible implementation, the routing preprocessing includes at least one of the following: protocol stack Internet Protocol IP header parsing, firewall filtering, searching a network address translation NAT table, searching a routing table, and searching an address resolution protocol ARP table.

[0183] In a possible implementation manner, the second acquisition module 12 is specifically configured to:

[0184] If the working mode is the transparent transmission mode, obtaining the plurality of first data packets in the buffer area;

[0185] If the working mode is the routing mode, the multiple first data packets are obtained from a sub-buffer in the buffer, and the buffer includes multiple sub-buffers.

[0186] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0187] Figure 7 This is a schematic diagram of the structure of the relay device provided in the embodiment of the present application. Figure 7 The relay device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.

[0188] The memory 21 is used to store program instructions;

[0189] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the relay device 20 to execute the method shown in the above method embodiment.

[0190] The relay device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0191] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0192] The embodiment of the present application may also provide a computer program product, including a computer program, which can implement the above method when executed by a processor.

[0193] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), random access memory (English: Random Access Memor, abbreviated: RAM), flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0194] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0197] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0198] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A data processing method, characterized in that: Applied in a relay device, the method comprises: According to the network configuration, obtaining the working mode of the relay device, the working mode including transparent transmission mode and routing mode; If the working mode is the transparent transmission mode, a plurality of first data packets to be processed are obtained in a buffer area; If the working mode is the routing mode, a plurality of first data packets to be processed are obtained from a sub-buffer in the buffer, wherein the buffer includes a plurality of the sub-buffers; According to the address information of the plurality of first data packets, the plurality of first data packets are grouped to obtain at least one data packet group, the address information of the first data packets in one of the data packet groups is the same, and the address information includes a source address, a source port, a destination address, a destination port and a transmission protocol; Merging the address information in the at least one data packet group respectively to obtain at least one second data packet, wherein the second data packet includes at least one first data packet; The at least one second data packet is processed according to the working mode.

2. The method according to claim 1, characterized in that For any second data packet; processing the second data packet according to the working mode includes: If the working mode is the transparent transmission mode, obtaining a transmission protocol of the second data packet, and processing the second data packet according to the transmission protocol; If the working mode is the routing mode, routing preprocessing is performed on the second data packet, and the second data packet is forwarded.

3. The method according to claim 2, characterized in that Processing the second data packet according to the transmission protocol includes: If the transmission protocol is a local area network protocol, storing the second data packet in a protocol stack; If the transmission protocol is not the local area network protocol, forwarding processing is performed on the second data packet according to the destination address of the second data packet.

4. The method according to claim 2, characterized in that: Performing routing preprocessing on the second data packet includes: Acquire a data type of the second data packet, the data type comprising: from a public network to a private network, and from a private network to a public network; Perform routing preprocessing on the second data packet according to the data type.

5. The method according to claim 4, characterized in that Performing routing preprocessing on the second data packet according to the data type includes: If the data type is from a public network to a private network, performing routing preprocessing on each first data packet in the second data packet; If the data type is from a private network to a public network, routing preprocessing is performed on the first first data in the second data packet.

6. The method according to any one of claims 2 to 5, characterized in that: The routing preprocessing includes at least one of the following: protocol stack Internet Protocol IP header parsing, firewall filtering, searching the network address translation NAT table, searching the routing table, and searching the address resolution protocol ARP table.

7. A data processing device, characterized in that: The device comprises: A first acquisition module, used to acquire a working mode of the relay device according to the network configuration, wherein the working mode includes a transparent transmission mode and a routing mode; A second acquisition module is used to acquire a plurality of first data packets to be processed in a buffer area if the working mode is the transparent transmission mode; and to acquire a plurality of first data packets to be processed in a sub-buffer area in the buffer area if the working mode is the routing mode, wherein the buffer area includes a plurality of the sub-buffer areas; A first processing module is configured to group the plurality of first data packets according to the address information of the plurality of first data packets to obtain at least one data packet group, wherein the address information of the first data packets in one of the data packet groups is the same, and the address information includes a source address, a source port, a destination address, a destination port and a transmission protocol; and merge the address information in the at least one data packet group to obtain at least one second data packet, wherein the second data packet includes at least one first data packet; The second processing module is used to process the at least one second data packet according to the working mode.

8. A relay device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Network device and data stream transmitting method thereof

    CN102857426A

  • Multi-purpose data transmission network routing device and method, chip and router

    CN106161254A