Data transmission method and electronic device

By obtaining configuration information in electronic devices to perform different flow control operations, the problems of differences in network protocol interfaces and flow control technologies between different devices are solved, and a unified flow control mechanism is realized, which improves data transmission performance and user experience.

CN114173381BActive Publication Date: 2025-07-11HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011388769.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-09-10
Filing Date
2020-12-02
Publication Date
2025-07-11
Estimated Expiration
2040-12-02

AI Technical Summary

Technical Problem

Due to the differences in network protocol interfaces and flow control technology, WLAN chip drivers of different electronic devices are difficult to achieve a unified flow control mechanism, which increases the complexity and difficulty of WLAN chip driver development.

Method used

Provide a data transmission method, which performs different flow control operations by obtaining configuration information, including determining transmission priority and performing flow control according to the data type, forming a unified flow control mechanism, and simplifying the development process of WLAN chip drivers.

Benefits of technology

Improves data transmission performance and user experience, simplifies the integration process of WLAN chip drivers, and reduces development difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114173381B_ABST
    Figure CN114173381B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data transmission method and an electronic device. The method includes: obtaining first configuration information; the first configuration information is used to characterize the flow control operation that the electronic device needs to adopt when transmitting data; if the first configuration information carries an identifier of a first flow control operation, the electronic device performs the first flow control operation on the data to be transmitted when transmitting data; or, if the first configuration information carries an identifier of a second flow control operation, the electronic device performs the second flow control operation on the data to be transmitted when transmitting data. This method can select different flow control operations through function interfaces corresponding to different flow control operations, that is, it provides a unified flow control configuration method. R & D personnel only need to select different flow control operations according to needs and then form the first configuration information. The electronic device performs different flow control operations according to the first configuration information. This method provides great convenience for the R & D personnel in the process of developing the WLAN chip driver, and at the same time facilitates the integration of the WLAN chip driver.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technologies, and particularly to a data transmission method and an electronic device. Background Art

[0002] With the rapid development of electronic devices (such as mobile phones, tablets, watches, in-vehicle infotainment systems, large screens, virtual reality (VR) devices, etc.), the network layer protocols, network layer interfaces, and flow control technologies adopted for network data transmission by different electronic devices are also different, which brings challenges to developers of wireless local area network (WLAN) drivers.

[0003] Due to different network protocol interfaces and flow control technologies, the network layer interfaces and flow control technology parts driven by the same model of WLAN chip are not easily reused in different operating systems; for example, for current different electronic devices, the flow control technology driven by the WLAN chip in one electronic device is different from that in another electronic device. Therefore, there is an urgent need for a unified flow control mechanism to facilitate the development process of WLAN chip drivers. Summary of the Invention

[0004] Embodiments of this application provide a data transmission method and an electronic device, which can provide a unified flow control mechanism to facilitate the development process of WLAN chip drivers.

[0005] In a first aspect, embodiments of this application provide a data transmission method, which is executed by an electronic device and includes: obtaining first configuration information; the first configuration information is used to characterize the flow control operation that the electronic device needs to adopt when transmitting data; if the first configuration information carries an identifier of a first flow control operation, the electronic device performs the first flow control operation on the data to be transmitted when transmitting data; or, if the first configuration information carries an identifier of a second flow control operation, the electronic device performs the second flow control operation on the data to be transmitted when transmitting data.

[0006] Among them, the electronic device can be a mobile terminal, a tablet computer, a wearable device, or other types of devices; the first configuration information is formed according to the flow control operations selected by R & D personnel during the development process of the WLAN chip driver, and different flow control operations include performing different data processing on the data to be transmitted to achieve different flow control effects.

[0007] In the above data transmission method, during the development of the WLAN chip driver by R & D personnel, different flow control operations can be selected through the function interfaces corresponding to different flow control operations, that is, a unified flow control configuration method is provided. The R & D personnel only need to select different flow control operations according to their own needs, and then form the first configuration information. The electronic device can perform different flow control operations according to the first configuration information. This method provides great convenience for the R & D personnel in the development process of the WLAN chip driver and is also convenient for the integration of the WLAN chip driver.

