Master device, wireless communication device, data transmission system and method

By introducing a socket cache structure into the main device and wireless communication device, data transmission is directly transmitted through the storage address, the problem of multiple data copies in the wireless LAN is solved, and data transmission efficiency and CPU performance are improved.

CN115426641BActive Publication Date: 2025-07-11BEIJING ESWIN COMPUTING TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211052375.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2025-07-11
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

In a wireless LAN, there are multiple data copying problems during the data transmission between the main device and the wireless communication device, which affects the data transmission efficiency and CPU performance.

Method used

By introducing a socket cache structure in the main device and the wireless communication device, the attribute information and storage address information of the data to be transmitted are recorded, and data transmission is directly carried out through the storage address, reducing the number of data copying times.

Benefits of technology

Improve data transmission efficiency, reduce CPU resource usage, and improve data transmission performance and throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115426641B_ABST
    Figure CN115426641B_ABST
Patent Text Reader

Abstract

The present application discloses a master device, a wireless communication device, a data transmission system and a method, which relate to the field of communication technologies. The main purpose is to reduce the number of data copies during data transmission, thereby improving the data transmission efficiency. The master device includes: a driving module, configured to set a socket buffer structure for the data to be transmitted, wherein the socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted; a transmission module, configured to transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and particularly to a master device, a wireless communication device, a data transmission system, and a method. Background Art

[0002] In a wireless local area network, communication between a master device and a wireless communication device is carried out via a bus. The master device is used to generate data and transmit the data to the wireless communication device via the bus. A Wifi (Wireless Fidelity) chip operates in the wireless communication device, and the wireless communication device is used to provide a data path to transmit the data provided by the master device to a data receiving device via the data path.

[0003] Currently, when data is transmitted from the master device to the wireless communication device, the data needs to be first copied from the storage area of the master device's driver module (WiFi driver) to the storage area of the master device's usb (Universal Serial Bus) module, and then the usb module of the master device transmits the data from its own storage area to the wireless communication device. The wireless communication device receives the data transmitted by the master device through its own wireless communication device usb module, stores the received data in the storage area of the wireless communication device usb module, and then when the wireless communication device needs to process data transmission, the WiFi mac layer of the wireless communication device copies the data from the storage area of the wireless communication device usb module to its own storage area, and then processes the data stored in its own storage area for data transmission.

[0004] It can be seen that when the master device and the wireless communication device perform data transmission processing, there is a problem of copying data multiple times, which directly affects the efficiency of data transmission. Summary of the Invention

[0005] In view of this, this application proposes a master device, a wireless communication device, a data transmission system, and a method, in order to reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0006] To achieve the above object, this application mainly provides the following technical solutions:

[0007] In a first aspect, this application provides a master device, which includes: a driver module, configured to set a socket buffer structure for data to be transmitted, where the socket buffer structure is used to record attribute information of the data to be transmitted and storage address information of a storage area for storing the data to be transmitted; a transmission module, configured to transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to a wireless communication device.

[0008] The master device provided by the present application, when there is data to be transmitted in the master device, the driving module sets a socket cache structure for the data to be transmitted, and the socket cache structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted. When it is necessary to transmit the data to be transmitted to the wireless communication device, the transmission module transmits the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device. It can be seen that the master device provided by the present application stores data through the socket cache structure and the storage area pointed to by the socket cache structure. When the master device needs to transmit data to the wireless communication device, the transmission module does not need to copy the data, and can directly extract the data in the corresponding storage area through the storage address information recorded in the socket cache structure for transmission. Therefore, the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0009] In some embodiments, the driving module includes: a transmission unit, configured to start from the character corresponding to the head character position in the socket cache structure, and sequentially transmit characters to the transmission module according to the storage order of the characters in the socket cache structure until the cumulative length of the transmitted characters reaches a preset length, wherein the characters transmitted to the transmission module constitute the attribute information and the storage address information.

[0010] In some embodiments, the master device further includes: a recycling module, configured to recycle the socket cache structure of the data to be transmitted and clear the data to be transmitted stored in the storage area when receiving the feedback that the attribute information and the data to be transmitted transmitted by the wireless communication device are successfully transmitted.

[0011] In some embodiments, the recycling module includes: a recycling unit, configured to clear the attribute information and the storage address information corresponding to the data to be transmitted in the socket cache structure.

[0012] In some embodiments, the driving module includes: a detection unit, configured to detect whether there is an available socket cache structure, where the storage area corresponding to the available socket cache structure is not occupied by data; if it is determined that there is an available socket cache structure, select a target socket cache structure from the available socket cache structures; a setting unit, configured to, when the data to be transmitted is written into the storage area corresponding to the target socket cache structure, encapsulate the storage address information of the storage area through the target socket cache structure to form a socket cache structure for the data to be transmitted.

[0013] In some embodiments, the driving module further includes: an application unit, configured to send an application for establishing a new socket cache structure to the establishment unit when the detection unit determines that there is no available socket cache structure; an establishment unit, configured to determine whether to establish a new socket cache structure based on the application.

[0014] Second aspect, the present application provides a wireless communication device, which includes: a receiving module, configured to write data to be transmitted into a storage area and provide the storage address of the storage area to a processing module, where the storage area belongs to the shared storage space of the receiving module and the processing module; a processing module, configured to extract the data to be transmitted from the storage area corresponding to the storage address and perform data transmission processing on the data to be transmitted.

