Wireless network data processing method, device and equipment
By caching and batch sending network layer data packets, the problem of low Internet access to wireless hotspot sharing networks caused by low-cost wireless chips and mobile communication chips is solved, and the effect of improving the data transmission efficiency of wireless networks is achieved.
Patent Information
- Application Number
- CN202411734186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-21
AI Technical Summary
Due to the low-cost wireless chips and mobile communication chips, the wireless hotspot sharing wireless network access speed is lower.
By acquiring the information of multiple network layer data packets on the first chip end and the cache information of the transmission queue, the multiple network layer data packets are cached to multiple transmission buffers of the transmission queue, and sent in sequence according to the generation time.
By sending multiple network layer data packets at once, the number of messages sent and received is reduced, the efficiency of forwarding of network layer data packets is improved, and thus the speed of wireless hotspot sharing wireless network access is improved.
Smart Images

Figure CN119676760A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of wireless network technology, and in particular, relates to a wireless network data processing method, device and equipment. Background Art
[0002] At present, wireless WiFi hotspot sharing of wireless networks is a widely used function on terminal devices such as smart phones and smart POS machines. In the use scenarios where the speed requirement is not high but the cost is low, the terminal devices usually use low-cost wireless chips.
[0003] When using a low-cost wireless chip hotspot to share a wireless network, the data forwarded between the mobile communication chip and the wireless chip is a network layer data message of the Transmission Control Protocol / Internet Protocol (TCP / IP). Generally, after receiving a complete frame of network layer data message, the mobile communication chip or the wireless chip will immediately forward the network layer data message to the other end through the serial peripheral interface (SPI) bus; and after receiving a complete frame of network layer data message sent by the mobile communication chip, the wireless chip will forward it through the network layer protocol. However, in the process of forwarding these two messages, since the main frequency of the low-cost wireless chip and the mobile communication chip is relatively low, the processing and forwarding capabilities of the message are not high, which seriously affects the Internet access speed of the wireless hotspot sharing wireless network. Summary of the invention
[0004] The embodiments of the present application provide a wireless network data processing method, device and equipment, which can solve the problem of low Internet access speed in wireless hotspot sharing of wireless networks due to low main frequency of wireless chips and mobile communication chips and low message processing and forwarding capabilities.
[0005] In a first aspect, an embodiment of the present application provides a wireless network data processing method, the method comprising:
[0006] Acquire first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes message length; the cache information includes generation time of multiple sending buffers and remaining length of the current sending buffer;
[0007] According to the first message information of multiple network layer data messages and the cache information of the sending queue, the multiple network layer data messages are cached in multiple sending buffers of the sending queue to obtain multiple cache message data corresponding to the multiple sending buffers; wherein each of the sending buffers caches one cache message data, and each of the cache message data includes multiple network layer data messages;
[0008] In response to the permission to send instruction from the second chip end, the cached message data of each of the sending buffers is sent to the second chip end in sequence according to the generation time of the plurality of sending buffers.
[0009] In a possible implementation manner of the first aspect, before caching the plurality of network layer data packets to the plurality of send buffers of the send queue according to the first message information of the plurality of network layer data packets and the cache information of the send queue, and obtaining the plurality of cached message data corresponding to the plurality of send buffers, the method includes:
[0010] According to the number of the network layer data packets cached in the current sending buffer, the state type of the current sending buffer in the sending queue is determined, wherein the state type includes a first state and a second state, the first state is used to indicate that a plurality of the network layer data packets are cached in the current sending buffer, and the second state is used to indicate that the network layer data packet is not cached in the current sending buffer.
[0011] In a possible implementation manner of the first aspect, the caching of the plurality of network layer data packets to the plurality of send buffers of the send queue according to the first message information of the plurality of network layer data packets and the cache information of the send queue, and obtaining the plurality of cache message data corresponding to the plurality of send buffers, includes:
[0012] Determining cache locations of the plurality of network layer data messages according to the message lengths of the plurality of network layer data messages and the remaining length of the current send buffer of the send queue;
[0013] According to the cache position, the plurality of network layer data messages are sequentially cached into the plurality of sending buffers to obtain a plurality of cache message data.
[0014] In a possible implementation manner of the first aspect, if the state type of the current sending buffer is the first state, determining the cache position of the plurality of network layer data packets according to the packet lengths of the plurality of network layer data packets and the remaining length of the current sending buffer of the sending queue includes:
[0015] According to the message length of the network layer data message being greater than the remaining length of the current sending buffer, determining the cache position of the network layer data message as the starting position of the next sending buffer; wherein the next sending buffer is the sending buffer newly generated at the end of the sending queue; and,
[0016] According to the message length of the network layer data message being less than or equal to the remaining length of the current sending buffer, the cache location of the network layer data message is determined to be the remaining space in the current sending buffer.
[0017] In a possible implementation manner of the first aspect, the method includes:
[0018] If the state type of the current sending buffer is the second state, the cache position of the network layer data message is determined to be the starting position of the current sending buffer.
[0019] In a possible implementation manner of the first aspect, the method further includes:
[0020] Acquire second message information of the plurality of network layer data messages on the second chip side; wherein the second message information includes a message type, a message destination address, and a message source physical address;
[0021] According to the message type, the plurality of network layer data messages are forwarded to the driver layer of the second chip end.
[0022] In a possible implementation manner of the first aspect, forwarding the plurality of network layer data messages to the driver layer of the second chip side according to the message type includes:
[0023] If the message type is an Internet Protocol IP message, encapsulating the network layer data message according to the message destination address of the network layer data message to obtain an Ethernet encapsulation message corresponding to the network layer data message; and,
[0024] Forwarding the Ethernet encapsulated message directly to the driver layer of the second chip end;
[0025] If the message type is other than the IP message, the network layer data message is forwarded to the driver layer of the second chip end through the network protocol layer.
[0026] In a possible implementation manner of the first aspect, encapsulating the network layer data packet according to the message destination address of the network layer data packet to obtain the Ethernet encapsulation message corresponding to the network layer data packet includes:
[0027] According to the message destination address, searching in a local database to obtain a destination physical address corresponding to the message destination address;
[0028] Obtaining an Ethernet protocol header according to the destination physical address, the message type and the source physical address of the network layer data message;
[0029] The Ethernet protocol header is added to the front of the network layer data message to obtain the Ethernet encapsulation message corresponding to the network layer data message; wherein the Ethernet protocol header is filled in a first preset position of the receiving buffer, and the network layer data message is filled in a second preset position of the receiving buffer.
[0030] In a second aspect, an embodiment of the present application provides a wireless network data processing device, including:
[0031] An acquisition module, used to acquire first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes message length; the cache information includes sending buffer generation time and sending buffer remaining length;
[0032] A cache module, used for caching a plurality of network layer data packets to a plurality of sending buffers of the sending queue according to the first message information of the plurality of network layer data packets and the cache information of the sending queue, and obtaining a plurality of cached message data corresponding to the plurality of sending buffers; wherein each of the sending buffers caches one cached message data, and each of the cached message data includes a plurality of the network layer data packets;
[0033] The forwarding module is used to respond to the permission to send instruction of the second chip end and send the cached message data of each sending buffer to the second chip end in turn according to the generation time of multiple sending buffers.
[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the wireless network data processing methods described above when executing the computer program.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the wireless network data processing method described in any one of the above items is implemented.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device executes the wireless network data processing method described in any one of the first aspects above.
[0037] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0038] The embodiment of the present application provides a wireless network data processing method, by obtaining the first message information of multiple network layer data messages of the first chip end and the cache information of the sending queue; wherein, the first message information includes the message length; the cache information includes the generation time of multiple sending buffers and the remaining length of the current sending buffer; according to the first message information of multiple network layer data messages and the cache information of the sending queue, multiple network layer data messages are cached to multiple sending buffers of the sending queue to obtain multiple cache message data corresponding to multiple sending buffers; wherein, each sending buffer caches a cache message data, and each cache message data includes multiple network layer data messages; in response to the permission to send instruction of the second chip end, according to the generation time of multiple sending buffers, the cache message data of each sending buffer is sent to the second chip end in turn. In the data forwarding process, compared with sending only one network layer data message at a time, sending multiple network layer data messages at a time can improve the forwarding efficiency of the network layer data message by reducing the number of message sending and receiving, thereby improving the Internet access speed of the wireless hotspot sharing wireless network. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 It is a flowchart of a wireless network data processing method provided by an embodiment of the present application;
[0041] Figure 2 This is a flow chart of wireless network data forwarding provided by an embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of a sending queue provided by an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of a process for sending cached messages in a buffer provided by an embodiment of the present application;
[0044] Figure 5 is a flowchart of a wireless network data processing method provided by another embodiment of the present application;
[0045] Figure 6 It is a flowchart of an existing wireless network data processing method provided by an embodiment of the present application;
[0046] Figure 7is a flowchart of a wireless network data processing method provided by another embodiment of the present application;
[0047] Figure 8 This is a schematic diagram of a structure of a receiving buffer provided by an embodiment of the present application;
[0048] Fig. 9 It is a structural diagram of a wireless network data processing device provided by an embodiment of the present application;
[0049] Fig.10 It is a structural schematic diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0051] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0052] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0053] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0054] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0055] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0056] See also Figure 1 , Figure 1 1 is a flow chart of a wireless network data processing method provided by an embodiment of the present application. The wireless network data processing method includes:
[0057] S11, obtaining first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes message length; the cache information includes generation time of multiple sending buffers and remaining length of the current sending buffer;
[0058] S12, according to the first message information of the plurality of network layer data messages and the cache information of the sending queue, the plurality of network layer data messages are cached in the plurality of sending buffers of the sending queue, and a plurality of cache message data corresponding to the plurality of sending buffers are obtained; wherein each sending buffer caches a cache message data, and each cache message data includes a plurality of network layer data messages;
[0059] S13. In response to the permission to send instruction from the second chip end, the cached message data of each sending buffer is sent to the second chip end in sequence according to the generation time of the multiple sending buffers.
[0060] It should be noted that the method is mainly used in data communication of mobile devices. The wireless network data processing method provided in this embodiment involves data transmission between two chip ends (first chip end and second chip end). After receiving a network layer data message, the first chip end or the second chip end will send the network layer data message to the other end through the SPI bus. In this embodiment, the first chip end can be a mobile communication chip end, which can be a 4G Cat.1 chip, or other mobile communication chips such as 4G Cat.4, 4G Cat.6, 3G UMTS, etc. The first chip end can be used as the starting end of data transmission to send the network layer data message received from the base station to the second chip end; it can also be used as the receiving end of data transmission to receive the network layer data message forwarded to it by the second chip end. The second chip end can be a wireless WiFi end, and the second chip end can be used as the receiving end of data transmission to receive the network layer data message forwarded to it from the first chip end; it can also be used as the starting end of data transmission to send the network layer data message received from the external mobile device to the first chip end. Among them, the network layer data message is the basic unit of data transmission in network communication. Network layer data messages usually include information such as source address, destination address, data content, and message length.
[0061] like Figure 2 As shown, Figure 2 It is a flow chart of wireless network data forwarding provided by an embodiment of the present application. Figure 2The data forwarding process between the mobile communication chip (such as 4G Cat.1) and the wireless chip is described, including the uplink data forwarding process and the downlink data forwarding process. The uplink data forwarding process is: RF S→WiFi driver S→network protocol S→SPI driver S→SPI driver M→network protocol M→modem→RF M. The downlink data forwarding process is: RF M→modem→network protocol M→SPI driver M→SPI driver S→network protocol S→WiFi driver S→RF S. Among them, RF is used to convert digital signals into radio electromagnetic wave signals, RF S is the RF module on the wireless chip side, and RF M is the RF module on the mobile communication chip side. WiFi driver S is the WiFi driver on the wireless chip side, which is used to pass data to the network protocol layer for data transmission. The network protocol is used to process the data format and encapsulate the data into a format suitable for network transmission. The network protocol S is the network protocol stack on the wireless chip side, and the network protocol M is the network protocol stack on the mobile communication chip side. SPI is a synchronous serial communication protocol for short-distance communication. SPI driver S is the SPI driver of the wireless chip, which is used to transfer data from the network protocol S to the modem or receive data from the modem; SPI driver M is the SPI driver of the mobile communication end, which is used to receive data from the wireless chip or transfer data from the modem to the SPI driver S of the wireless chip. The modem is used to convert the data from the wireless chip into the format of network transmission and forward it to the base station.
[0062] In step S11, the first message information refers to the detailed information of the network layer data message, mainly including the message length, that is, the data size of the data message. The sending queue is a data structure for storing network layer data messages to be sent. In this embodiment, the sending queue includes multiple sending buffers, each sending buffer is used to cache the network layer data messages to be sent in the first chip end, and each sending buffer caches multiple network layer data messages. The cache information of the sending queue is the detailed information of the sending buffer, including the generation time of multiple sending buffers and the remaining length of the current sending buffer. Among them, the generation time refers to the time when the sending buffer is created, and the remaining length refers to the number of network layer data messages that can still be stored in the sending buffer.
[0063] In step S12, each sending buffer stores multiple network layer data messages, and the stored multiple network layer data messages form a cache message data as a whole. That is, each sending buffer caches a cache message data, and each cache message data includes multiple network layer data messages.
[0064] In step S13, the permission to send instruction refers to an instruction issued by the second chip end that it is ready to receive data messages. When receiving the permission to send instruction, the first chip end sends the cached message data of each sending buffer to the second chip end in turn according to the generation time of the sending buffer (i.e., the first-in-first-out principle). Figure 3 As shown, Figure 3 FIG. 1 is a schematic diagram of a sending queue provided by an embodiment of the present application. Figure 3 , there are three sending buffers in the sending queue, namely sending buffer 1, sending buffer 2 and sending buffer 3; the generation time order of these three sending buffers is sending buffer 1, sending buffer 2 and sending buffer 3. When forwarding data to the second chip end, first send message 1 and message 2 in sending buffer 1 to the second chip end as a whole, and then send message 3 and message 4 in sending buffer 2 to the second chip end as a whole. In this way, sending multiple network layer data messages to the second chip end as a whole at one time can ensure that the data is received and processed in order, reduce the number of times the message is sent and received, thereby improving the efficiency of data forwarding. At the same time, reasonable cache management can avoid data loss and congestion problems.
[0065] It should be noted that when the second chip receives a network layer data message sent by the first chip, when the data includes multiple network layer data messages, it is necessary to forward these messages to the upper network protocol layer in sequence according to the order in which the messages are cached in the sending buffer.
[0066] It should be noted that the data transmission between the first chip end and the second chip end is mutual. In this embodiment, the first chip end is used as a transmitter to transmit data to the second chip end as a receiver; or the second chip end is used as a transmitter to transmit data to the first chip end as a receiver according to the above method.
[0067] It can be understood that the embodiment of the present application provides a wireless network data processing method, by obtaining the first message information of multiple network layer data messages of the first chip end and the cache information of the sending queue; wherein, the first message information includes the message length; the cache information includes the generation time of multiple sending buffers and the remaining length of the current sending buffer; according to the first message information of multiple network layer data messages and the cache information of the sending queue, multiple network layer data messages are cached to multiple sending buffers of the sending queue to obtain multiple cache message data corresponding to multiple sending buffers; wherein, each sending buffer caches a cache message data, and each cache message data includes multiple network layer data messages; in response to the permission to send instruction of the second chip end, according to the generation time of multiple sending buffers, the cache message data of each sending buffer is sent to the second chip end in turn. In the data forwarding process, compared with sending only one network layer data message at a time, sending multiple network layer data messages at a time can improve the forwarding rate of network layer data messages by reducing the number of message sending and receiving, thereby improving the Internet access speed of wireless hotspot sharing wireless network.
[0068] In a possible implementation, before caching the plurality of network layer data packets to the plurality of sending buffers of the sending queue according to the first message information of the plurality of network layer data packets and the cache information of the sending queue, and obtaining the plurality of cached message data corresponding to the plurality of sending buffers, the wireless network data processing method includes:
[0069] Based on the number of network layer data packets cached in the current sending buffer, determine the state type of the current sending buffer in the sending queue, wherein the state type includes a first state and a second state, the first state is used to indicate that multiple network layer data packets are cached in the current sending buffer, and the second state is used to indicate that no network layer data packets are cached in the current sending buffer.
[0070] It should be noted that before caching multiple network layer data messages into multiple sending buffers of the sending queue, it is necessary to judge the status type of the current sending buffer. Among them, the current sending buffer is the sending buffer at the end of the sending queue, which is storing message data or its space is about to be fully stored or is about to store message data. The status type of the current sending buffer is used to indicate whether there are network layer data messages cached in the sending buffer. The first state indicates that there are multiple network layer data messages cached in the current sending buffer, that is, the current sending buffer is storing data messages; the second state indicates that there are no network layer data messages cached in the current sending buffer, that is, the current sending buffer is empty and no data messages are stored.
[0071] Specifically, if the current sending buffer is in the first state, it is necessary to determine whether to continue caching new data messages in the current sending buffer or to regenerate a new sending buffer to cache data messages based on information such as the message length of the network layer data message and the remaining length of the current sending buffer. If the current sending buffer is in the second state, the network layer data message can be directly cached in the sending buffer.
[0072] In a possible implementation, according to first message information of multiple network layer data messages and cache information of a sending queue, multiple network layer data messages are cached in multiple sending buffers of a sending queue to obtain multiple cache message data corresponding to the multiple sending buffers, including:
[0073] Determine cache locations of the plurality of network layer data messages according to message lengths of the plurality of network layer data messages and remaining lengths of a current sending buffer of a sending queue;
[0074] According to the cache position, multiple network layer data messages are cached in sequence to multiple sending buffers to obtain multiple cache message data.
[0075] It should be noted that when caching network layer data packets, since the message length of each network layer data packet and the length of each sending buffer are different, it is necessary to determine the cache positions of multiple network layer data packets based on the message length of the network layer data packet and the remaining length of the current sending buffer; after determining the cache position of the network layer data packet, the network layer data packet is cached in the sending buffer.
[0076] The message length of the network layer data message determines the space it occupies in the send buffer. The cache location is the location where the network layer data message is stored in the send buffer. In the send queue, each send buffer has a preset capacity. When the network layer data message is filled into the send buffer, the remaining length (remaining space) of the send buffer will be reduced accordingly. Therefore, when caching the network layer data message, it is necessary to consider whether the remaining length of the current send buffer can accommodate the network layer data message, so as to determine the cache location.
[0077] According to the determined cache position, the network layer data message is cached in the corresponding sending buffer in sequence. In this way, each sending buffer will store one or more network layer data messages to form a cache message data. Then, one or more network layer data messages in a cache message data are forwarded to the second chip end as a whole.
[0078] It can be understood that through the method provided in this embodiment, the system can effectively cache multiple network layer data packets into multiple sending buffers of the sending queue, which can ensure smooth data transmission and thus improve the efficiency of data transmission. At the same time, data loss and congestion problems can be avoided through reasonable cache management.
[0079] In a possible implementation, if the state type of the current sending buffer is the first state, determining the cache position of the multiple network layer data packets according to the message lengths of the multiple network layer data packets and the remaining length of the current sending buffer of the sending queue includes:
[0080] According to the message length of the network layer data message being greater than the remaining length of the current sending buffer, determining the cache position of the network layer data message as the starting position of the next sending buffer; wherein the next sending buffer is a sending buffer newly generated at the end of the sending queue; and,
[0081] According to the message length of the network layer data message being less than or equal to the remaining length of the current sending buffer, it is determined that the cache position of the network layer data message is the remaining space in the current sending buffer.
[0082] It should be noted that if the status type of the current sending buffer is the first state, the first state indicates that multiple network layer data packets have been cached in the current sending buffer, that is, the current sending buffer is not empty, and it is necessary to determine the cache positions of multiple network layer data packets based on the message lengths of the multiple network layer data packets and the remaining length of the current sending buffer.
[0083] Specifically, when the length of the network layer data message is greater than the remaining length of the current sending buffer, it means that the network layer data message cannot be completely stored in the current sending buffer. At this time, a new sending buffer needs to be regenerated at the end of the sending queue to cache the network layer data message. The cache position of the network layer data message is the starting position of the next sending buffer. The new sending buffer is the next sending buffer.
[0084] When the message length of the network layer data message is less than or equal to the remaining length of the current sending buffer, it means that the network layer data message can be completely stored in the current sending buffer. At this time, the network layer data message is directly cached to the remaining space in the current sending buffer, that is, the position after the previous network layer data message cached in the current sending buffer.
[0085] It can be understood that through the above steps, multiple send buffers in the send queue can be flexibly managed, and the cache location of each network layer data packet can be determined based on the message length of multiple network layer data packets and the remaining length of the current send buffer of the send queue, which can help improve the efficiency of data transmission and reduce data loss and congestion problems.
[0086] In a possible implementation, the wireless network data processing method includes:
[0087] If the state type of the current sending buffer is the second state, the cache position of the network layer data message is determined to be the starting position of the current sending buffer.
[0088] Specifically, if the status type of the current sending buffer is the second state, the second state indicates that there is no network layer data message cached in the current sending buffer, that is, the current sending buffer is empty, the system will use this current sending buffer as the cache location for new network layer data messages, that is, cache the network layer data message at the starting position of this current sending buffer until the entire sending buffer is filled or the network layer data message is completely stored.
[0089] It should be noted that, as the network layer data message is written, the state of the current sending buffer will change from the second state to the first state, and the remaining length of the sending buffer will decrease accordingly. The storage location of the subsequent network layer data message needs to be determined after comparing the length of the network layer data message and the remaining length of the sending buffer as described above. Figure 4 As shown, Figure 4 It is a schematic diagram of a process for caching messages in a sending buffer provided by an embodiment of the present application. Figure 4 In the example, when receiving message 1, the sending buffer is in the second state, that is, the sending buffer is empty, and message 1 is filled at the starting position of the sending buffer. When receiving message 2, if the message length of message 2 is less than the remaining length of the sending buffer, message 2 is filled after message 1.
[0090] See also Figure 5 , Figure 5 1 is a flow chart of a wireless network data processing method provided by another embodiment of the present application. The wireless network data processing method includes:
[0091] S21, obtaining second message information of multiple network layer data messages on the second chip end; wherein the second message information includes a message type, a message destination address, and a message source physical address;
[0092] S22. Forward multiple network layer data messages to the driver layer of the second chip end according to the message type.
[0093] It should be noted that the second message information refers to the information related to the network layer data message obtained from the second chip end, which may include: message type, message destination address and message source physical address. Among them, the message type is used to indicate the type or purpose of the network layer data message, such as Internet Protocol IP message or other types of messages. The message destination address is used to indicate the target address to which the network layer data message is forwarded. The message source physical address, that is, the source MAC address, indicates the physical address of the sender of the network layer data message. The driver layer refers to the driver program or software module on the second chip end that is responsible for processing the network layer data message.
[0094] In a specific application of this embodiment, the SPI driver of the wireless chip receives the second message information of multiple network layer data messages sent by the mobile communication chip, and then determines whether to directly forward the network layer data message to the driver layer of the wireless chip according to the message type.
[0095] In a possible implementation, forwarding multiple network layer data messages to the driver layer of the second chip end according to the message type includes:
[0096] If the message type is an Internet Protocol IP message, encapsulating the network layer data message according to the message destination address of the network layer data message to obtain an Ethernet encapsulation message corresponding to the network layer data message; and,
[0097] Forwarding the Ethernet encapsulated message directly to the driver layer of the second chip end;
[0098] If the message type is other than the IP message, the network layer data message is forwarded to the driver layer of the second chip end through the network protocol layer.
[0099] Specifically, when the message type is an Internet Protocol IP message, it is necessary to perform Ethernet encapsulation on the network layer data message according to the message destination address of the network layer data message, and after obtaining the Ethernet encapsulation message corresponding to the network layer data message, directly forward the Ethernet encapsulation message to the driver layer of the second chip end. Among them, Ethernet encapsulation refers to adding an Ethernet header in front of the network layer data message. In this way, the original processing process of protocol conversion or disassembly through the network protocol layer can be reduced, thereby improving the processing speed of the network layer data message.
[0100] When the message type is other than IP message, such as Address Resolution Protocol ARP message, Reverse Address Resolution Protocol RARP message, etc., it is not directly encapsulated into Ethernet. The network layer data message still needs to be sent to the network protocol layer. After the protocol conversion and disassembly of the network protocol layer to obtain the converted Ethernet message, it is forwarded to the driver layer of the second chip end.
[0101] like Figure 6 As shown, Figure 6 It is a flowchart of an existing wireless network data processing method provided by an embodiment of the present application. Figure 6 In the example, multiple network layer data messages obtained from the SPI driver S of the wireless chip are directly sent to the network protocol S. After the network protocol S performs protocol conversion and disassembly, the converted Ethernet message is obtained and then sent to the WIFI driver S of the wireless chip, that is, the driver layer of the wireless chip. Figure 7 As shown, Figure 7 It is a flowchart of a wireless network data processing method provided by another embodiment of the present application. Figure 7 In the method, the message types of multiple network layer data messages obtained from the SPI driver S of the wireless chip are first judged; when the message type is an Internet Protocol IP message, the network layer data message is Ethernet encapsulated, and after obtaining the Ethernet encapsulated message, the Ethernet encapsulated message is sent to the WIFI driver S of the wireless chip; when the message type is other types except IP messages, multiple network layer data messages are directly sent to the network protocol S, and after the network protocol S performs protocol conversion, disassembly and other processing, the converted Ethernet message is obtained, and then sent to the wireless driver S of the wireless chip.
[0102] It can be understood that by selecting different forwarding strategies according to the message type and forwarding multiple network layer data messages to the driver layer of the second chip end, flexible forwarding processing of different types of network layer data messages can be achieved, ensuring that data can be transmitted correctly and efficiently in the wireless network.
[0103] Further, according to the message destination address of the network layer data message, the network layer data message is encapsulated to obtain an Ethernet encapsulation message corresponding to the network layer data message, including:
[0104] According to the destination address of the message, the destination physical address corresponding to the destination address of the message is searched in the local database;
[0105] Obtain the Ethernet protocol header according to the destination physical address, message type and source physical address of the network layer data message;
[0106] An Ethernet protocol header is added to the front of a network layer data message to obtain an Ethernet encapsulation message corresponding to the network layer data message; wherein the Ethernet protocol header is filled in a first preset position of a receiving buffer, and the network layer data message is filled in a second preset position of the receiving buffer.
[0107] When the message type of the network layer data message is an Internet Protocol IP message, the specific process of Ethernet encapsulation of the network layer data message is as follows: 1) According to the message destination address, the destination physical address corresponding to the message destination address is searched in the local database, that is, the message destination address is the destination IP address, and the destination physical address is the destination MAC address. The mapping relationship between the IP address and the MAC address in the network is stored in the local database. By searching the information matching the destination IP address through the mapping relationship, the destination MAC address corresponding to the destination IP address can be found. 2) After finding the destination MAC address, the Ethernet protocol header is constructed according to the destination MAC address, the message type and the source MAC address of the network layer data message. 3) After the Ethernet protocol header is constructed, the Ethernet protocol header is added to the front of the network layer data message, so as to obtain the Ethernet encapsulation message corresponding to the network layer data message. In this embodiment, the network layer data message and the Ethernet protocol header are stored in the receiving buffer. The Ethernet protocol header is filled in the first preset position of the receiving buffer, and the first preset position is usually the beginning part of the receiving buffer; the network layer data message is filled in the second preset position of the receiving buffer, and the second preset position is usually the part after the first preset position. like Figure 8 As shown, Figure 8 1 is a schematic diagram of a structure of a receiving buffer provided by an embodiment of the present application. Figure 8 In the embodiment, when the message type of the network layer data message is an Internet Protocol IP message, the receiving buffer S1 is composed of a buffer S2 and a reserved 14-byte portion; wherein the receiving buffer S1 is used to represent the Ethernet encapsulated message, and the buffer S2 portion (i.e., the second preset position) in the receiving buffer S1 is used to fill the network layer data message; the 14-byte portion (i.e., the first preset position) reserved in front of the buffer S2 portion in the receiving buffer S1 is used to fill the Ethernet protocol header, i.e., including the destination MAC address, message type, and source MAC address of the network layer data message.
[0108] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0109] Corresponding to a wireless network data processing method of the above embodiment, Fig. 9 A schematic structural diagram of a wireless network data processing device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0110] Reference Fig. 9 , the wireless network data processing device 3 of this embodiment includes:
[0111] The acquisition module 31 is used to acquire first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes the message length; the cache information includes the sending buffer generation time and the remaining length of the sending buffer;
[0112] A cache module 32, configured to cache the plurality of network layer data packets to the plurality of sending buffers of the sending queue according to the first message information of the plurality of network layer data packets and the cache information of the sending queue, and obtain a plurality of cache message data corresponding to the plurality of sending buffers; wherein each of the sending buffers caches one cache message data, and each of the cache message data includes a plurality of the network layer data packets;
[0113] The forwarding module 33 is used to respond to the permission to send instruction of the second chip end and send the cached message data of each sending buffer to the second chip end in turn according to the generation time of the plurality of sending buffers;
[0114] It can be understood that the embodiment of the present application provides a wireless network data processing device 3, which obtains the first message information of multiple network layer data messages of the first chip end and the cache information of the sending queue through the acquisition module 31; wherein the first message information includes the message length; the cache information includes the generation time of multiple sending buffers and the remaining length of the current sending buffer; then, the cache module 32 caches multiple network layer data messages to multiple sending buffers of the sending queue according to the first message information of the multiple network layer data messages and the cache information of the sending queue, and obtains multiple cache message data corresponding to the multiple sending buffers; wherein each sending buffer caches a cache message data, and each cache message data includes multiple network layer data messages; finally, the forwarding module 33 responds to the permission to send instruction of the second chip end, and sends the cache message data of each sending buffer to the second chip end in turn according to the generation time of multiple sending buffers. In the data forwarding process, compared with sending only one network layer data message at a time, sending multiple network layer data messages at a time can improve the forwarding efficiency of the network layer data message by reducing the number of message sending and receiving, thereby improving the Internet access speed of the wireless hotspot sharing wireless network.
[0115] Furthermore, the wireless network data processing device 3 includes:
[0116] A sending buffer status determination module is used to determine the status type of the current sending buffer in the sending queue based on the number of network layer data packets cached in the current sending buffer, wherein the status type includes a first state and a second state, the first state is used to indicate that there are multiple network layer data packets cached in the current sending buffer, and the second state is used to indicate that no network layer data packets are cached in the current sending buffer.
[0117] Furthermore, the cache module 32 includes:
[0118] A cache position determination submodule, used to determine the cache positions of multiple network layer data messages according to the message lengths of the multiple network layer data messages and the remaining length of the current send buffer of the send queue;
[0119] The message sending submodule is used to cache multiple network layer data messages in multiple sending buffers in sequence according to the cache position, so as to obtain multiple cache message data.
[0120] Further, if the state type of the current sending buffer is the first state, the cache position determination submodule includes:
[0121] A cache position determining first subunit, used to determine the cache position of the network layer data message as the starting position of the next sending buffer according to the message length of the network layer data message being greater than the remaining length of the current sending buffer; wherein the next sending buffer is a sending buffer newly generated at the end of the sending queue; and,
[0122] The cache position determines the second subunit, which is used to determine the cache position of the network layer data message as the remaining space in the current sending buffer according to the message length of the network layer data message being less than or equal to the remaining length of the current sending buffer.
[0123] Furthermore, the wireless network data processing device 3 includes:
[0124] The cache position determines the third subunit, which is used to determine the cache position of the network layer data message as the starting position of the current sending buffer if the state type of the current sending buffer is the second state.
[0125] Furthermore, the wireless network data processing device 3 also includes:
[0126] A second acquisition module, used to acquire second message information of the plurality of network layer data messages at the second chip end; wherein the second message information includes a message type, a message destination address and a message source physical address;
[0127] The second forwarding module is used to forward the plurality of network layer data messages to the driver layer of the second chip end according to the message type.
[0128] Furthermore, the second forwarding module includes:
[0129] A first message forwarding submodule is used for encapsulating the network layer data message according to the message destination address of the network layer data message to obtain an Ethernet encapsulation message corresponding to the network layer data message if the message type is an Internet Protocol IP message; and
[0130] Forwarding the Ethernet encapsulated message directly to the driver layer of the second chip end;
[0131] The second message forwarding submodule is used to forward the network layer data message to the driver layer of the second chip end through the network protocol layer if the message type is other than the IP message.
[0132] Furthermore, the first message forwarding submodule includes:
[0133] The physical address search subunit is used to search the local database for the destination physical address corresponding to the destination address of the message according to the destination address of the message;
[0134] The Ethernet protocol header determination subunit is used to obtain the Ethernet protocol header according to the destination physical address, the message type and the source physical address of the network layer data message;
[0135] The Ethernet message determination subunit is used to add the Ethernet protocol header to the front of the network layer data message to obtain the Ethernet encapsulation message corresponding to the network layer data message; wherein the Ethernet protocol header is filled in the first preset position of the receiving buffer, and the network layer data message is filled in the second preset position of the receiving buffer.
[0136] It should be noted that the information interaction, execution process, etc. between the modules in the above-mentioned wireless network data processing device 3 are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0137] The present application also provides an electronic device, such as Fig.10 As shown, Fig.10 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.10 The electronic device 4 of this embodiment includes: a memory 41, a processor 42, and a computer program stored in the memory 41 and executable on the processor 42. When the processor 42 executes the computer program, the steps of any one of the above-mentioned wireless network data processing method embodiments are implemented.
[0138] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0139] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0142] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0143] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0145] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A wireless network data processing method, characterized in that: include: Acquire first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes message length; the cache information includes generation time of multiple sending buffers and remaining length of the current sending buffer; According to the first message information of multiple network layer data messages and the cache information of the sending queue, the multiple network layer data messages are cached in multiple sending buffers of the sending queue to obtain multiple cache message data corresponding to the multiple sending buffers; wherein each of the sending buffers caches one cache message data, and each of the cache message data includes multiple network layer data messages; In response to the permission to send instruction from the second chip end, the cached message data of each of the sending buffers is sent to the second chip end in sequence according to the generation time of the plurality of sending buffers.
2. The wireless network data processing method according to claim 1, characterized in that: Before caching the plurality of network layer data packets into the plurality of sending buffers of the sending queue according to the first packet information of the plurality of network layer data packets and the buffer information of the sending queue, and obtaining the plurality of buffer packet data corresponding to the plurality of sending buffers, the method comprises: According to the number of the network layer data packets cached in the current sending buffer, the state type of the current sending buffer in the sending queue is determined, wherein the state type includes a first state and a second state, the first state is used to indicate that a plurality of the network layer data packets are cached in the current sending buffer, and the second state is used to indicate that the network layer data packet is not cached in the current sending buffer.
3. The wireless network data processing method according to claim 2, characterized in that: The method of caching the plurality of network layer data packets into the plurality of sending buffers of the sending queue according to the first packet information of the plurality of network layer data packets and the cache information of the sending queue, and obtaining the plurality of cache packet data corresponding to the plurality of sending buffers, comprises: Determining cache locations of the plurality of network layer data messages according to the message lengths of the plurality of network layer data messages and the remaining length of the current send buffer of the send queue; According to the cache position, the plurality of network layer data messages are sequentially cached into the plurality of sending buffers to obtain a plurality of cache message data.
4. The wireless network data processing method according to claim 3, characterized in that: If the state type of the current sending buffer is the first state, determining the cache locations of the plurality of network layer data messages according to the message lengths of the plurality of network layer data messages and the remaining length of the current sending buffer of the sending queue includes: According to the message length of the network layer data message being greater than the remaining length of the current sending buffer, determining the cache position of the network layer data message as the starting position of the next sending buffer; wherein the next sending buffer is the sending buffer newly generated at the end of the sending queue; and, According to the message length of the network layer data message being less than or equal to the remaining length of the current sending buffer, the cache location of the network layer data message is determined to be the remaining space in the current sending buffer.
5. The wireless network data processing method according to claim 3, characterized in that: The method comprises: If the state type of the current sending buffer is the second state, the cache position of the network layer data message is determined to be the starting position of the current sending buffer.
6. The wireless network data processing method according to claim 1, wherein: The method further comprises: Acquire second message information of the plurality of network layer data messages on the second chip side; wherein the second message information includes a message type, a message destination address, and a message source physical address; According to the message type, the plurality of network layer data messages are forwarded to the driver layer of the second chip end.
7. The wireless network data processing method according to claim 6, characterized in that: The forwarding of the plurality of network layer data messages to the driver layer of the second chip end according to the message type includes: If the message type is an Internet Protocol IP message, encapsulating the network layer data message according to the message destination address of the network layer data message to obtain an Ethernet encapsulation message corresponding to the network layer data message; and, Forwarding the Ethernet encapsulated message directly to the driver layer of the second chip end; If the message type is other than the IP message, the network layer data message is forwarded to the driver layer of the second chip end through the network protocol layer.
8. The wireless network data processing method according to claim 7, characterized in that: The encapsulating the network layer data message according to the message destination address of the network layer data message to obtain the Ethernet encapsulation message corresponding to the network layer data message includes: According to the message destination address, searching in a local database to obtain a destination physical address corresponding to the message destination address; Obtaining an Ethernet protocol header according to the destination physical address, the message type and the source physical address of the network layer data message; The Ethernet protocol header is added to the front of the network layer data message to obtain the Ethernet encapsulation message corresponding to the network layer data message; wherein the Ethernet protocol header is filled in a first preset position of the receiving buffer, and the network layer data message is filled in a second preset position of the receiving buffer.
9. A wireless network data processing device, characterized in that: include: An acquisition module, used to acquire first message information of multiple network layer data messages of the first chip end and cache information of the sending queue; wherein the first message information includes message length; the cache information includes sending buffer generation time and sending buffer remaining length; A cache module, used for caching a plurality of network layer data packets to a plurality of sending buffers of the sending queue according to the first message information of the plurality of network layer data packets and the cache information of the sending queue, and obtaining a plurality of cache message data corresponding to the plurality of sending buffers; wherein each of the sending buffers caches one cache message data, and each of the cache message data includes a plurality of the network layer data packets; The forwarding module is used to respond to the permission to send instruction of the second chip end and send the cached message data of each sending buffer to the second chip end in turn according to the generation time of multiple sending buffers.
10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.