[0008] Combined with the first aspect, in some implementation manners of the first aspect, when the electronic device performs a first flow control operation on the data to be transmitted during data transmission, it includes: storing the data to be transmitted into the corresponding scheduling queue according to the transmission priority of the data to be transmitted, where the transmission priority of the data to be transmitted is determined according to the data type of the data to be transmitted; performing dequeue scheduling on the data to be transmitted according to the preset scheduling priority of the scheduling queue; performing flow control on the dequeued data to be transmitted, and sending the data to be transmitted after flow control to the target interface.

[0009] Combined with the first aspect and the above implementation manners, by performing priority scheduling and flow control on the data to be transmitted, a unified flow control mechanism can be formed, which can improve the data transmission performance and the user experience when using the electronic device.

[0010] In a possible implementation manner, before storing the data to be transmitted into the corresponding scheduling queue according to the transmission priority of the data to be transmitted, the method further includes: determining the transmission priority of the data to be transmitted according to the data type of the data to be transmitted and the preset corresponding relationship between the data type and the transmission priority.

[0011] Optionally, the preset corresponding relationship between the data type and the transmission priority can be stored in the database in the form of a data table. Through this preset corresponding relationship, the transmission priority of the data to be transmitted can be accurately determined, thereby improving the data transmission performance.

[0012] In a possible implementation manner, performing flow control on the dequeued data to be transmitted includes: calculating the flow rate corresponding to the data to be transmitted according to the flow of the data to be transmitted; if the flow rate corresponding to the data to be transmitted is greater than or equal to the preset flow rate threshold, performing traffic shaping on the data to be transmitted.

[0013] Among them, the flow of the data to be transmitted can be the data volume. Optionally, the algorithm used for traffic shaping can be the leaky bucket algorithm, the token bucket algorithm, etc., to limit the flow rate of the data to be transmitted and further improve the transmission performance.

[0014] In a possible implementation, for flow control of the dequeued data to be transmitted, it further includes: if the flow rate of the data to be transmitted is greater than or equal to a preset flow rate threshold, scheduling the available hardware resources in the electronic device according to a preset hardware scheduling rule, so as to send the data to be transmitted after flow control to a target interface.

[0015] Optionally, the preset hardware scheduling rule may include ways such as increasing the frequency of a Secure Digital Input and Output (SDIO) card, running the large core of the CPU, and multi-threaded operation. By scheduling the available hardware resources in the electronic device, it assists the transmission process of the data to be transmitted and further improves the transmission efficiency.

[0016] In a possible implementation, obtaining first configuration information includes: after the electronic device is powered on, obtaining the first configuration information of a network chip in the electronic device.

[0017] Optionally, the electronic device may include a network chip (WLAN chip) and a flow control module. Both the flow control module and the chip driver are in the kernel state, and the data interaction between them is directly passed through pointers. After the electronic device is powered on, read the first configuration information of the WLAN chip, and then configure the flow control module according to the first configuration information, so that the flow control module performs subsequent flow control operations.

[0018] Combined with the first aspect and the above implementation, the flow control module performs different flow control operations according to the first configuration information; this method provides great convenience for the R & D personnel in the process of developing the WLAN chip driver, and at the same time facilitates the integration of the WLAN chip driver.

[0019] In a possible implementation, the data to be transmitted includes at least one of a data frame, a management frame, and a chip control command.

[0020] In a possible implementation, the above method further includes: performing format conversion on the data to be transmitted according to a preset data format.

[0021] Combined with the first aspect and the above implementation, by performing format conversion on the data to be transmitted, the network data format can be standardized, the number of data copies can be reduced, and thus the transmission efficiency can be improved.

[0022] In a possible implementation, the method further includes: after the electronic device is powered on, obtaining second configuration information; the second configuration information is used to represent the network protocol that the electronic device needs to adopt when transmitting data; parsing the second configuration information to determine the network protocol adopted by the electronic device for transmitting the data to be transmitted.