[0015] For the wireless communication device provided by the present application, when the wireless communication device receives the data to be transmitted and the attribute information of the data to be transmitted from the master device, the receiving module writes the data to be transmitted and the attribute information into the storage area in the shared storage space of the receiving module and the processing module, and provides the storage address of the storage area to the processing module. When it is necessary to transmit the data to be transmitted to the data receiving device, the processing module directly extracts the data to be transmitted and the attribute information from the storage area corresponding to the storage address, and performs data transmission processing on the data to be transmitted based on the attribute information. It can be seen that in the wireless communication device provided by the embodiments of the present application, the receiving module and the processing module share the storage space. When the wireless communication device needs to transmit data to the data receiving device, the processing module does not need to copy the data. It can directly extract the data in the corresponding storage area through the storage address for transmission processing. Therefore, the embodiments of the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0016] In some embodiments, the receiving module includes: an allocation unit, configured to select a target storage area from the unoccupied storage areas of the storage area; and allocate the target storage area as the storage area for storing the data to be transmitted and the attribute information.

[0017] In some embodiments, the processing module is further configured to clear the data to be transmitted and the attribute information in the storage area corresponding to the storage address after performing data transmission processing on the data to be transmitted based on the attribute information.

[0018] Third aspect, the present application provides a data transmission system, which includes: the master device of the first aspect and the wireless communication device of the second aspect.

[0019] For the beneficial effects of the third aspect, please refer to the beneficial effects of the first aspect and the second aspect, which will not be elaborated here.

[0020] Fourth aspect, the present application provides a data transmission method, which is applied to the master device, and the method includes:

[0021] Set a socket buffer structure for the data to be transmitted, where the socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted;

[0022] Transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to a wireless communication device.

[0023] In the data transmission method provided by this application, when there is data to be transmitted in the master device, a socket cache structure for the data to be transmitted is set up. This socket cache structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area where the data to be transmitted is stored. When it is necessary to transmit the data to be transmitted to a wireless communication device, the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information are transmitted to the wireless communication device. It can be seen that the master device provided by this application stores data through the socket cache structure and the storage area pointed to by the socket cache structure. When the master device needs to transmit data to a wireless communication device, there is no need to copy the data. Instead, the data in the corresponding storage area can be directly extracted for transmission through the storage address information recorded in the socket cache structure. Therefore, this application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0024] In some embodiments, transmitting the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to a wireless communication device includes: starting from the character corresponding to the head character position in the socket cache structure, sequentially transmitting characters to the transmission module of the master device according to the storage order of the characters in the socket cache structure until the cumulative length of the transmitted characters reaches a preset length. Among them, the characters transmitted to the transmission module constitute the attribute information and the storage address information; and the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information are transmitted to the wireless communication device through the transmission module.

[0025] In some embodiments, this data transmission method further includes: when receiving the feedback that the attribute information and the data to be transmitted transmitted by the wireless communication device are successfully transmitted, recycling the socket cache structure of the data to be transmitted and clearing the data to be transmitted stored in the storage area.

[0026] In some embodiments, recycling the socket cache structure of the data to be transmitted includes: clearing the attribute information and the storage address information corresponding to the data to be transmitted in the socket cache structure.

[0027] In some embodiments, a socket cache structure for data to be transmitted is set up, including: detecting whether there is an available socket cache structure, where the storage area corresponding to the available socket cache structure is not occupied by data; if it is determined that there is an available socket cache structure, selecting a target socket cache structure from the available socket cache structures, and when writing the data to be transmitted into the storage area corresponding to the target socket cache structure, encapsulating the storage address information of the storage area through the target socket cache structure to form a socket cache structure for the data to be transmitted.

[0028] In some embodiments, the data transmission method further includes: when it is determined that there is no available socket cache structure, determining whether to establish a new socket cache structure.

[0029] In a fifth aspect, the present application provides a data transmission method, which is applied to a wireless communication device. The wireless communication device includes a receiving module and a processing module. The data transmission method includes:

[0030] Writing the data to be transmitted and the attribute information of the data to be transmitted into a storage area, where the storage area belongs to the shared storage space of the receiving module and the processing module;

[0031] Extracting the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and performing data transmission processing on the data to be transmitted based on the attribute information.

[0032] In the data transmission method provided by the present application, when the wireless communication device receives the data to be transmitted and the attribute information of the data to be transmitted from the master device, the data to be transmitted and the attribute information are written into the storage area in the shared storage space of the receiving module and the processing module. When it is necessary to transmit the data to be transmitted to the data receiving device, the processing module directly extracts the data to be transmitted and the attribute information from the storage area corresponding to the storage address, and performs data transmission processing on the data to be transmitted based on the attribute information. It can be seen that in the shared storage space of the receiving module and the processing module in the wireless communication device provided by the present application, when the wireless communication device needs to transmit data to the data receiving device, the processing module does not need to copy the data, and directly extracts the data in the corresponding storage area through the storage address for transmission processing. Therefore, the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0033] In some embodiments, writing the data to be transmitted and the attribute information of the data to be transmitted into the storage area includes: selecting a target storage area from the unoccupied storage areas of the storage area; allocating the target storage area as the storage area for storing the data to be transmitted and the attribute information.

[0034] In some embodiments, the data transmission method further includes: after performing data transmission processing on the data to be transmitted based on the attribute information, clearing the data to be transmitted and the attribute information in the storage area corresponding to the storage address.

[0035] In a sixth aspect, a chip is provided. The chip includes a processor for executing the method described in the fourth or fifth aspect above. The chip may further include a communication interface for communicating with other devices, and the chip may further include a memory for storing programs or instructions executed by the processor.