[0023] Among them, the second configuration information is formed according to the network protocol type selected by the R & D personnel during the development of the WLAN chip driver. That is to say, during the development of the WLAN chip driver, the R & D personnel can select the corresponding network protocol according to the operating system type of the electronic device to which the WLAN chip is to be applied, and then form the second configuration information. In this method, the R & D personnel only need to select different network protocols according to the actual needs to generate the second configuration information, which further facilitates the R & D personnel in the process of developing the WLAN chip driver, and at the same time can shield the differences in the network layer between different electronic devices, realizing reuse on different electronic devices.

[0024] In a second aspect, an embodiment of the present application provides a device, which is included in an electronic device and has the function of implementing the behavior of the electronic device in the first aspect and any possible implementation manners of the first aspect. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, an acquisition module or unit, a transmission module or unit, etc.

[0025] In a third aspect, an embodiment of the present application provides an electronic device, which includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other to enable the electronic device to execute any one of the methods in the technical solutions described in the first aspect.

[0026] In a fourth aspect, an embodiment of the present application provides a chip, which includes a processor. The processor is used to read and execute a computer program stored in the memory to execute the methods in the first aspect and any possible implementation manners thereof.

[0027] Optionally, the chip further includes a memory, and the memory is connected to the processor through a circuit or a wire.

[0028] Further optionally, the chip further includes a communication interface.

[0029] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is enabled to execute any one of the methods in the technical solutions described in the first aspect.

[0030] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes: computer program code, and when the computer program code runs on an electronic device, the electronic device is enabled to execute any one of the methods in the technical solutions described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1It is the system architecture diagram of an example data transmission method provided by an embodiment of this application;

[0032] Figure 2 It is the structural schematic diagram of an example electronic device provided by an embodiment of this application;

[0033] Figure 3 It is the software structure block diagram of the electronic device provided by an embodiment of this application;

[0034] Figure 4 It is the process schematic diagram of an example data transmission method provided by an embodiment of this application;

[0035] Figure 5 It is the process schematic diagram of another example data transmission method provided by an embodiment of this application;

[0036] Figure 6 It is the data format schematic diagram of the data to be transmitted provided by an embodiment of this application;

[0037] Figure 7 It is the process schematic diagram of yet another example data transmission method provided by an embodiment of this application. Detailed implementation manners

[0038] Next, the technical solutions in the embodiments of this application will be described in conjunction with the accompanying drawings in the embodiments of this application. Among them, in the description of the embodiments of this application, unless otherwise specified, " / " means "or". For example, A / B can mean A or B; "and / or" in this article is just a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "a plurality" means two or more than two.

[0039] Hereinafter, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", and "third" may explicitly or implicitly include one or more of such features.

[0040] The data transmission method provided by the embodiments of this application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. that can access the WLAN for network data transmission. The embodiments of this application do not impose any restrictions on the specific types of electronic devices.

[0041] The data transmission method provided by the embodiments of this application can be applied to a system architecture as Figure 1 shown. As Figure 1 shown, the network device layer includes a network device module, a data sending / receiving module, a management module, and a decision-making module; among them, the network device can be a hardware device such as a WLAN chip, the network device module can define a unified network device data structure and provide the ability to manage, add, and delete network devices; the management module can uniformly manage the data transmission process; the decision-making module includes configuration information, which is used to determine the network protocol required for transmitting data, and this configuration information is formed according to the network protocol type selected by the R & D personnel during the development of the WLAN chip driver; the data sending / receiving module is used to send and / or receive data. When the electronic device invokes the entire system architecture, the data is transmitted to the management module through the data sending / receiving module, and the management module determines the network protocol for transmitting data according to the configuration information parsed by the decision-making module and sends the data to the corresponding network protocol stack for subsequent data transmission processes.

[0042] The WLAN chip driver includes flow control configuration, a flow control module, and a data sending interface; among them, the flow control configuration is used to determine the flow control operations required when transmitting data, configure the flow control module according to this flow control configuration, and then enable the flow control module to perform the corresponding flow control operations. This flow control configuration is formed according to the flow control operations selected by the R & D personnel during the development of the WLAN chip driver; the data sending interface is used to send the data to the network device layer for transmission using the corresponding network protocol.

[0043] Exemplarily, Figure 2This is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0044] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0045] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0046] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching instructions and executing instructions.