[0036] The above description is only an overview of the technical solutions of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented in accordance with the content of the description. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically described below. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0038] Figure 1 FIG. 1 shows one of the structural diagrams of the master device provided by the embodiment of the present application;

[0039] Figure 2 FIG. 2 shows another structural diagram of the master device provided by the embodiment of the present application;

[0040] Figure 3 FIG. 3 shows one of the structural diagrams of the wireless communication device provided by the embodiment of the present application;

[0041] Figure 4 FIG. 4 shows another structural diagram of the wireless communication device provided by the embodiment of the present application;

[0042] Figure 5 FIG. 5 shows a schematic diagram of the data transmission process provided by the embodiment of the present application;

[0043] Figure 6 FIG. 6 shows a structural diagram of the data transmission system provided by the embodiment of the present application;

[0044] Figure 7 FIG. 7 shows one of the flowcharts of the data transmission method provided by the embodiment of the present application;

[0045] Figure 8Shows the second flowchart of the data transmission method provided by the embodiments of the present application. Detailed implementation manners

[0046] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0047] In a wireless local area network, communication is carried out between a master device and a wireless communication device through a bus. The master device is used to generate data and transmit the data to the wireless communication device through the bus. The Wifi chip operates in the wireless communication device, and the wireless communication device is used to provide a data path to transmit the data provided by the master device to a data receiving device through the data path.

[0048] The specific types of the above-mentioned master device, wireless communication device, and data receiving device are not limited in the embodiments of the present application and are related to specific application scenarios. Exemplarily, the master device is an electronic device for generating data, the wireless communication device is a wireless network card, and the data receiving device is a router.

[0049] Currently, when data is transmitted from the master device to the wireless communication device, the data needs to be first copied from the storage area of the driver module of the master device to the storage area of the usb module of the master device, and then the usb module of the master device transmits the data from its own storage area to the wireless communication device. The wireless communication device receives the data transmitted by the master device through its own wireless communication device usb module and stores the received data in the storage area of the wireless communication device usb module. Then, when the wireless communication device needs to perform data transmission processing on the data, the WiFi mac layer of the wireless communication device copies the data from the storage area of the wireless communication device usb module to its own storage area, and then performs data transmission processing on the data stored in its own storage area.

[0050] When the master device and the wireless communication device perform data transmission processing, there is a problem of copying data multiple times. The data copying in the master device occupies the CPU in the master device, which not only affects the performance of the CPU, but also affects the data transmission efficiency. The CPU of the wireless communication device has relatively low performance itself, and the data copying seriously drags down the performance of the CPU, resulting in relatively low data transmission efficiency, which in turn affects the throughput of the wireless communication device, resulting in low throughput.

[0051] To solve the problem of multiple data copies during data transmission processing between the master device and the wireless communication device, the embodiments of the present application provide a master device, a wireless communication device, a data transmission system, and a method, aiming to reduce the number of data copies during the data transmission process between the master device and the wireless communication device, thereby improving the data transmission efficiency. The embodiments of the present application do not limit the specific type of the master device. In practical applications, any electronic device that generates data and needs to transmit the data to the data receiving device can be used as the master device provided by the embodiments of the present application. The embodiments of the present application do not limit the specific type of the wireless communication device. In practical applications, any wireless communication device equipped with a Wifi chip and capable of providing a data path can be used as the wireless communication device provided by the embodiments of the present application.

[0052] The following specifically describes the master device, the wireless communication device, the data transmission system, and the method provided by the embodiments of the present application.

[0053] As Figure 1 shown, the embodiments of the present application provide a master device, which mainly includes: a driver module 11 and a transmission module 12.

[0054] The driver module 11 is used to set a socket buffer structure for the data to be transmitted, where the socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area for storing the data to be transmitted.

[0055] The transmission module 12 is used to transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device.

[0056] The following specifically describes the specific structures and interaction relationships of the components involved in the master device:

[0057] Driver module 11:

[0058] The driver module 11 is the WiFi driver in the master device. In one embodiment, the driver module 11 and the transmission module 12 share the same storage space, which can reduce the number of data copies during the process of the master device transmitting data to the wireless communication device. The driver module 11 and the transmission module 12 sharing the same storage space can be achieved through the socket buffer.

[0059] Socket buffer (skb), which consists of the following two parts: one is the socket buffer structure, which is used to record relevant information of the data to be transmitted; the other is the storage area, which is used to store the data to be transmitted. The socket buffer structure and the storage area need to be used in cooperation. Therefore, when storing the data to be transmitted in the storage area corresponding to the socket buffer structure, the socket buffer structure needs to point to the corresponding storage area so that the data to be transmitted in the storage area can be located through the socket buffer structure. The above socket buffer structure points to the corresponding storage area and is implemented through the relevant information recorded by the socket buffer structure. Therefore, the relevant information recorded by the socket buffer structure is the attribute information of the data to be transmitted stored in the corresponding storage area and the storage address information of the storage area storing the data to be transmitted.

[0060] The attribute information of the data to be transmitted is the necessary information required for the processing module in the wireless communication device to perform data transmission processing. The specific content included in the attribute information can be determined based on service requirements, and this embodiment does not make specific limitations. Exemplarily, the attribute information includes the name, data length, and belonging priority of the data to be transmitted.