[0047] A memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses and reduces the waiting time of the processor 110, thus improving the efficiency of the system.

[0048] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0049] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193, etc. through different I2C bus interfaces. For example: The processor 110 can be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 to communicate with the touch sensor 180K through the I2C bus interface to implement the touch function of the electronic device 100.

[0050] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering a call through a Bluetooth headset.

[0051] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering a call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0052] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0053] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0054] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0055] The USB interface 130 is an interface that complies with the USB standard specification. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices, etc.

[0056] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0057] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0058] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives the input from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be provided in the same device.

[0059] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0060] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 2The structures of Antenna 1 and Antenna 2 in it are only one example. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, Antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0061] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through Antenna 1, filter, amplify, and process the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through Antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be arranged in the same device.

[0062] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor can be an independent device. In some other embodiments, the modulation and demodulation processor can be independent of the processor 110 and arranged in the same device as the mobile communication module 150 or other functional modules.

[0063] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0064] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, such that electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0065] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0066] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0067] The electronic device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0068] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0069] The camera 193 is used to capture static images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0070] The digital signal processor is used to process digital signals. Besides being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0071] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0072] The NPU is a neural-network (NN) computing processor. By drawing on the structure of the biological neural network, such as the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.

[0073] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.

[0074] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0075] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.

[0076] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0077] The speaker 170A, also referred to as a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0078] The receiver 170B, also referred to as an "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the user can listen to the voice by bringing the receiver 170B close to the ear.

[0079] The microphone 170C, also referred to as a "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and implement functions such as directional recording.

[0080] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0081] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0082] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0083] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0084] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0085] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0086] A distance sensor 180F for measuring distance. The electronic device 100 can measure distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0087] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The electronic device 100 emits infrared light outward through the light-emitting diode. The electronic device 100 uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used for automatic unlocking and locking of the holster mode and pocket mode.

[0088] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.

[0089] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.

[0090] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In still other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0091] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 together form a touch screen, also known as the "touch display screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from where the display screen 194 is located.

[0092] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals of the vibrating bone mass of the human vocal tract. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bone mass of the vocal tract acquired by the bone conduction sensor 180M to implement the voice function. The application processor can parse out heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.

[0093] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0094] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations acting on different regions of the display screen 194 can also cause the motor 191 to correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0095] The indicator 192 can be an indicator light and can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0096] The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0097] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100.

[0098] Figure 3 It is the software structure block diagram of the electronic device 100 in the embodiments of this application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer can include a series of application packages.

[0099] As Figure 3 shown, the application packages can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0100] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0101] As Figure 3 shown, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0102] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0103] The content provider is used to store and obtain data, and make this data accessible to application programs. The data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.

[0104] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0105] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call status (including answering, hanging up, etc.).

[0106] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, and so on.

[0107] The notification manager enables application programs to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is complete, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, it prompts text information in the status bar, emits a prompt tone, the electronic device vibrates, the indicator light flashes, etc.

[0108] Android runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0109] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0110] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.

[0111] The system library may include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0112] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0113] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0114] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0115] The 2D graphics engine is a drawing engine for 2D drawing.

[0116] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, a sensor driver, and a WLAN driver.

[0117] For ease of understanding, the following embodiments of the present application will take an electronic device with the Figure 2 and Figure 3 shown structure as an example, and in combination with the accompanying drawings and system architecture, specifically elaborate on the data transmission method provided by the embodiments of the present application.

[0118] Figure 4 is a schematic flowchart of a data transmission method provided by an embodiment of the present application. The method includes:

[0119] S101, obtain first configuration information; the first configuration information is used to characterize the flow control operation that the electronic device needs to adopt when transmitting data.

[0120] Specifically, during the development of the WLAN chip driver by R & D personnel, different flow control operations can be selected through the function interfaces corresponding to different flow control operations, and then the first configuration information is formed; among them, different flow control operations include performing different data processing on the data to be transmitted to achieve different flow control effects. After the WLAN chip driver is developed, it can be applied to the electronic device. Usually, after the electronic device is powered on, the first configuration information can be obtained.

[0121] It should be noted that the above flow control operations may include the data processing procedures provided in the embodiments of the present application, may also include the data processing procedures provided by WLAN chip manufacturers, or may be a combination of two (or more) data processing procedures, etc., as long as corresponding function interfaces can be provided for R & D personnel. During the development process, R & D personnel only need to select different flow control operations according to their own needs, and no longer need to re-develop different flow control operation processes. It should also be noted that for electronic devices such as lightweight devices or rich devices, the above configuration process is applicable.

[0122] S102. If the first configuration information carries the identifier of the first flow control operation, the electronic device performs the first flow control operation on the data to be transmitted when transmitting data.

[0123] Or,

[0124] S103. If the first configuration information carries the identifier of the second flow control operation, the electronic device performs the second flow control operation on the data to be transmitted when transmitting data.

[0125] Specifically, the above flow control operations have corresponding identifiers, which may be the function names of the function interfaces corresponding to the flow control operations, or other identifiers that can distinguish different flow control operations. After the electronic device obtains the first configuration information, it can parse the first configuration information to determine the identifier carried by the first configuration information. Among them, if the first configuration information carries the identifier of the first flow control operation, the electronic device performs the first flow control operation on the data to be transmitted when transmitting data; if the first configuration information carries the identifier of the second flow control operation, the electronic device performs the second flow control operation on the data to be transmitted when transmitting data. The first flow control operation and the second flow control operation correspond to different data processing procedures.

[0126] In the process of R & D personnel developing the WLAN chip driver, the above data transmission method can select different flow control operations through the function interfaces corresponding to different flow control operations, that is, a unified flow control configuration method is provided. R & D personnel only need to select different flow control operations according to their own needs to form the first configuration information, and the electronic device can perform different flow control operations according to the first configuration information. This method provides great convenience for the WLAN chip driver development process of R & D personnel and is also convenient for the integration of the WLAN chip driver.

[0127] The following introduces the flow control operation processing procedure provided in the embodiments of the present application. Optionally, the flow control operation provided in the embodiments of the present application may be the first flow control operation. As Figure 5 shown, when the above electronic device transmits data, performing the first flow control operation on the data to be transmitted includes:

[0128] S201. Store the data to be transmitted into the corresponding scheduling queue according to the transmission priority of the data to be transmitted, where the transmission priority of the data to be transmitted is determined according to the data type of the data to be transmitted.

[0129] Specifically, the electronic device can determine the corresponding transmission priority according to the data type of the data to be transmitted. For example, the transmission priority of video data is higher than that of voice data. Then, according to the transmission priority, the data to be transmitted is stored in the corresponding scheduling queue. Optionally, there can be only one scheduling queue, and the data to be transmitted is queued in turn according to the transmission priority. There can also be multiple scheduling queues, with each transmission priority corresponding to a scheduling queue, and the data to be transmitted is stored in the scheduling queue corresponding to the transmission priority.

[0130] Optionally, the data to be transmitted may further include at least one of a data frame, a management frame, and a chip control command. The electronic device can also determine the transmission priority of the data frame or the management frame according to the TCP / IP packet priority (TOS) or the priority in the custom field of the UDP / TCP header. Among them, the management frame refers to the communication management frame between the network chip driver and the network peer according to the network protocol. For example, the management frames in the 802.11 protocol include disassociation frames, deauthentication frames, etc.

[0131] Optionally, before storing the data to be transmitted into the corresponding scheduling queue, the electronic device can also determine the transmission priority of the data to be transmitted according to the data type of the data to be transmitted and the preset corresponding relationship between the data type and the transmission priority. Exemplarily, the preset corresponding relationship between the data type and the transmission priority can be stored in the database in the form of a data table.

[0132] S202. Perform dequeue scheduling on the data to be transmitted according to the preset scheduling priority of the scheduling queue.

[0133] Specifically, each scheduling queue can also correspond to its own scheduling priority. When the electronic device needs to schedule the data to be transmitted in the scheduling queue, it can perform dequeue scheduling on the data to be transmitted according to the scheduling priority.

[0134] Optionally, when there is only one scheduling queue, the data to be transmitted is directly dequeued in the first-in, first-out manner.