[0061] When generating the data to be transmitted in the master device, it is necessary to allocate a socket buffer structure for the data to be transmitted so that the data to be transmitted can be stored in the shared storage space of the driver module 11 and the transmission module 12. The driver module 11 can allocate a socket buffer structure for the data to be transmitted through the following structure. As Figure 2 shown, the driver module 11 includes: a detection unit 111, which is used to detect whether there is an available socket buffer structure, where the storage area corresponding to the available socket buffer structure is not occupied by data; if it is determined that there is an available socket buffer structure, select a target socket buffer structure from the available socket buffer structures. A setting unit 112, which is used to encapsulate the storage address information of the storage area through the target socket buffer structure when writing the data to be transmitted into the storage area corresponding to the target socket buffer structure, so as to form a socket buffer structure for the data to be transmitted.

[0062] The socket buffer structure needs to be used in cooperation with the storage area because the shared storage space of the driver module 11 and the transmission module 12 is limited. Limited by the size of the storage space, the number of storage areas divided from the storage space is limited, so the preset socket buffer structures are limited. Therefore, when there is data to be transmitted, the detection unit 111 needs to detect whether there is an available socket buffer structure.

[0063] When the detection unit 111 determines that there is no available socket buffer structure, it means that the storage areas corresponding to all the preset socket buffer structures are occupied by data. In order to be able to store the data to be transmitted, as Figure 2As shown in the figure, the driving module 11 further includes: an application unit 113, configured to send an application for establishing a new socket cache structure to the establishment unit 114 when the detection unit 111 determines that there is no available socket cache structure. An establishment unit 114, configured to determine whether to establish a new socket cache structure based on the application.

[0064] When the detection unit 111 determines that there is no available socket cache structure, the application unit 113 sends an application for establishing a new socket cache structure to the establishment unit 114, so as to store the data to be transmitted as soon as possible. The establishment unit 114 determines whether to establish a new socket cache structure based on the application. The specific process for the establishment unit 114 to determine whether to establish a new socket cache structure may be: detecting whether a new storage area can be divided from the shared storage space of the driving module 11 and the transmission module 12. If the establishment unit 114 detects that a new storage area can be divided, it indicates that there is still space to store the data to be transmitted. Then, a new storage area is divided, and the socket cache structure corresponding to the divided storage area is set. The newly set socket cache structure is allocated for use by the data to be transmitted. After the data to be transmitted is successfully transmitted to the wireless communication device, the processing methods for the newly set socket cache structure include the following two: First, since the newly set socket cache structure is used to store the data to be transmitted as soon as possible and its subsequent usage probability is low, the newly set socket cache structure is directly deleted, and the corresponding storage area is recycled. Second, if the newly set socket cache structure indicates that the number of previously preset socket cache structures is insufficient, the newly set socket cache structure is retained for subsequent data to be transmitted. If the establishment unit 114 detects that a new storage area cannot be divided, it indicates that there is not enough space to store the data to be transmitted. Therefore, the detection unit 111 is notified to continue detecting whether there is an available socket cache structure, so as to timely discover an available socket cache structure and allocate it to the data to be transmitted when there is a released socket cache structure.

[0065] When the detection unit 111 determines that there is an available socket cache structure, it indicates that there is still a storage area corresponding to the socket cache structure that is not occupied by data. These unoccupied storage areas can store the data to be transmitted. Therefore, a target socket cache structure is selected from the available socket cache structures, and the storage area corresponding to the target socket cache structure is used to store the data to be transmitted, and a socket cache structure for the data to be transmitted is formed based on the target socket cache structure.

[0066] After the setting unit 112 selects the target socket buffer structure for the data to be transmitted by the detection unit 111, it writes the data to be transmitted into the storage area corresponding to the target socket buffer structure to complete the storage of the data to be transmitted. When the setting unit 112 writes the data to be transmitted into the storage area corresponding to the target socket buffer structure, it encapsulates the storage address information of the storage area through the target socket buffer structure to form a socket buffer structure for the data to be transmitted. The formed socket buffer structure includes not only the storage address information of the storage area corresponding to the target socket buffer structure, but also the attribute information of the data to be transmitted. The existence forms of the attribute information and the storage address in the socket buffer structure can be: sw thd+payload. Among them, swthd is the attribute information and payload is the storage address information.

[0067] After the driver module 11 sets the socket buffer structure for the data to be transmitted, it needs to provide the attribute information of the data to be transmitted recorded in the socket buffer structure and the storage address information of the storage area storing the data to be transmitted to the transmission module 12, so that when the transmission module 12 needs to transmit the data to be transmitted to the wireless communication device, it can extract the data to be transmitted from the corresponding storage area based on the attribute information and the storage address information for transmission.

[0068] As Figure 2 shown, the driver module 11 includes: a transmission unit 115, configured to start from the character corresponding to the head character position in the socket buffer structure and sequentially transmit characters to the transmission module according to the storage order of the characters in the socket buffer structure until the cumulative length of the transmitted characters reaches a preset length, where the characters transmitted to the transmission module constitute the attribute information and the storage address information.

[0069] When the socket buffer structure records the attribute information and the storage address information, it usually starts recording from the head character position "skb->data". Therefore, the transmission unit 115 starts from the character corresponding to the head character position "skb->data" in the socket buffer structure and sequentially transmits characters to the transmission module according to the storage order of the characters in the socket buffer structure until the cumulative length of the transmitted characters reaches the preset length "skb->len". This transmission method can ensure that the characters transmitted to the transmission module 12 constitute the attribute information and the storage address information, so that the transmission module 12 can extract the data to be transmitted from the corresponding storage area for transmission.

[0070] Transmission module 12:

[0071] The transmission module 12 is a module in the master device that transmits data to the wireless communication device, and it can be a USB module. Since the transmission module 12 and the driver module 11 share the same storage space, when the transmission module 12 needs to transmit the data to be transmitted to the wireless communication device, it does not need to copy the data to be transmitted. Instead, when the transmission module 12 needs to transmit the data to be transmitted to the wireless communication device, it extracts the data to be transmitted from the corresponding storage area according to the storage address information of the data to be transmitted, and transmits the attribute information and the extracted data to be transmitted to the wireless communication device, so that the wireless communication device can perform transmission processing on the data to be transmitted based on the attribute information.

[0072] In the master device provided by the embodiment of the present application, when there is data to be transmitted in the master device, the driver module sets a socket buffer structure for the data to be transmitted, and this socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted. When it is necessary to transmit the data to be transmitted to the wireless communication device, the transmission module transmits the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device. It can be seen that the master device provided by the embodiment of the present application stores data through the socket buffer structure and the storage area pointed to by the socket buffer structure. When the master device needs to transmit data to the wireless communication device, the transmission module does not need to copy the data, and can directly extract the data in the corresponding storage area through the storage address information recorded in the socket buffer structure for transmission. Therefore, the embodiment of the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0073] Furthermore, in order to be able to recycle the socket buffer structure and the storage area pointed to by the socket buffer structure, as Figure 2 shown, the master device further includes: a recycling module 13, which is used to recycle the socket buffer structure of the data to be transmitted and clear the data to be transmitted stored in the storage area when receiving the feedback that the attribute information and the data to be transmitted transmitted by the wireless communication device are successfully transmitted.

[0074] After the data to be transmitted and its attribute information are successfully transmitted to the wireless communication, the wireless communication device will transmit the feedback that the attribute information and the data to be transmitted are successfully transmitted to the master device to notify the master device that the data to be transmitted and its attribute information have been successfully received by the wireless communication device. After the data to be transmitted and its attribute information are successfully transmitted to the wireless communication, the data to be transmitted does not need to be stored in the shared storage space of the transmission module 12 and the driver module 11. Therefore, the recycling module 13 needs to recycle the socket buffer structure and the storage area pointed to by the socket buffer structure for subsequent use by new data to be transmitted.

[0075] When the recycling module 13 recycles the storage area pointed to by the socket buffer structure, the data to be transmitted stored in the storage area is cleared. When the recycling module 13 recycles the socket buffer structure, it is implemented through the recycling unit 131 included therein. As Figure 2 shown, the recycling module 13 includes: a recycling unit 131, configured to clear the attribute information and storage address information corresponding to the data to be transmitted in the socket buffer structure. The process by which the recycling unit 131 clears the attribute information and storage address information corresponding to the data to be transmitted in the socket buffer structure is as follows: starting from the position corresponding to the head character position in the socket buffer structure, moving n bytes in the target direction, and deleting all the bytes involved in the movement. Moving n bytes indicates that the covered bytes have constituted the attribute information and storage address information, so deleting these characters clears the attribute information and storage address information. Here, the target direction is determined according to the position of the characters of the attribute information and storage address information relative to the head character position. For example, the target direction is to the left.

[0076] As Figure 3 shown, an embodiment of the present application provides a wireless communication device, which mainly includes: a receiving module 21 and a processing module 22.

[0077] The receiving module 21 is configured to write the data to be transmitted and the attribute information of the data to be transmitted into the storage area, and provide the storage address of the storage area to the processing module, where the storage area is a storage area shared by the receiving module 21 and the processing module 22.

[0078] The processing module 22 is configured to extract the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and perform data transmission processing on the data to be transmitted based on the attribute information.

[0079] The following specifically describes the specific structures and interaction relationships of the components involved in the wireless communication device:

[0080] Receiving module 21:

[0081] The receiving module 21 is a module in the wireless communication device that receives data transmitted by the master device, and it can be a USB module. In order to reduce the number of data copies during the data transmission process of the wireless communication device, the receiving module 21 and the processing module 22 share the same storage space.

[0082] The receiving module 21 needs to allocate a storage area for the received data to be transmitted and the attribute information of the data to be transmitted, and write the data to be transmitted into the allocated storage area. The storage area is obtained by dividing the storage space shared by the receiving module 21 and the processing module 22. As Figure 4As shown in the figure, the receiving module 21 includes: an allocation unit 211, which is used to select a target storage area from the unoccupied storage areas in the storage area; and allocate the target storage area as a storage area for storing the data to be transmitted and the attribute information of the data to be transmitted.

[0083] The mechanism for the allocation unit 211 to allocate storage areas includes the following two types: One is that when receiving the data to be transmitted and the attribute information of the data to be transmitted from the master device, allocate corresponding storage areas for the data to be transmitted and the attribute information of the data to be transmitted. The other is that in order to improve data storage efficiency, the allocation unit 211 adopts a pre-allocation mechanism, that is, before receiving the data to be transmitted and the attribute information of the data to be transmitted from the master device, pre-allocate a storage area, and once receiving the data to be transmitted and the attribute information of the data to be transmitted from the master device, directly write the received data to be transmitted and the attribute information of the data to be transmitted into the pre-allocated storage area.

[0084] After the receiving module 21 writes the data to be transmitted and the attribute information of the data to be transmitted into the storage area, in order for the processing module 22 to be able to extract the data to be transmitted and the attribute information of the data to be transmitted, the receiving module 21 provides the storage address of the storage area to the processing module 22.

[0085] Processing module 22:

[0086] The processing module 22 is a wireless transmission module in the wireless communication device, that is, the WiFi mac layer. In order to reduce the number of data copies during the data transmission process of the wireless communication device, the receiving module 21 and the processing module 22 share the same storage space. Therefore, when the processing module 22 needs to process the data to be transmitted, the processing module 22 extracts the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and performs data transmission processing on the data to be transmitted based on the attribute information.

[0087] The attribute information of the data to be transmitted is necessary information for the processing module 22 in the wireless communication device to perform data transmission processing. The specific content included in the attribute information can be determined based on service requirements, and this embodiment does not make specific limitations. Exemplarily, the attribute information includes the name of the data to be transmitted, the data length, and the belonging priority. After the processing module 22 obtains the data to be transmitted and the attributes of the data to be transmitted, it can perform data aggregation processing on the data to be transmitted based on the attribute information, and transmit the aggregated data to the data receiving device.

[0088] Further, in order to be able to recycle the storage area, the processing module 22 is also used to clear the data to be transmitted and the attribute information in the storage area corresponding to the storage address after performing data transmission processing on the data to be transmitted based on the attribute information.

[0089] After the data to be transmitted is successfully transmitted to the data receiving device, the data receiving device will transmit a feedback of successful data transmission to the wireless communication device to notify the wireless communication device that the data has been successfully received by the data receiving device. After the data to be transmitted is successfully transmitted to the data receiving device, the data to be transmitted and the attribute information of the data to be transmitted do not need to be stored in the shared storage space of the receiving module 21 and the processing module 22. Therefore, after the processing module 22 completes the data transmission processing on the data to be transmitted, it clears the data to be transmitted and the attribute information of the data to be transmitted in the storage area corresponding to the storage address for use by subsequent new data to be transmitted.

[0090] The following uses Figure 5 to illustrate the data transmission process: The transmission module of the master device transmits the data to be transmitted and its attribute information to the receiving module 21 of the wireless device at 12, and this transmission process corresponds to Figure 5 31 in Figure 5 32 in Figure 5 Figure 5 Figure 5is represented by 34. After receiving the feedback represented by 34, the processing module 22 clears the data to be transmitted and the attribute information of the data to be transmitted in the storage area corresponding to the storage address for subsequent use by new data to be transmitted. Similarly, the processing module 22 of the wireless communication device will, based on the feedback represented by 34, transmit to the transmission module 12 of the master device the feedback that the attribute information and the data to be transmitted have been successfully transmitted. This feedback is represented by Figure 5 35 and 36 in

[0091] so that the master device, based on this feedback, reclaims the socket buffer structure of the data to be transmitted and clears the data to be transmitted and the attribute information of the data to be transmitted stored in the storage area.

[0092] Further, according to the above embodiment, another embodiment of the present application further provides a data transmission system, as Figure 6 shown. The data transmission system includes: the above-mentioned master device 31 and the above-mentioned wireless communication device 32.

[0093] For the beneficial effects of the data transmission system provided by the embodiments of the present application, please refer to the beneficial effects of the above-mentioned master device and the beneficial effects of the above-mentioned wireless communication device.

[0094] Further, according to the above embodiment, another embodiment of the present application further provides a data transmission method. This data transmission method is applied to the master device, as Figure 7 shown. This data transmission method includes the following steps 401-402:

[0095] 401. Set a socket buffer structure for the data to be transmitted, where the socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted.

[0096] 402. Transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device.

[0097] In the data transmission method provided by the embodiments of the present application, when there is data to be transmitted in the master device, a socket cache structure for the data to be transmitted is set. The socket cache structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted. When it is necessary to transmit the data to be transmitted to the wireless communication device, the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information are transmitted to the wireless communication device. It can be seen that in the master device provided by the embodiments of the present application, data is stored through the socket cache structure and the storage area pointed to by the socket cache structure. When the master device needs to transmit data to the wireless communication device, there is no need to copy the data. Instead, the data in the corresponding storage area can be directly extracted for transmission through the storage address information recorded in the socket cache structure. Therefore, the embodiments of the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0098] In some embodiments, the specific implementation steps of setting the socket cache structure for the data to be transmitted in step 401 above include:

[0099] Detect whether there is an available socket cache structure, where the storage area corresponding to the available socket cache structure is not occupied by data;

[0100] If it is determined that there is an available socket cache structure, select a target socket cache structure from the available socket cache structures. When writing the data to be transmitted into the storage area corresponding to the target socket cache structure, encapsulate the storage address information of the storage area through the target socket cache structure to form a socket cache structure for the data to be transmitted.

[0101] In some embodiments, when it is determined that there is no available socket cache structure, determine whether to establish a new socket cache structure.

[0102] In some embodiments, the specific implementation steps of step 402 for transmitting the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device include: starting from the character corresponding to the head character position in the socket cache structure, sequentially transmit the characters to the transmission module of the master device according to the storage order of the characters in the socket cache structure until the cumulative length of the transmitted characters reaches a preset length. Among them, the characters transmitted to the transmission module constitute the attribute information and the storage address information; transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device through the transmission module.

[0103] In some embodiments, after the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information are transmitted to the wireless communication device in step 402 above, the data transmission method may further include the following steps:

[0104] When receiving the feedback that the attribute information and the data to be transmitted are successfully transmitted from the wireless communication device, recycle the socket buffer structure of the data to be transmitted and clear the data to be transmitted stored in the storage area.

[0105] In some embodiments, the specific implementation steps of recycling the socket buffer structure of the data to be transmitted in the above steps are: clearing the attribute information and the storage address information corresponding to the data to be transmitted in the socket buffer structure.