[0135] S203. Perform flow control on the dequeued data to be transmitted and send the data to be transmitted after flow control to the target interface.

[0136] Specifically, after the data to be transmitted dequeues, the electronic device can also perform flow control on the dequeued data to be transmitted to avoid the excessive size of the data to be transmitted from affecting other working performances of the electronic device, and send the data to be transmitted after flow control to the target interface for data transmission.

[0137] Optionally, before storing the data to be transmitted into the corresponding scheduling queue, the electronic device can also perform format conversion on the data to be transmitted according to a preset data format to standardize the network data format, reduce the number of data copies, and thereby improve the transmission efficiency. Among them, the preset data format can be as Figure 6 shown, including a doubly linked list, buffer segments, a memory buffer address, and a memory buffer length field. The memory buffer address is the buffer address of each segment in the buffer segment. The specific definition method can be:

[0138] struct NetBuf{

[0139] struct DListHead dlist; / *Doubly linked list, linking multiple network data buffers through the list* /

[0140] struct BufField bufs[MAX_BUF_NUM]; / *Buffer segment definition is used to record the offset address (based on the memory buffer address) and length of each buffer segment, including the head buffer segment, data segment, and tail buffer segment* /

[0141] uint8_t*mem; / *Memory buffer address* /

[0142] uint32_t len; / *Length of the memory buffer* /

[0143] }

[0144] The above data transmission method can form a unified flow control mechanism by performing priority scheduling and flow control on the data to be transmitted, improve the data transmission performance, and enhance the user experience when using the electronic device.

[0145] In a possible implementation manner, the method for performing flow control on the dequeued data to be transmitted in S203 above may include, but is not limited to: calculating the flow rate corresponding to the data to be transmitted according to the flow rate of the data to be transmitted; if the flow rate corresponding to the data to be transmitted is greater than or equal to a preset flow rate threshold, performing traffic shaping on the data to be transmitted.

[0146] Specifically, the traffic of the data to be transmitted can be the data volume. The electronic device can calculate the flow rate corresponding to the data to be transmitted based on the data volume and the transmission duration. If the flow rate is greater than or equal to a preset flow rate threshold (such as 20 megabytes per second), the electronic device needs to perform traffic shaping on the data to be transmitted. Optionally, the algorithm used for traffic shaping can be a leaky bucket algorithm, a token bucket algorithm, etc., to limit the flow rate of the data to be transmitted and further improve the transmission performance. Optionally, when the traffic of the data to be transmitted is greater than or equal to a preset traffic threshold (such as 200 megabytes), the electronic device can also schedule the available hardware resources in the electronic device according to the preset hardware scheduling rules to avoid problems such as congestion and delay caused by the electronic device when transmitting the data to be transmitted. Exemplary but not limiting, it can include ways such as increasing the frequency of the secure digital input and output card, running the large core of the CPU, and running multiple threads.

[0147] In a possible implementation manner, for currently popular electronic device operating systems, such as the Linux system, the real-time operating system RTOS, etc., the WLAN driver developed for Linux electronic devices only supports docking with the network layer on Linux, and the cost of transplanting to other platforms is high and it does not support reuse; the WLAN driver on RTOS directly docks with the protocol stack. Changes to the protocol stack may bring about modifications to the driver, increasing the maintenance cost, and it is also not easy to transplant to other operating systems, with poor reusability. To address this problem, refer to the above Figure 1 As shown, the management module in the network device layer of this embodiment can determine the network protocol to be used for transmitting data according to the configuration information of the decision module (referred to as the second configuration information here). This second configuration information is formed based on the network protocol type selected by the R & D personnel during the development of the WLAN chip driver. That is to say, during the development of the WLAN chip driver, the R & D personnel can select the corresponding network protocol according to the operating system type of the electronic device to which the WLAN chip is to be applied, and then form the second configuration information. After the electronic device is turned on, the second configuration information can also be obtained, and by parsing this second configuration information, the network protocol used by the electronic device to transmit the data to be transmitted can be determined, and then this network protocol can be used to transmit the data to be transmitted. In this method, the R & D personnel only need to select different network protocols according to actual needs and generate the second configuration information. This further provides convenience for the R & D personnel in the process of developing the WLAN chip driver, and at the same time can shield the differences in the network layer between different electronic devices, realizing reuse on different electronic devices.

[0148] In a possible implementation manner, the electronic device can include a network chip (WLAN chip) and a flow control module. Both the flow control module and the chip driver are in the kernel state, and the data interaction between them is directly passed through pointers, such asFigure 7 As shown in Figure 7 , the above data transmission method may include:

[0149] S301, after the electronic device is powered on, read the first configuration information of the WLAN chip.

[0150] S302, configure the flow control module according to the first configuration information.

[0151] S303, the WLAN chip calls the interface function of the flow control module to send the data to be transmitted to the flow control module.

[0152] S304, the flow control module stores the data to be transmitted into the corresponding scheduling queue according to the transmission priority of the data to be transmitted.

[0153] S305, perform dequeue scheduling on the data to be transmitted according to the scheduling priority of the preset scheduling queue.

[0154] S306, calculate the flow rate corresponding to the data to be transmitted according to the traffic of the data to be transmitted; if the flow rate corresponding to the data to be transmitted is greater than or equal to the preset flow rate threshold, perform traffic shaping on the data to be transmitted.

[0155] S307, if the traffic of the data to be transmitted is greater than or equal to the preset traffic threshold, schedule the available hardware resources in the electronic device according to the preset hardware scheduling rules.

[0156] S308, the flow control module sends the data to be transmitted after traffic control to the data sending interface of the WLAN chip.

[0157] Among them, some interfaces when the WLAN chip calls the flow control module can be defined as follows:

[0158] struct FlowControlInterface{

[0159] / * Obtain the corresponding priority queue according to the buff data (management frame or data frame) * /

[0160] FlowControlQueueID(*getQueueIdByNetBuff)(const struct NetBuf*buff);

[0161] / * Send the buff data (management frame or data) to the flow control module according to the priority * /

[0162] int32_t(*sendBuffToFCM)(struct FlowControlModule*fcm, struct NetBuf*buff, uint32_t id, uint32_t dir);

[0163] / * Notify the flow control module to perform priority scheduling, and the flow control module performs backend processing * /

[0164] int32_t(*schedFCM)(struct FlowControlModule*fcm, FlowDir dir);

[0165] / * Register the data sending interface of the flow control * /

[0166] int32_t(*registerFlowControlOp)(struct FlowControlModule*fcm, structFlowControlOp*op);

[0167] };

[0168] struct FlowControlOp{

[0169] / * The flow control module calls the chip data sending interface * /

[0170] int32_t(*txDataPacket)(struct NetBufQueue*q, void*fcmPrivate);

[0171] };

[0172] / * Initialize the flow control module * /

[0173] struct FlowControlModule*InitFlowControl(void*fcmPriv);

[0174] / * Obtain the initialized instance of the flow control module * /

[0175] struct FlowControlModule*GetFlowControlModule(void);

[0176] / * Destroy the initialized flow control module * /

[0177] void DeInitFlowControl(struct FlowControlModule*fcm);

[0178] For the implementation processes of the remaining steps in this embodiment, reference can be made to the descriptions of the above embodiments. Their implementation principles and technical effects are similar, and will not be elaborated here.

[0179] The above text has introduced in detail the examples of the data transmission method provided by the embodiments of the present application. It can be understood that in order for an electronic device to implement the above functions, it includes corresponding hardware and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described function for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0180] The embodiments of the present application can divide the functions of the electronic device according to the above examples of the data transmission method. For example, each function can be corresponding to each function module, such as an acquisition module, a transmission module, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.

[0181] It should be noted that all relevant contents of the steps involved in the above method embodiments can be cited in the function descriptions of the corresponding function modules, and will not be repeated here.

[0182] The electronic device provided in this embodiment is used to execute the above data transmission method, so it can achieve the same effect as the above implementation method.

[0183] In the case of adopting an integrated unit, the electronic device may further include a processing module, a storage module, and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device. The storage module can be used to support the electronic device to execute stored program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.