[0106] Further, according to the above embodiments, another embodiment of the present application further provides a data transmission method, which is applied to a wireless communication device. The wireless communication device includes a receiving module and a processing module. As Figure 8 shown, the data transmission method includes the following steps 501-502:

[0107] 501. Write the data to be transmitted and the attribute information of the data to be transmitted into the storage area, where the storage area belongs to the shared storage space of the receiving module and the processing module.

[0108] 502. Extract the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and perform data transmission processing on the data to be transmitted based on the attribute information.

[0109] In the data transmission method provided by the embodiments of the present application, when the wireless communication device receives the data to be transmitted and the attribute information of the data to be transmitted transmitted by the master device, the data to be transmitted and the attribute information are written into the storage area in the shared storage space of the receiving module and the processing module. When it is necessary to transmit the data to be transmitted to the data receiving device, the processing module directly extracts the data to be transmitted and the attribute information from the storage area corresponding to the storage address, and performs data transmission processing on the data to be transmitted based on the attribute information. It can be seen that in the shared storage space of the receiving module and the processing module in the wireless communication device provided by the embodiments of the present application, when the wireless communication device needs to transmit data to the data receiving device, the processing module does not need to copy the data, and directly extracts the data in the corresponding storage area through the storage address for transmission processing. Therefore, the embodiments of the present application can reduce the number of data copies during the data transmission process, thereby improving the data transmission efficiency.

[0110] In some embodiments, the specific implementation steps of writing the data to be transmitted and the attribute information of the data to be transmitted into the storage area in step 501 above may include: selecting a target storage area from the unoccupied storage area of the storage area; and allocating the target storage area as the storage area for storing the data to be transmitted and the attribute information.

[0111] In some embodiments, after step 501 above extracts the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address and performs data transmission processing on the data to be transmitted based on the attribute information, the data transmission method may further include the following steps: after performing data transmission processing on the data to be transmitted based on the attribute information, clearing the data to be transmitted and the attribute information in the storage area corresponding to the storage address.

[0112] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0113] It can be understood that the relevant features in the above methods and apparatuses can be referred to each other. In addition, the "first", "second", etc. in the above embodiments are used to distinguish the embodiments, and do not represent the advantages or disadvantages of the embodiments.

[0114] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, apparatuses, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0115] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The structure required to construct such a system will be apparent from the above description. In addition, the present application is not directed to any particular programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the description of the specific language above is for the purpose of disclosing the best mode of the present application.

[0116] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.

[0117] In addition, those skilled in the art can understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of the features of different embodiments means that it is within the scope of the present application and forms different embodiments. For example, in the following claims, any one of the claimed embodiments can be used in any combination.

[0118] Each component embodiment of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the method, apparatus, and framework for running a deep neural network model according to the embodiments of the present application. The present application can also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.

[0119] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In the unit claims listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.

Claims

1. A master device, characterized in that, The master device includes: A driving module, configured to set a socket cache structure for the data to be transmitted. The socket cache structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area storing the data to be transmitted, and the socket cache structure is used to implement storing the data to be transmitted into the same storage space shared by the driving module and the transmission module. The socket cache structure points to the storage area corresponding to the data to be transmitted in the storage space; A transmission module, configured to, when the data to be transmitted needs to be transmitted to a wireless communication device, according to the storage address information of the data to be transmitted recorded in the corresponding socket cache structure, transmit the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to a receiving module included in the wireless communication device, for the receiving module to write the data to be transmitted and the attribute into a storage area in the storage space shared by the receiving module and a processing module included in the wireless communication device; the storage space shared by the receiving module and the processing module is used for, when the wireless communication device needs to transmit the data to be transmitted to a data receiving device, enabling the processing module to extract the attribute information from the corresponding storage area to perform data aggregation processing on the data to be transmitted, and transmit the aggregated data to the data receiving device; the attribute information includes the name, data length, and belonging priority of the data to be transmitted.

2. The master device according to claim 1, characterized in that, The driving module includes: A transmission unit, configured to start from the character corresponding to the head character position in the socket cache structure, and sequentially transmit characters to the transmission module according to the storage order of the characters in the socket cache structure until the cumulative length of the transmitted characters reaches a preset length. The characters transmitted to the transmission module constitute the attribute information and the storage address information.

3. The master device according to claim 1, characterized in that, The master device further includes: A recycling module, configured to, when receiving the feedback that the attribute information and the data to be transmitted transmitted by the wireless communication device are successfully transmitted, recycle the socket cache structure of the data to be transmitted and clear the data to be transmitted stored in the storage area.

4. The master device according to claim 3, characterized in that, The recycling module includes: A recycling unit, configured to clear the attribute information and the storage address information corresponding to the data to be transmitted in the socket cache structure.

5. The master device according to any one of claims 1-4, characterized in that, The driving module includes: A detection unit, configured to detect whether there is an available socket cache structure, where the storage area corresponding to the available socket cache structure is not occupied by data; if it is determined that there is an available socket cache structure, select a target socket cache structure from the available socket cache structures; A setting unit, configured to, when the data to be transmitted is written into the storage area corresponding to the target socket cache structure, encapsulate the storage address information of the storage area through the target socket cache structure to form a socket cache structure for the data to be transmitted.

6. The master device according to claim 5, characterized in that, The driving module further includes: An application unit, configured to, when the detection unit determines that there is no available socket cache structure, send an application to a creation unit to create a new socket cache structure; The creation unit, configured to determine whether to create a new socket cache structure based on the application.