[0184] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logical blocks, modules, and circuits described in combination with the disclosure of the present application. The processor can also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0185] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device with Figure 2 the structure shown.

[0186] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor is enabled to execute the data transmission method described in any of the above embodiments.

[0187] The embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-related steps to implement the data transmission method in the above embodiment.

[0188] In addition, the embodiment of the present application also provides a device, which may specifically be a chip, component or module. The device may include a processor and a memory connected thereto; wherein, the memory is used to store computer execution instructions. When the device runs, the processor may execute the computer execution instructions stored in the memory so that the chip executes the data transmission method in each of the above method embodiments.

[0189] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.

[0190] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of description, only the above division of each functional module is used as an example. In actual applications, the above functions may be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0191] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection to each other may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be in an electrical, mechanical or other form.

[0192] The unit described as a separating component may or may not be physically separated. The component shown as a unit may be a single physical unit or multiple physical units, that is, it may be located in one place or may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] In addition, each functional unit in various embodiments of the present application may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0194] 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 readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.

[0195] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data transmission method, characterized in that, The method is executed by an electronic device, and includes: Obtaining first configuration information; the first configuration information is used to characterize the flow control operation that the electronic device needs to adopt when transmitting data; wherein, during the development of the WLAN chip driver, different flow control operations are selected through function interfaces corresponding to different flow control operations to form the first configuration information; If the first configuration information carries an identifier of a first flow control operation, the electronic device performs the first flow control operation on the data to be transmitted when transmitting data; Or, If the first configuration information carries an identifier of a second flow control operation, the electronic device performs the second flow control operation on the data to be transmitted when transmitting data.

2. The method according to claim 1, wherein When the electronic device performs the first flow control operation on the data to be transmitted when transmitting data, it includes: According to the transmission priority of the data to be transmitted, storing the data to be transmitted into a corresponding scheduling queue; wherein, the transmission priority of the data to be transmitted is determined according to the data type of the data to be transmitted; According to the preset scheduling priority of the scheduling queue, performing dequeue scheduling on the data to be transmitted; Performing traffic control on the dequeued data to be transmitted, and sending the traffic-controlled data to be transmitted to a target interface.

3. The method according to claim 2, wherein Before storing the data to be transmitted into the corresponding scheduling queue according to the transmission priority of the data to be transmitted, the method further includes: Determining the transmission priority of the data to be transmitted according to the data type of the data to be transmitted and the preset correspondence between the data type and the transmission priority.

4. The method according to claim 2 or 3, characterized in that, The performing traffic control on the dequeued data to be transmitted includes: Calculating the flow rate corresponding to the data to be transmitted according to the traffic of the data to be transmitted; If the flow rate corresponding to the data to be transmitted is greater than or equal to a preset flow rate threshold, performing traffic shaping on the data to be transmitted.

5. The method according to claim 4, characterized in that The performing traffic control on the dequeued data to be transmitted further includes: If the traffic of the data to be transmitted is greater than or equal to a preset traffic threshold, scheduling the available hardware resources in the electronic device according to a preset hardware scheduling rule, so as to send the traffic-controlled data to be transmitted to the target interface.

6. The method according to claim 1, characterized in that The obtaining the first configuration information includes: After the electronic device is powered on, obtaining the first configuration information of the network chip in the electronic device.

7. The method according to claim 6, characterized in that, The data to be transmitted includes at least one of a data frame, a management frame, and a chip control command.

8. The method according to claim 7, wherein The method further includes: Performing format conversion on the data to be transmitted according to a preset data format.

9. The method according to claim 1, characterized in that, The method further includes: After the electronic device is powered on, obtaining second configuration information; the second configuration information is used to characterize the network protocol that the electronic device needs to adopt when transmitting data; Parsing the second configuration information to determine the network protocol used by the electronic device to transmit the data to be transmitted.

10. An electronic device, characterized in that, Including: A processor, a memory, and an interface; The processor, the memory, and the interface cooperate with each other to enable the electronic device to execute the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and system for a configurable communication integrated circuit and / or chipset

    CN101548468A

  • Home network flow control method and device and flow controller

    CN110891029A