7. A wireless communication device, characterized in that, The wireless communication device includes: A receiving module, configured to write the data to be transmitted and the attribute information of the data to be transmitted into a storage area, and provide the storage address of the storage area to a processing module, wherein the storage area belongs to the shared storage space of the receiving module and the processing module, and is obtained based on the division of the shared storage space; The processing module is configured to, when it is necessary to transmit the data to be transmitted to a data receiving device, extract the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and perform data transmission processing on the data to be transmitted based on the attribute information; wherein, performing data transmission processing on the data to be transmitted based on the attribute information includes: performing data aggregation processing on the data to be transmitted based on the attribute information, and transmitting the aggregated data to the data receiving device, and the attribute information includes the name, data length, and belonging priority of the data to be transmitted.

8. The wireless communication device according to claim 7, wherein The receiving module includes: An allocation unit, configured to select a target storage area from the unoccupied storage areas of the storage area; and allocate the target storage area as the storage area for storing the data to be transmitted and the attribute information.

9. The wireless communication device according to claim 7 or 8, characterized in that, The processing module is further configured to, after performing data transmission processing on the data to be transmitted based on the attribute information, clear the data to be transmitted and the attribute information in the storage area corresponding to the storage address.

10. A data transmission system, characterized in that, The data transmission system includes: the master device according to any one of claims 1-6 and the wireless communication device according to any one of claims 7-9.

11. A data transmission method, characterized in that, The data transmission method is applied to a master device, the master device includes a driving module and a transmission module, and the method includes: The driving module sets a socket buffer structure for the data to be transmitted, wherein the socket buffer structure is used to record the attribute information of the data to be transmitted and the storage address information of the storage area for storing the data to be transmitted, and the socket buffer structure is used to implement storing the data to be transmitted into the same shared storage space of the driving module and the transmission module, and the socket buffer structure points to the storage area corresponding to the data to be transmitted in the storage space; When it is necessary to transmit the data to be transmitted to the wireless communication device, the transmission module transmits the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information according to the storage address information of the data to be transmitted recorded in the corresponding socket buffer structure to the receiving module in the wireless communication device, so that the receiving module writes the data to be transmitted and the attribute information into the storage area in the shared storage space of the receiving module and the processing module in the wireless communication device, so as to realize that when the wireless communication device needs to transmit the data to be transmitted to the data receiving device, the processing module extracts the data to be transmitted and the attribute information from the corresponding storage area in the shared storage space of the receiving module and the processing module, and performs data transmission processing on the data to be transmitted based on the extracted attribute information.

12. The method according to claim 11, characterized in that Transmitting the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device includes: Starting from the character corresponding to the head character position in the socket cache structure, characters are sequentially transmitted to the transmission module of the master device according to the storage order of the characters in the socket cache structure until the cumulative length of the transmitted characters reaches a preset length. Among them, the characters transmitted to the transmission module constitute the attribute information and the storage address information; The transmission module transmits the attribute information and the data to be transmitted stored in the storage area corresponding to the storage address information to the wireless communication device.

13. The method according to claim 11, wherein The method further includes: When receiving the feedback that the attribute information and the data to be transmitted transmitted by the wireless communication device are successfully transmitted, recycle the socket cache structure of the data to be transmitted and clear the data to be transmitted stored in the storage area.

14. The method according to claim 13, wherein, Recycling the socket cache structure of the data to be transmitted includes: Clearing the attribute information and storage address information corresponding to the data to be transmitted in the socket cache structure.

15. The method according to any one of claims 11-14, characterized in that, Setting up a socket cache structure for the data to be transmitted includes: Detecting whether there is an available socket cache structure, where the storage area corresponding to the available socket cache structure is not occupied by data; If it is determined that there is an available socket cache structure, select a target socket cache structure from the available socket cache structures, and when writing the data to be transmitted into the storage area corresponding to the target socket cache structure, encapsulate the storage address information of the storage area through the target socket cache structure to form a socket cache structure for the data to be transmitted.

16. The method according to claim 15, wherein The method further includes: When it is determined that there is no available socket cache structure, determine whether to establish a new socket cache structure.

17. A data transmission method, characterized in that, The data transmission method is applied to a wireless communication device, and the wireless communication device includes a receiving module and a processing module. The method includes: The receiving module writes the data to be transmitted and the attribute information of the data to be transmitted into the storage area, where the storage area belongs to the shared storage space of the receiving module and the processing module and is obtained based on the division of the shared storage space; When it is necessary to transmit the data to be transmitted to a data receiving device, the processing module extracts the data to be transmitted and the attribute information of the data to be transmitted from the storage area corresponding to the storage address, and performs data transmission processing on the data to be transmitted based on the attribute information; among them, performing data transmission processing on the data to be transmitted based on the attribute information includes: performing data aggregation processing on the data to be transmitted based on the attribute information and transmitting the aggregated data to the data receiving device. The attribute information includes the name, data length, and belonging priority of the data to be transmitted.

18. The method according to claim 17, characterized in that Writing the data to be transmitted and the attribute information of the data to be transmitted into the storage area includes: Selecting a target storage area from the unoccupied storage areas of the storage area; Allocating the target storage area as the storage area for storing the data to be transmitted and the attribute information.

19. The method according to claim 17 or 18, characterized in that, The method further includes: After performing data transmission processing on the data to be transmitted based on the attribute information, clear the data to be transmitted and the attribute information in the storage area corresponding to the storage address.

Citation Information

Patent Citations

  • Data packet forwarding method and device, electronic equipment and storage medium

    CN112702426A

  • Data transmission method, device and system, electronic equipment and computer readable storage medium

    CN113422669A