Data communication method, baseband chip, and terminal device
By maintaining the second time schedule in the driving layer of the baseband chip, controlling the data packet transmission timing, solving the problems of large power consumption and low utilization of available windows in the prior art, and achieving more efficient data communication.
Patent Information
- Application Number
- CN202210865598.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-07-21
AI Technical Summary
The prior art has problems with large power consumption and low utilization of available windows in data communication, especially during non-available windows, where device wake-up and packet transmission occupy available window time.
By maintaining a second time schedule generated based on the available window in the driver layer of the baseband chip, the transmission timing of data packets is controlled, ensuring that data packets are successfully transmitted within the available window, and reducing the power consumption of premature wake-up chips.
It improves the effective utilization of available windows, minimizes device power consumption, avoids the problem that data packets cannot be successfully received by the target device and the increase in power consumption caused by retransmission processing.
Smart Images

Figure CN115243390B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip design, and in particular to a data communication method, a baseband chip and a terminal device. Background Art
[0002] Neighbor Awareness Networking (NAN) is also known as Wi-Fi Aware. Among them, after a NAN device joins a NAN network, it can communicate with multiple neighbor NAN devices. To ensure smooth data communication between two devices, two NAN devices will negotiate a periodic available time window, that is, an availability window (AW). The two NAN devices will only perform data communication during the AW.
[0003] However, for the time scheduling of data communication between devices through the AW, on the one hand, the power consumption may increase due to receiving a data packet sent from the upper layer during a non-AW period; on the other hand, the data packet transmission process, channel access processing, etc. will occupy the time of the AW, reducing the utilization rate of the AW. Summary of the Invention
[0004] Embodiments of the present application provide a data communication method, a baseband chip and a terminal device, which can improve the effective utilization rate of the AW while minimizing the device power consumption.
[0005] The technical solution of the embodiments of the present application is implemented as follows:
[0006] In a first aspect, embodiments of the present application provide a data communication method, which is applied to a baseband chip. The baseband chip includes a driver layer, a firmware layer and a hardware layer; the method includes:
[0007] The firmware layer sends a first time schedule to the driver layer; wherein, the first time schedule is used to indicate the data sending and receiving time with a target device;
[0008] When a sending instruction corresponding to the target device is received at a first moment, the driver layer transmits the data packet carried by the sending instruction according to a second time schedule corresponding to the first time schedule, where the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
[0009] In a second aspect, embodiments of the present application provide a baseband chip, which includes a driver layer, a firmware layer and a hardware layer;
[0010] The firmware layer is used to send a first time schedule to the driver layer; wherein, the first time schedule is used to indicate the data transceiver time with the target device.
[0011] The driver layer is used to, when receiving the sending instruction corresponding to the target device at the first moment, transmit the data packet carried by the sending instruction according to the second time schedule corresponding to the first time schedule; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
[0012] In a third aspect, an embodiment of the present application provides a terminal device, the terminal device is configured with the baseband chip as described in the second aspect, and the terminal device is used to implement the method as described in the first aspect.
[0013] An embodiment of the present application provides a data communication method, a baseband chip and a terminal device. The data communication method is applied to the baseband chip. The baseband chip includes a driver layer, a firmware layer and a hardware layer. The firmware layer sends a first time schedule to the driver layer. The first time schedule is used to indicate the data transceiver time with the target device. When receiving the sending instruction corresponding to the target device at the first moment, the driver layer transmits the data packet carried by the sending instruction according to the second time schedule corresponding to the first time schedule. The second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer. It can be seen that in the embodiment of the present application, the driver layer maintains a second time schedule (DAW) based on the first time schedule (AW) used by the firmware layer. The second time schedule can indicate the data transmission time between the driver layer and the firmware layer, so that when the driver layer sends data packets to the firmware layer according to the data transmission period indicated by the second time schedule, it can ensure that the firmware layer just sends data packets to the target device at the start moment of the data transceiver period indicated by the first time schedule, thereby reducing the power consumption caused by premature wake-up of the chip and improving the utilization rate of the data transmission period; it can also ensure that the firmware layer can stop the packet sending process before the end moment of the data transceiver period indicated by the first time schedule, thereby solving the problem that the data packet cannot be successfully received by the target device and overcoming the defect of increased power consumption caused by retransmission processing. That is to say, in the data communication method proposed in the embodiment of the present application, since the driver layer can maintain DAW generated based on AW and use DAW to control the transmission timing of data packets, it can improve the effective utilization rate of AW while minimizing the device power consumption. Description of the Drawings
[0014] Figure 1 It is a schematic diagram of a NAN cluster;
[0015] Figure 2 It is a timing schematic of data communication Figure 1 ;
[0016] Figure 3 Timing schematic for data communication Figure 2 ;
[0017] Figure 4 Schematic of the implementation process of the data communication method proposed in the embodiment of the present application Figure 1 ;
[0018] Figure 5 Schematic of the implementation process of the data communication method proposed in the embodiment of the present application Figure 2 ;
[0019] Figure 6 Timing schematic corresponding to the data communication method proposed in the embodiment of the present application Figure 1 ;
[0020] Figure 7 Timing schematic corresponding to the data communication method proposed in the embodiment of the present application Figure 2 ;
[0021] Figure 8 Schematic diagram of the composition structure of the drive chip;
[0022] Figure 9 Schematic diagram of the composition structure of the terminal device. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. It can be understood that the specific embodiments described herein are only used to explain the relevant application, rather than limiting the application. In addition, it should be noted that for the sake of description, only parts related to the relevant application are shown in the drawings.
[0024] Neighbor Awareness Networking (NAN) is also known as Wi-Fi Aware at the same time. Figure 1 Schematic diagram of the NAN cluster, as Figure 1 shown, a cluster can be used to describe the NAN network and the set of all devices in the network. Among them, after a NAN device joins the NAN network, it can communicate with multiple neighbor NAN devices. The double arrows in the figure represent the mutual communication between two NAN devices.
[0025] To enable successful data communication between two NAN devices, a periodic available time window, i.e., the availability window (AW), is negotiated between the two NAN devices. The two NAN devices will conduct data communication only during the AW period and cannot send or receive data during non-AW periods.
[0026] Figure 2 Timing diagram for data communication Figure 1 , such as Figure 2 shown. As shown in the timing diagram below, the time occupied by the dark gray squares represents the common available time window AW negotiated between device 1 (device1) and device 2 (device2). The arrows represent the data communication of device1 and device2 over the air interface (air). The two NAN devices can ensure the success of data interaction only when they perform data exchange during the periodic AW.
[0027] It can be understood that in the embodiments of this application, each NAN device can be divided into three layers, namely the Driver (Drv) layer, the Firmware (FW) layer, and the Hardware (HW) layer. The Driver layer is the Wi-Fi driver layer, which is responsible for sending the instructions and data sent from the upper layer to the FW layer and forwarding the data from the FW layer to the upper layer; the FW layer is the firmware layer, which is in the middle of the Driver layer and the HW layer, and is responsible for managing, scheduling, and sending the data from the Driver layer to the HW layer, and also sending the data from the HW layer to the Driver layer; the HW layer is the hardware layer, which is responsible for channel access and sending and receiving data over the air interface, specifically sending the data from the FW layer to the air interface and sending the data received from the air interface to the FW layer.
[0028] Figure 3 Timing diagram for data communication Figure 2 , such as Figure 3 shown. At a moment t (where t refers to the timestamp), one of the two NAN devices can be used as the Transmit (TX) device, i.e., the TX device, and the other device can be used as the Receive (RX) device, i.e., the RX device. In the Figure 3 shown timing diagram of the TX device sending data to the RX device, the TX device will send data to the RX device only during the AW period, and the RX device cannot receive data during non-AW periods.
[0029] Currently, the Driver layer of the TX device receives data from the upper layer at any time. For example, it receives Packet #1 outside the AW and Packets #2 and #3 during the AW. After receiving a packet, the Driver layer immediately transmits it to the FW layer. The time required for the Driver layer to transmit a data packet to the FW layer is delay_drv_fw. After receiving the data packet from the Driver layer, the FW layer can determine whether the current time is during the AW according to the stored AW time schedule (schedule), and thus decide whether to send the schoolbag to the RX device through the air interface. Among them, the data packets received from the Driver layer during non-AW periods will be stored by the FW layer until the start time of the AW, when they will be scheduled by the FW layer's scheduler and sent to the RX device. For example, Packet #1 is received by the FW layer during non-AW, but it will not be scheduled for transmission until the start of the AW. After the channel access time channel_access_time, it is sent to the air interface so that the RX device can receive the data packet. During the AW, Packets #2 and #3 received from the Driver layer are immediately scheduled for transmission by the FW layer and are also sent to the air interface after channel_access_time. However, only Packets #1 and #2 can be successfully received by the RX device, while Packet #3 will be sent unsuccessfully, that is, the RX device cannot successfully receive Packet #3. This is because the time when Packet #3 is completely transmitted falls outside the AW, that is, the end time of the transmission time (Tx_time) of Packet #3 is later than the end time of the AW. Among them, the Tx_time can be determined by the following formula:
[0030] Tx_time = channel_access_time + pkt_duration (1)
[0031] Among them, pkt_duration refers to the time required for the hardware layer to transmit a data packet, which can be determined by the length and transmission rate of the data packet.
[0032] It should be noted that in common data communication methods, during non-AW periods, because the FW layer receives data packets from the Driver layer, the Wi-Fi chip will be awakened. However, the FW layer cannot send data packets because there are stored data packets, and the Wi-Fi chip will remain awakened until the data packets are sent during the AW and then go to sleep. It can be seen that since the device can neither send nor receive data during non-AW periods, waking up the Wi-Fi chip during non-AW periods will increase power consumption to a certain extent.
[0033] On the other hand, common data communication methods also have the problem of low effective utilization rate of AW. This is because the backoff time of the first data packet sent during AW is time-consuming, which in turn makes the channel access time relatively long. Especially when the environmental interference is severe, a longer backoff time (or channel access time) is required. In this way, for the limited AW, especially when the negotiated AW window time is small, the backoff time of the first data packet will reduce the time occupied by the data sent per unit time, thereby reducing the effective utilization rate of AW.
[0034] On the other hand, in common data communication methods, the FW layer generally stops sending data packets to the Rx device at the end of AW. However, the last data packet before the end of AW may not be successfully received by the RX device because the completion time of sending falls outside the AW window, increasing the Packet Error Rate (PER). Moreover, the retransmission process of the data packet that cannot be successfully received by the RX device further increases the power consumption of the terminal device.
[0035] It can be seen that common data communication methods have the problems of high power consumption and low AW utilization rate.
[0036] To solve the above problems, in the embodiments of the present application, the driver layer maintains a second time schedule (DAW) based on the first time schedule (AW) used by the firmware layer. This second time schedule can indicate the data transmission time between the driver layer and the firmware layer, so that when the driver layer sends data packets to the firmware layer according to the data transmission period indicated by the second time schedule, it can ensure that the firmware layer sends data packets to the target device exactly at the start moment of the data reception and transmission period indicated by the first time schedule, thereby reducing the power consumption caused by premature wake-up of the chip and improving the utilization rate of the data transmission period; it can also ensure that the firmware layer stops the packet sending process before the end moment of the data reception and transmission period indicated by the first time schedule, thereby solving the problem that the data packet cannot be successfully received by the target device and overcoming the defect of increased power consumption caused by the retransmission process. That is to say, the data communication method proposed in the embodiments of the present application can, by maintaining the DAW generated based on AW by the driver layer and using the DAW to control the transmission timing of data packets, improve the effective utilization rate of AW while minimizing the power consumption of the device.
[0037] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application.
[0038] An embodiment of the present application provides a data communication method, which can be applied to a baseband chip. The baseband chip may include a driver layer, a firmware layer, and a hardware layer. Among them, the driver layer is mainly responsible for sending instructions and data sent from the upper layer to the firmware layer, and forwarding data from the firmware layer to the upper layer; the firmware layer is in the middle of the driver layer and the hardware layer, responsible for managing, scheduling, and sending data from the driver layer to the hardware layer, and also sending data from the hardware layer to the driver layer; the hardware layer is mainly responsible for channel access, sending data from the firmware layer to the air interface, and sending data received from the air interface to the firmware layer.
[0039] Figure 4 Schematic diagram of the implementation process of the data communication method proposed in the embodiment of the present application Figure 1 , such as Figure 4 shown, the method for the baseband chip to perform data communication may include the following steps:
[0040] Step 101, the firmware layer sends a first time schedule to the driver layer; wherein, the first time schedule is used to indicate the data transceiver time with the target device.
[0041] In the embodiment of the present application, the firmware layer may first send a first time schedule to the driver layer. Among them, the first time schedule is used to determine the available window AW corresponding to the target device, that is, the first time schedule can be used to indicate the data transceiver time with the target device.
[0042] It can be understood that in the embodiment of the present application, a communication connection can be established with the target device in advance, so that the corresponding first time schedule can be determined through the communication connection with the target device.
[0043] It should be noted that in the embodiment of the present application, the terminal device configured with the baseband chip and the target device may belong to the same NAN cluster. Among them, data communication can be carried out between the terminal device configured with the baseband chip and the target device. To ensure successful data communication between the two, the two devices can establish a communication connection in advance and negotiate a periodic available window AW, that is, establish a corresponding first time schedule.
[0044] Furthermore, in the embodiment of the present application, the first time schedule is used to indicate the data transceiver time between the baseband chip and the target device. That is to say, the terminal device configured with the baseband chip and the target device can perform data communication only within the data transceiver cycle indicated by the first time schedule, and will not perform data communication outside the data transceiver cycle indicated by the first time schedule. That is, these two NAN devices will perform data communication only during the AW period and will not receive or send data during the non-AW period.
[0045] It should be noted that, in the embodiments of the present application, the first time schedule determined through negotiation with the target device can be stored in the firmware layer of the baseband chip, and the firmware layer can send the first time schedule to the driver layer, so that the driver layer can know the data transceiver time for the firmware layer to perform data transceiver processing.
[0046] Step 102: When a transmission instruction corresponding to the target device is received at the first moment, the driver layer transmits the data packet carried by the transmission instruction according to the second time schedule corresponding to the first time schedule; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
[0047] In the embodiments of the present application, when a transmission instruction corresponding to the target device is received at the first moment, the driver layer can transmit the data packet carried by the transmission instruction according to the second time schedule, so that the firmware layer and the hardware layer can send the data packet to the target device according to the first time schedule. Among them, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer, and the second time schedule can be generated by the driver layer according to the first time schedule, the preset transmission time, the channel access time, and the preset packet sending time.
[0048] That is to say, in the embodiments of the present application, after the firmware layer sends the first time schedule to the driver layer, the driver layer can generate a second time schedule according to the first time schedule, the preset transmission time, the channel access time, and the preset packet sending time. Among them, the second time schedule can be used to indicate the data transmission time between the driver layer and the firmware layer.
[0049] It can be understood that, in the embodiments of the present application, the second time schedule is used to determine the available window (Driver’s Availability Window, DAW) at the driver layer corresponding to the target device, that is, the second time schedule can be used to indicate the data transmission time between the driver layer and the firmware layer.
[0050] It should be noted that, in the embodiments of the present application, the terminal device configured with the baseband chip and the target device can establish a communication connection in advance and negotiate a periodic available window AW, that is, establish a corresponding first time schedule. Based on this first time schedule, the driver layer of the baseband chip can establish a corresponding second time schedule for indicating the data transmission time between the driver layer and the firmware layer. Thus, it can be ensured that data packets can be sent to the firmware layer only within the data transmission period indicated by the second time schedule, and no data packets will be sent to the firmware layer outside the data transmission period indicated by the second time schedule, thereby ensuring that data communication between the two NAN devices, namely the terminal device and the target device, will only occur during the AW period.
[0051] It should be noted that in the embodiments of the present application, the preset transmission time can determine the time required for the driver layer to transmit a data packet to the firmware layer. Among them, the preset transmission time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the preset transmission time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer.
[0052] It should be noted that in the embodiments of the present application, the channel access time can determine the time required for the hardware layer to access the channel. Among them, the channel access time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the channel access time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer based on the network environment.
[0053] It should be noted that in the embodiments of the present application, the preset packet sending time can determine the time required for the hardware layer to send a data packet. Among them, the preset packet sending time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the preset packet sending time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer based on the length and sending rate of the data packet.
[0054] That is to say, in the embodiments of the present application, the firmware layer can send at least one of the following information to the driver layer: the preset transmission time, the channel access time, and the preset packet sending time. That is, at least one of the preset transmission time, the channel access time, and the preset packet sending time can be synchronized from the firmware layer to the driver layer.
[0055] Of course, the driver layer can also pre-store at least one of the following information: the preset transmission time, the channel access time, and the preset packet sending time. That is, at least one of the preset transmission time, the channel access time, and the preset packet sending time can also be determined and stored by the driver layer.
[0056] For example, one implementation is that the preset transmission time and the channel access time are synchronized from the firmware layer to the driver layer, while the preset packet sending time is determined by the driver layer. Another implementation is that the preset transmission time is synchronized from the firmware layer to the driver layer, while the preset packet sending time and the channel access time are determined by the driver layer. Another implementation is that the preset transmission time, the channel access time, and the preset packet sending time are all synchronized from the firmware layer to the driver layer. Another implementation is that the preset transmission time, the channel access time, and the preset packet sending time are all determined and stored by the driver layer.
[0057] It can be understood that in the embodiments of the present application, when generating the second time schedule according to the first time schedule, the preset transmission time, the channel access time, and the preset packet sending time, the driver layer can first determine the first start time and the first end time of each data transmission and reception cycle between the driver layer and the target device according to the first time schedule; then, the driver layer can determine the second start time of each data transmission cycle according to the preset transmission time, the channel access time, and the first start time of each data transmission and reception cycle; at the same time, the driver layer can determine the second end time of each data transmission cycle according to the preset transmission time, the channel access time, the preset packet sending time, and the first end time of each data transmission and reception cycle; finally, the driver layer can further generate the second time schedule according to the second start time and the second end time of each data transmission cycle.
[0058] That is to say, in the embodiments of the present application, after the driver layer obtains the first time schedule corresponding to the target device, it can determine each data transmission and reception cycle for data communication with the target device based on the first time schedule. Then, for the first start time and the first end time of each data transmission and reception cycle, relevant time parameters during data communication, such as the preset transmission time, the channel access time, the preset packet sending time, etc., can be used to adjust the first start time and the first end time to different extents, so as to obtain the second start time corresponding to the first start time and the second end time corresponding to the first end time. Finally, each data transmission cycle corresponding to each data transmission and reception cycle can be obtained according to the second start time and the second end time, and then the corresponding second time schedule can be generated based on each data transmission cycle.
[0059] Among them, when generating the second time schedule, the driver layer can determine the second start time of each data transmission cycle in the second time schedule according to the preset transmission time, the channel access time, and the first start time of each data transmission and reception cycle; the driver layer can also determine the second end time of each data transmission cycle in the second time schedule according to the preset transmission time, the channel access time, the preset packet sending time, and the first end time of each data transmission and reception cycle.
[0060] Furthermore, in the embodiments of the present application, when the driver layer determines the second start time of each data transmission cycle according to the preset transmission time, the channel access time, and the first start time of each data transmission and reception cycle, it can first perform an addition operation on the preset transmission time and the channel access time to obtain the first advance time; then, according to the first advance time and the first start time of each data transmission and reception cycle, it can determine the second start time of each data transmission cycle.
[0061] It should be noted that in the embodiments of the present application, considering time parameters such as the channel access time required for the hardware layer to perform channel access processing during the data communication process and the preset transmission time for the driver layer to send data to the firmware layer, the driver layer can choose to transmit data packets to the firmware layer before the first start time of a data transceiver cycle indicated by the first time schedule, that is, transmit the data packets in advance. Therefore, when determining the second time schedule, it is necessary to determine the specific advance start time, that is, the first advance time, according to the preset transmission time and the channel access time.
[0062] Exemplarily, in the embodiments of the present application, the first advance time can be represented as start_margin_drv, the preset transmission time can be represented as delay_drv_fw, and the channel access time can be represented as channel_access_time. Then, the first advance time start_margin_drv can be calculated by the following formula:
[0063] start_margin_drv = delay_drv_fw + channel_access_time (2)
[0064] Furthermore, the second start time corresponding to the first start time can be determined according to the first advance time. Among them, the first start time is represented as Taw1, and the second start time is represented as Tdaw1. Then, the second start time Tdaw1 can be calculated by the following formula:
[0065] Tdaw1 = Taw1 - start_margin_drv (3)
[0066] Further, in the embodiments of the present application, when the driver layer determines the second end time of each data transmission cycle according to the preset transmission time, the channel access time, the preset packet sending time, and the first end time of each data transceiver cycle, it can first perform an addition operation on the preset transmission time and the preset reservation time to obtain the second advance time; then, according to the second advance time and the first end time of each data transceiver cycle, determine the second end time of each data transmission cycle.
[0067] It should be noted that in the embodiments of the present application, considering time parameters such as the channel access time required for the hardware layer to perform channel access processing during the data communication process, the preset transmission time for the driver layer to send data to the firmware layer, and the preset packet sending time required for the hardware layer to send data, the driver layer can choose not to transmit data packets to the firmware layer before the first end moment of a data transceiver cycle indicated by the first time schedule, that is, to end the transmission of data packets in advance. Therefore, when determining the second time schedule, it is necessary to determine the specific advance end time, that is, the second advance time, according to the preset transmission time, channel access time, and preset packet sending time.
[0068] Exemplarily, in the embodiments of the present application, the second advance time can be represented as end_margin_drv, the preset transmission time can be represented as delay_drv_fw, the channel access time can be represented as channel_access_time, and the preset packet sending time can be represented as pkt_duration. Then, the second advance time end_margin_drv can be calculated by the following formula:
[0069] end_margin_drv = delay_drv_fw + channel_access_time + pkt_duration (4)
[0070] Furthermore, the second end moment corresponding to the first end moment can be determined according to the second advance time. Among them, the first end moment is represented as Taw2, and the second end moment is represented as Tdaw2. Then, the second end moment Tdaw2 can be calculated by the following formula:
[0071] Tdaw2 = Taw2 - end_margin_drv (5)
[0072] It can be understood that in the embodiments of the present application, based on the establishment of the second time schedule completed according to the first time schedule, the driver layer can transmit data packets to the firmware layer according to the data transmission cycle indicated by the second time schedule.
[0073] Exemplarily, in the embodiments of the present application, when the driver layer sends data packets to the firmware layer according to the second time schedule, it can choose to transmit data packets to the firmware layer at the second start moment Tdaw1 before the first start moment Taw1 of a data transceiver cycle indicated by the first time schedule. After the preset transmission time delay_drv_fw, the firmware layer receives the data packet. Then, after the firmware layer and the hardware layer complete the channel access processing through the channel access time channel_access_time, the data packet can be sent at the first start moment Taw1.
[0074] It can be seen that for the second time schedule established based on the first time schedule, when the driver layer transfers data to the firmware layer according to the second time schedule, it will not send data packets to the firmware layer too early, avoiding an increase in power consumption caused by waking up the chip too early, and can also control the sending timing, so that the data packets can be sent to the target device exactly at the first start time indicated by the first time schedule, reducing the time waste of AW and improving the data sending and receiving efficiency.
[0075] Exemplarily, in the embodiment of the present application, when the driver layer sends a data packet to the firmware layer according to the second time schedule, it can choose not to transfer data packets to the firmware layer anymore at the second end time Tdaw2 before the first end time Taw2 of a data sending and receiving cycle indicated by the first time schedule, so as to ensure that the data packets sent to the target device can all be successfully received. This is because if the driver layer transfers data packets to the firmware layer after the second end time Tdaw2, considering the preset transmission time delay_drv_fw from the driver layer to the firmware layer, the channel access time channel_access_time for channel access processing, and the preset packet sending time pkt_duration for the hardware layer to send a complete data packet to the target device, the time when the data packet is completely sent may fall outside the data sending and receiving cycle indicated by the first time schedule, that is, the end time of the data packet sending time is later than the end time of AW, resulting in the data packet not being successfully received by the target device.
[0076] It can be seen that for the second time schedule established based on the first time schedule, when the driver layer transfers data to the firmware layer according to the second time schedule, it will stop sending data packets to the firmware layer in advance, thus avoiding the situation of data packet reception failure caused by the time when the data packet is sent not being within AW, effectively reducing the error packet rate, and solving the problem of increasing the power consumption of the terminal device due to the retransmission process of data packets.
[0077] It should be noted that in the embodiment of the present application, the driver layer receives a sending instruction sent by the upper layer at the first moment, where the sending instruction carries the data packet to be sent, and the sending instruction is used to indicate sending the data packet to the target device.
[0078] It can be understood that in the embodiment of the present application, the driver layer has completed the establishment of the second time schedule based on the first time schedule. Therefore, for the sending instruction received at the first moment, the driver layer can transfer the data packet carried by the sending instruction to the firmware layer according to the data transmission cycle indicated by the second time schedule, so that the firmware layer can send the data packet to the target device according to the data sending and receiving cycle indicated by the first time schedule.
[0079] Further, in the embodiments of the present application, when the driver layer transmits the data packet carried by the send instruction according to the second time schedule, it may first determine whether the first moment when the send instruction is received is within the data transmission period indicated by the second time schedule, that is, first determine whether the first moment belongs to any data transmission period in the second time schedule. If the first moment belongs to a data transmission period in the second time schedule, then the driver layer may be allowed to send the data packet to the firmware layer at the first moment. Therefore, the driver layer may directly send the data packet to the firmware layer in the corresponding data transmission period.
[0080] Further, in the embodiments of the present application, when the driver layer transmits the data packet carried by the send instruction according to the second time schedule, it may first determine whether the first moment when the send instruction is received is within the data transmission period indicated by the second time schedule, that is, first determine whether the first moment belongs to any data transmission period in the second time schedule. If the first moment does not belong to any data transmission period in the second time schedule, then it may be determined that the driver layer is not allowed to send the data packet to the firmware layer at the first moment. Therefore, the driver layer needs to store the data packet first. At the same time, the driver layer may determine the first data transmission period after the first moment in the second time schedule as the target data transmission period for sending the data packet. Then, the driver layer may transmit the data packet to the firmware layer at the third start moment of the next target data transmission period.
[0081] It should be noted that in the embodiments of the present application, when the first moment does not belong to the data transmission period indicated by the second time schedule, if the data packet is transmitted to the firmware layer at the first moment, one possibility is that the moment when the firmware layer receives the data packet also does not belong to the data reception and transmission period indicated by the first time schedule. In this case, there will be a problem of increased power consumption caused by premature wake-up of the chip.
[0082] It should be noted that in the embodiments of the present application, when the first moment does not belong to the data transmission period indicated by the second time schedule, if the data packet is transmitted to the firmware layer at the first moment, another possibility is that although the moment when the firmware layer receives the data packet belongs to the data reception and transmission period indicated by the first time schedule, however, the end moment when the firmware layer and the hardware layer complete the transmission of the complete data packet falls outside the data reception and transmission period indicated by the first time schedule. In this case, the target device cannot successfully receive the data packet. At this time, retransmission due to transmission failure will also increase the power consumption to a certain extent.
[0083] It should be noted that in the embodiments of the present application, when the first moment does not belong to the data transmission period indicated by the second time schedule, if a data packet is transmitted to the firmware layer at the first moment, another possibility is that although the moment when the firmware layer receives the data packet belongs to the data transceiver cycle indicated by the first time schedule, the firmware layer and the hardware layer have not completed the channel access processing yet. Therefore, the data packet needs to be sent after the channel access time, which will occupy the time of the limited data transceiver cycle, thereby reducing the utilization rate of the AW and affecting the data communication efficiency.
[0084] It can be seen from this that in the embodiments of the present application, when the driver layer transmits data packets to the firmware layer according to the second time schedule, it can maximize the reduction of the power consumption of the terminal device on the basis of fully improving the utilization rate of the AW.
[0085] Furthermore, in the embodiments of the present application, Figure 5 is a schematic implementation process of the data communication method proposed in the embodiments of the present application Figure 2 , as Figure 5 shown, the method for the baseband chip to perform data communication may further include the following steps:
[0086] Step 201: When the firmware layer receives a data packet corresponding to the target device transmitted by the driver layer at the second moment, the firmware layer determines the third end moment of the current data transceiver cycle according to the first time schedule.
[0087] In the embodiments of the present application, when the firmware layer receives a data packet that needs to be sent to the target device transmitted by the driver layer at the second moment, it can first determine the end time of the current data transceiver cycle to which it currently belongs according to the first time schedule negotiated with the target device, that is, determine the third end moment.
[0088] It can be understood that in the embodiments of the present application, since the driver layer transmits data to the firmware layer based on the data transmission period indicated by the second time schedule, the second moment when the firmware layer receives the data packet belongs to a data transceiver cycle indicated by the first time schedule, that is, the second moment is within the current data transceiver cycle.
[0089] Step 202: If the time difference between the second moment and the third end moment is less than or equal to the preset reserved time, the firmware layer stops sending data packets to the target device.
[0090] In the embodiments of the present application, after the firmware layer determines the third end moment of the current data transceiver cycle to which it currently belongs according to the first time schedule, it can further determine the size relationship between the time difference between the second moment and the third end moment and the preset reserved time, and then select the sending opportunity for sending the data packet to the target device according to the size relationship between the two.
[0091] It should be noted that, in the embodiments of the present application, the preset reservation time can be obtained by calculating the channel access time and the preset packet sending time.
[0092] Exemplarily, in the embodiments of the present application, the preset reservation time can be denoted as end_margin, the channel access time can be denoted as channel_access_time, and the preset packet sending time can be denoted as pkt_duration. Then, the preset reservation time end_margin can be obtained by the following formula:
[0093] end_margin = channel_access_time + pkt_duration (6)
[0094] It can be seen that the preset reservation time is the sum of the channel access time and the preset packet sending time, that is, the preset reservation time represents the time required for channel access processing and data sending processing when sending data.
[0095] Furthermore, in the embodiments of the present application, if the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, it can be considered that the remaining time of the current data transceiver cycle is not sufficient to completely send a complete data packet. Therefore, the firmware layer can choose to stop sending data packets to the target device.
[0096] It can be understood that, in the embodiments of the present application, for the data packet received at the second moment, when the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, if the firmware layer still sends the data packet to the target device, then after the channel access time and the preset packet sending time, the end moment when the firmware layer and the hardware layer complete the sending of the complete data packet may fall outside the current data transceiver cycle, so that the target device cannot successfully receive the data packet. Therefore, when the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, the firmware layer stops the sending process of the data packet, thereby solving the problem of increased power consumption caused by the retransmission process after the sending failure.
[0097] Step 203: If the time difference between the second moment and the third end moment is greater than the preset reservation time, the firmware layer sends a data packet to the target device at the second moment.
[0098] In an embodiment of the present application, after the firmware layer determines the third end time of the current data transceiver cycle to which it currently belongs according to the first time schedule, it can further determine the magnitude relationship between the time difference between the second time and the third end time and the preset reserved time, and then select the transmission timing of sending the data packet to the target device according to the magnitude relationship between the two.
[0099] Further, in an embodiment of the present application, if the time difference between the second time and the third end time is greater than the preset reserved time, it can be considered that the remaining time of the current data transceiver cycle can ensure the complete transmission of the entire data packet. Therefore, the firmware layer can directly send the data packet to the target device at the second time.
[0100] In summary, in an embodiment of the present application, for the data communication methods proposed in steps 101 to 103 and steps 201 to 203, on the one hand, the driver layer can maintain a DAW time schedule based on the AW time schedule, that is, construct a second time schedule based on the first time schedule, and can choose to send the data packet to the firmware layer within the data transmission cycle indicated by the second time schedule, and it is not allowed to send the data packet to the firmware layer outside the data transmission cycle indicated by the second time schedule. Among them, even if the driver layer receives a data packet sent by the upper layer outside the data transmission cycle indicated by the second time schedule, it will not transmit the data packet to the firmware layer, so the chip will not be woken up prematurely. Instead, according to the second time schedule, the data packet is sent to the firmware layer before the first start time of the data transceiver cycle indicated by the first time schedule. Correspondingly, the firmware layer does not schedule the data packet at the start time of AW, but schedules the data packet in advance for a period of time, that is, schedules the packet for transmission at the channel access time before the first start time of the data transceiver cycle indicated by the first time schedule, so that the firmware layer can just send the data packet at the first start time, that is, just wake up the chip at the first start time, reducing the occupation of AW by the channel access processing and the data packet transmission process, and thus can, on the basis of improving the utilization rate of AW, minimize the power consumption to the greatest extent.
[0101] On the other hand, in the data communication method provided by the embodiments of the present application, the time when the firmware layer stops sending data packets is no longer the first end moment of the data transceiver cycle indicated by the first time schedule, that is, the firmware layer does not select to stop sending data packets according to the end moment of AW. Instead, it stops the packet sending process some time before the end moment of AW. Among them, it is possible to allow sending data packets to the hardware layer before a preset reserved time (end_margin) before the first end moment, and not allow sending data packets to the hardware layer after the preset reserved time (end_margin) before the first end moment, so as to reduce the error packet rate and further reduce the power consumption generated by the retransmission process.
[0102] The embodiments of the present application provide a data communication method, which is applied to a baseband chip. The baseband chip includes a driver layer, a firmware layer, and a hardware layer; the firmware layer sends a first time schedule to the driver layer; the first time schedule is used to indicate the data transceiver time with a target device; when a sending instruction corresponding to the target device is received at a first moment, the driver layer transmits the data packet carried by the sending instruction according to a second time schedule corresponding to the first time schedule; the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer. It can be seen that in the embodiments of the present application, the driver layer maintains a second time schedule (DAW) based on the first time schedule (AW) used by the firmware layer. This second time schedule can indicate the data transmission time between the driver layer and the firmware layer, so that when the driver layer sends data packets to the firmware layer according to the data transmission cycle indicated by the second time schedule, it can ensure that the firmware layer sends data packets to the target device exactly at the start moment of the data transceiver cycle indicated by the first time schedule, thereby reducing the power consumption generated by waking up the chip too early and improving the utilization rate of the data transmission cycle; it can also ensure that the firmware layer can stop the packet sending process before the end moment of the data transceiver cycle indicated by the first time schedule, thus solving the problem that the data packet cannot be successfully received by the target device and overcoming the defect of increased power consumption caused by the retransmission process. That is to say, in the data communication method provided by the embodiments of the present application, since the driver layer can maintain the DAW generated based on AW and use DAW to control the transmission timing of data packets, it can improve the effective utilization rate of AW while minimizing the device power consumption.
[0103] Based on the above embodiments, in another embodiment of the present application, a data communication method is proposed. The data communication method can be applied to a baseband chip. The baseband chip may include a driver layer (Driver layer), a firmware layer (FW layer), and a hardware layer (HW layer). Among them, the Driver layer is mainly responsible for sending instructions and data sent from the upper layer to the FW layer, and forwarding data from the FW layer to the upper layer; the FW layer is in the middle of the Driver layer and the hardware layer, responsible for managing, scheduling, and sending data from the Driver layer to the hardware layer, and also sending data from the hardware layer to the Driver layer; the hardware layer is mainly responsible for channel access, sending data from the FW layer to the air interface, and sending data received from the air interface to the FW layer.
[0104] To solve the problems of increased power consumption caused by waking up the chip during non-AW periods in related technologies, increased power consumption caused by retransmission processing when the last data packet may not be successfully received, and low AW utilization rate, the data communication method proposed in the embodiments of the present application mainly includes the following aspects:
[0105] On the one hand, the Driver layer maintains a DAW time schedule (second time schedule), and this DAW time schedule describes the packet sending time window on the Driver layer. Among them, during DAW, the Driver layer sends data packets to the FW layer, and during non-DAW, the Driver layer does not send data packets to the FW layer. DAW is a new time schedule generated based on the AW table (first time schedule) updated by the FW layer to the Driver layer.
[0106] On the other hand, during non-DAW, even if the Driver layer receives data packets from the upper layer, it will not send the data packets to the FW layer, so as not to wake up the chip prematurely. Instead, it is selected to start sending data packets to the FW layer and wake up the chip for data transmission a period of time (such as the first advance time start_margin_drv) before the start of AW.
[0107] It can be understood that in the embodiments of the present application, it is precisely because the Driver layer does not transmit the data packets to the FW layer when it receives the data packets sent by the upper layer outside the data transmission period indicated by the second time schedule (i.e., during non-DAW), so it will not wake up the chip prematurely. Instead, according to the second time schedule, data packets are sent to the FW layer before the first start moment of the data reception and transmission period indicated by the first time schedule, thereby reducing the occupation of AW during the data packet transmission process. On the basis of improving the utilization rate of AW, the power consumption is minimized.
[0108] On the other hand, instead of scheduling and sending data packets at the starting moment of AW, the FW layer chooses to schedule and send data packets a period of time in advance (such as the channel access time channel_access_time).
[0109] It can be understood that in the embodiments of the present application, since the Driver layer sends data packets to the FW layer before the first starting moment of the data transceiver cycle indicated by the first time schedule according to the second time schedule, correspondingly, the FW layer does not schedule data packets at the starting moment of AW either. Instead, it schedules data packets a period of time in advance, that is, it schedules packets for sending at the channel access time (channel_access_time) before the first starting moment of the data transceiver cycle indicated by the first time schedule, so that the FW layer can just send data packets at the first starting moment, that is, just wake up the chip at the first starting moment, reducing the occupation of AW by channel access processing, and thus improving the utilization rate of AW.
[0110] That is to say, in the embodiments of the present application, for the first packet sent during AW, the FW layer does not send the packet to the air interface at the moment when AW starts, but sends it at the moment of channel_access_time before AW starts. In this way, the first packet has completed channel access at the starting moment of AW, and the channel access time of the first packet does not occupy AW, thereby improving the effective utilization rate of AW.
[0111] On the other hand, instead of stopping sending packets at the end moment of AW, the FW layer stops sending packets to the HW layer a period of time in advance (such as the preset preparation time end_margin) before the end moment of AW. And the Driver layer also stops sending packets to the FW layer a period of time in advance (such as the second advance time end_margin_drv) before the end moment of AW.
[0112] It can be understood that in the embodiments of the present application, since the FW layer does not choose to stop sending data packets according to the end moment of AW, but stops the packet sending process a period of time before the end moment of AW. For example, it can be selected to allow sending data packets to the hardware layer before the preset reserved time (end_margin) before the first end moment, and not allow sending data packets to the hardware layer after the preset reserved time (end_margin) before the first end moment, thereby reducing the error packet rate and further reducing the power consumption generated by retransmission processing.
[0113] That is to say, in the embodiments of the present application, the FW layer no longer stops sending packets to the target device (such as Rx device) at the end of AW, but stops sending packets to the Rx device a period of time (such as end_margin) in advance before the end of AW, and the Driver layer stops sending packets to the FW layer at the end of DAW. This avoids the situation that the last packet before the end of AW cannot be received by the Rx device, reduces the PER, and also saves the power consumption of packet retransmission due to reception failure.
[0114] Figure 6 The timing diagram corresponding to the data communication method proposed in the embodiments of the present application Figure 1 , as Figure 6 shown, at the terminal device (Tx device) configured with a baseband chip, the Driver layer needs to store a second time schedule (DAW) generated based on the first time schedule (AW) of the FW layer. First, the Tx device and the target device (Rx device) negotiate AW. After the AW is negotiated, the FW layer sends the negotiated AW schedule to the Driver layer, and the Driver layer generates DAW based on AW. Among them, the start time (Tdaw1) of DAW can be determined by the start time (Taw1) of AW and the first advance time (start_margin_drv), as shown in the above formula (3); and the end time (Tdaw2) of DAW can be determined by the end time (Taw2) of AW and the second advance time (end_margin_drv), as shown in the above formula (5).
[0115] It can be understood that in the embodiments of the present application, start_margin_drv can be determined by the preset transmission time (delay_drv_fw) and the channel access time (channel_access_time), as shown in the above formula (2); end_margin_drv can be determined by the preset transmission time (delay_drv_fw), the channel access time (channel_access_time), and the preset packet sending time (pkt_duration), as shown in the above formula (4).
[0116] Further, in the embodiments of the present application, for the Tx device side, when the Driver layer receives a data packet during non-DAW, such as data packet #1, it will not immediately send it to the FW layer. Instead, it will first store the data packet on the Driver layer until the start moment of DAW, and then the Driver layer will send the data packet to the FW layer. After a delay of delay_drv_fw, the FW layer receives the data packet and then immediately schedules and sends it to the air interface. At this time, the time difference from the start moment of AW is channel_access_time, and after the HW layer processes the channel access, it is sent to the RX device, that is, the sending moment of the data packet is exactly the start moment of AW. This not only solves the problem of increased power consumption caused by waking up the chip during non-AW, but also overcomes the defect of low AW utilization rate.
[0117] Figure 7 The timing diagram corresponding to the data communication method proposed in the embodiments of the present application Figure 2 , such as Figure 7 shown. To address the problem that the last data packet may not be successfully received by the RX device before the end of AW, in the embodiments of the present application, for the Tx device side, during AW, the FW layer can choose to stop sending packets to the HW layer a period of time in advance (such as the preset reserved time end_margin) before the end of AW. end_margin refers to the time required to successfully send a packet (received by the Rx device) before the end of AW. Among them, end_margin can be determined by channel_access_time and pkt_duration, as shown in the above formula (6).
[0118] Further, in the embodiments of the present application, for the Tx device side, after the Driver layer receives a data packet sent by the upper layer, it can first determine whether to send the data packet to the FW layer. If the moment of receiving the data packet is during DAW, it will be immediately sent by the Driver layer to the FW layer; if the moment of receiving the data packet is during non-DAW, such as data packet #3, the Driver layer will first store the data packet and send it in the next DAW window. For example, although the moment of receiving data packet #3 is during AW, it is during non-DAW, so data packet #3 is not sent by the Driver layer during the current AW, but is delayed until the next DAW window, so as to ensure that data packet #3 can be successfully received by the Rx device.
[0119] The embodiment of the present application provides a data communication method. The driver layer maintains a second time schedule (DAW) based on the first time schedule (AW) used by the firmware layer. The second time schedule can indicate the data transmission time between the driver layer and the firmware layer, so that when the driver layer sends data packets to the firmware layer according to the data transmission cycle indicated by the second time schedule, it can ensure that the firmware layer just sends data packets to the target device at the start moment of the data reception and transmission cycle indicated by the first time schedule, thereby reducing the power consumption caused by premature wake-up of the chip and improving the utilization rate of the data transmission cycle. It can also ensure that the firmware layer stops packet sending processing before the end moment of the data reception and transmission cycle indicated by the first time schedule, thereby solving the problem that data packets cannot be successfully received by the target device and overcoming the defect of increased power consumption caused by retransmission processing. That is to say, in the data communication method proposed in the embodiment of the present application, since the driver layer can maintain the DAW generated based on the AW and use the DAW to control the transmission timing of data packets, it can improve the effective utilization rate of the AW while minimizing the device power consumption.
[0120] Based on the above embodiment, an embodiment of the present application provides a baseband chip. Figure 8 It is a schematic diagram of the composition structure of the driver chip, as Figure 8 shown. The baseband chip 10 may include a driver layer 11, a firmware layer 12, and a hardware layer 13. Among them, the driver layer is mainly responsible for sending the instructions and data sent by the upper layer to the firmware layer, and forwarding the data from the firmware layer to the upper layer; the firmware layer is in the middle of the driver layer and the hardware layer, responsible for managing, scheduling, and sending the data from the driver layer to the hardware layer, and also sending the data from the hardware layer to the driver layer; the hardware layer is mainly responsible for channel access, sending the data from the firmware layer to the air interface, and sending the data received from the air interface to the firmware layer.
[0121] It should be noted that in the embodiment of the present application, the firmware layer is used to send the first time schedule to the driver layer; among them, the first time schedule is used to indicate the data reception and transmission time with the target device.
[0122] It can be understood that in the embodiment of the present application, a communication connection can be established with the target device in advance, so that the corresponding first time schedule can be determined through the communication connection with the target device. Among them, the first time schedule is used to determine the available window AW corresponding to the target device, that is, the first time schedule can be used to indicate the data reception and transmission time with the target device.
[0123] It should be noted that in the embodiments of the present application, the terminal device configured with this baseband chip and the target device can belong to the same NAN cluster. Among them, data communication can be carried out between the terminal device configured with this baseband chip and the target device. To ensure successful data communication between the two, the two devices can establish a communication connection in advance and negotiate a periodic available window AW, that is, establish a corresponding first time schedule.
[0124] Furthermore, in the embodiments of the present application, the first time schedule is used to indicate the data transmission and reception time between this baseband chip and the target device. That is to say, the terminal device configured with this baseband chip and the target device can carry out data communication only within the data transmission and reception period indicated by the first time schedule, and no data communication will be carried out outside the data transmission and reception period indicated by the first time schedule. That is, these two NAN devices will carry out data communication only during the AW period and will not transmit or receive data during the non-AW period.
[0125] It should be noted that in the embodiments of the present application, the first time schedule negotiated with the target device can be stored in the firmware layer of the baseband chip. The firmware layer can send the first time schedule to the driver layer, so that the driver layer can know the data transmission and reception time for the firmware layer to execute data transmission and reception processing.
[0126] Furthermore, in the embodiments of the present application, the driver layer is used to generate a second time schedule according to the first time schedule, a preset transmission time, a channel access time, and a preset packet sending time; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
[0127] Furthermore, in the embodiments of the present application, the driver layer is also used to determine the first start time and the first end time of each data transmission and reception period between the driver layer and the target device according to the first time schedule; determine the second start time of each data transmission period according to the preset transmission time, the channel access time, and the first start time of each data transmission and reception period; determine the second end time of each data transmission period according to the preset transmission time, the channel access time, the preset packet sending time, and the first end time of each data transmission and reception period; generate the second time schedule according to the second start time and the second end time of each data transmission period.
[0128] Furthermore, in the embodiments of the present application, the driver layer is also used to perform an addition operation on the preset transmission time and the channel access time to obtain a first advance time; determine the second start time of each data transmission period according to the first advance time and the first start time of each data transmission and reception period.
[0129] Further, in the embodiments of the present application, the driver layer is further configured to perform an addition operation on the preset transmission time, the channel access time, and the preset packet sending time to obtain a second advance time; and determine the second end time of each data transmission cycle according to the second advance time and the first end time of each data transceiver cycle.
[0130] It can be understood that in the embodiments of the present application, the second time schedule is used to determine the available window DAW at the driver layer end corresponding to the target device, that is, the second time schedule can be used to indicate the data transmission time between the driver layer and the firmware layer.
[0131] It should be noted that in the embodiments of the present application, based on the first time schedule, the driver layer of the baseband chip can establish a corresponding second time schedule for indicating the data transmission time between the driver layer and the firmware layer. Thereby, it can be ensured that packets can be sent to the firmware layer only within the data transmission cycles indicated by the second time schedule, and no packets will be sent to the firmware layer outside the data transmission cycles indicated by the second time schedule, so as to ensure that data communication between the two NAN devices, namely the terminal device and the target device, will only occur during the AW period.
[0132] It should be noted that in the embodiments of the present application, the preset transmission time can determine the time required for the driver layer to transmit a packet to the firmware layer. Among them, the preset transmission time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the preset transmission time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer.
[0133] It should be noted that in the embodiments of the present application, the channel access time can determine the time required for the hardware layer to access the channel. Among them, the channel access time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the channel access time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer based on the network environment.
[0134] It should be noted that in the embodiments of the present application, the preset packet sending time can determine the time required for the hardware layer to send a packet. Among them, the preset packet sending time can be directly determined by the driver layer or obtained by the driver layer from the firmware layer. On the other hand, the preset packet sending time can be pre-set by the driver layer and / or the firmware layer, or can be determined in real time by the driver layer and / or the firmware layer based on the length and sending rate of the packet.
[0135] That is to say, in the embodiments of the present application, the firmware layer may send at least one of the following information to the driver layer: preset transmission time, channel access time, and preset packet sending time. That is, at least one of the preset transmission time, channel access time, and preset packet sending time may be synchronized from the firmware layer to the driver layer.
[0136] Of course, the driver layer may also pre-store at least one of the following information: preset transmission time, channel access time, and preset packet sending time. That is, at least one of the preset transmission time, channel access time, and preset packet sending time may also be determined and stored by the driver layer.
[0137] It can be understood that, in the embodiments of the present application, after the driver layer obtains the first time schedule corresponding to the target device, it may determine each data transceiver cycle for data communication with the target device based on the first time schedule. Then, for the first start time and the first end time of each data transceiver cycle, time parameters related to data communication, such as preset transmission time, channel access time, preset packet sending time, etc., are used to adjust the first start time and the first end time to different extents, so as to obtain the second start time corresponding to the first start time and the second end time corresponding to the first end time. Finally, each data transmission cycle corresponding to each data transceiver cycle can be obtained according to the second start time and the second end time, and then the second time schedule can be generated based on each data transmission cycle.
[0138] It should be noted that, in the embodiments of the present application, considering time parameters such as the channel access time required for the hardware layer to perform channel access processing during data communication and the preset transmission time for the driver layer to send data to the firmware layer, the driver layer may choose to transmit data packets to the firmware layer before the first start time of a data transceiver cycle indicated by the first time schedule, that is, transmit the data packets in advance. Therefore, when determining the second time schedule, it is necessary to determine the specific advance start time, that is, the first advance time, according to the preset transmission time and the channel access time.
[0139] It should be noted that, in the embodiments of the present application, considering time parameters such as the channel access time required for the hardware layer to perform channel access processing during data communication, the preset transmission time for the driver layer to send data to the firmware layer, and the preset packet sending time required for the hardware layer to send data, the driver layer may choose not to transmit data packets to the firmware layer before the first end time of a data transceiver cycle indicated by the first time schedule, that is, end the transmission of data packets in advance. Therefore, when determining the second time schedule, it is necessary to determine the specific advance end time, that is, the second advance time, according to the preset transmission time, the channel access time, and the preset packet sending time.
[0140] Exemplarily, in the embodiments of the present application, when the driver layer sends a data packet to the firmware layer according to the second time schedule, it can choose to transmit the data packet to the firmware layer at a second start time Tdaw1 before the first start time Taw1 of a data transmission and reception cycle indicated by the first time schedule. After a preset transmission time delay_drv_fw, the firmware layer receives the data packet. Then, after the firmware layer and the hardware layer complete the channel access process through the channel access time channel_access_time, the data packet can be sent at the first start time Taw1.
[0141] It can be seen that based on the second time schedule established based on the first time schedule, when the driver layer performs data transmission to the firmware layer according to the second time schedule, it will not send the data packet to the firmware layer too early, avoiding an increase in power consumption caused by waking up the chip too early. It can also control the sending timing so that the data packet can be exactly sent to the target device at the first start time indicated by the first time schedule, reducing the time waste of AW and improving the data transmission and reception efficiency.
[0142] Exemplarily, in the embodiments of the present application, when the driver layer sends a data packet to the firmware layer according to the second time schedule, it can choose to stop transmitting data packets to the firmware layer at a second end time Tdaw2 before the first end time Taw2 of a data transmission and reception cycle indicated by the first time schedule, so as to ensure that all data packets sent to the target device can be successfully received. This is because if the driver layer transmits a data packet to the firmware layer after the second end time Tdaw2, considering the preset transmission time delay_drv_fw from the driver layer to the firmware layer, the channel access time channel_access_time for performing the channel access process, and the preset packet sending time pkt_duration for the hardware layer to send the complete data packet to the target device, the time when the data packet is completely sent may fall outside the data transmission and reception cycle indicated by the first time schedule, that is, the end time of the data packet sending time is later than the end time of AW, resulting in the data packet not being successfully received by the target device.
[0143] It can be seen that based on the second time schedule established based on the first time schedule, when the driver layer performs data transmission to the firmware layer according to the second time schedule, it will stop sending data packets to the firmware layer in advance, thus avoiding the situation where the data packet cannot be received successfully because the time when the data packet is sent is not within AW, effectively reducing the packet error rate, and solving the problem of increasing the power consumption of the terminal device due to the retransmission process of the data packet.
[0144] Further, in the embodiments of the present application, the driver layer is further configured to, when receiving the sending instruction corresponding to the target device at the first moment, transmit the data packet carried by the sending instruction according to the second time schedule, so that the firmware layer and the hardware layer send the data packet to the target device according to the first time schedule.
[0145] Further, in the embodiments of the present application, the driver layer is further configured to, if the first moment does not belong to any data transmission period in the second time schedule, store the data packet, and at the same time determine the first data transmission period after the first moment in the second time schedule as the target data transmission period corresponding to the data packet; transmit the data packet to the firmware layer at the third start moment of the target data transmission period.
[0146] Further, in the embodiments of the present application, the driver layer is further configured to, if the first moment belongs to a data transmission period in the second time schedule, the driver layer transmits the data packet to the firmware layer at the first moment.
[0147] It should be noted that, in the embodiments of the present application, the driver layer receives the sending instruction sent by the upper layer at the first moment, where the sending instruction carries the data packet to be sent, and the sending instruction is used to instruct to send the data packet to the target device.
[0148] Further, in the embodiments of the present application, when the driver layer transmits the data packet carried by the sending instruction according to the second time schedule, it may first determine whether the first moment when the sending instruction is received is within the data transmission period indicated by the second time schedule, that is, first determine whether the first moment belongs to any data transmission period in the second time schedule. If the first moment belongs to a data transmission period in the second time schedule, then the driver layer is allowed to send the data packet to the firmware layer at the first moment. Therefore, the driver layer can directly send the data packet to the firmware layer in the data transmission period to which it belongs. If the first moment does not belong to any data transmission period in the second time schedule, then it can be determined that the driver layer is not allowed to send the data packet to the firmware layer at the first moment. Therefore, the driver layer needs to store the data packet first. At the same time, the driver layer can determine the first data transmission period after the first moment in the second time schedule as the target data transmission period for sending the data packet. Then, the driver layer can transmit the data packet to the firmware layer at the third start moment of the next target data transmission period.
[0149] It should be noted that in the embodiments of the present application, when the first moment does not belong to the data transmission period indicated by the second time schedule, if a data packet is transmitted to the firmware layer at the first moment, one possibility is that the moment when the firmware layer receives the data packet also does not belong to the data reception and transmission period indicated by the first time schedule. At this time, there will be a problem of increased power consumption caused by premature wake-up of the chip. Another possibility is that although the moment when the firmware layer receives the data packet belongs to the data reception and transmission period indicated by the first time schedule, however, the end moment when the firmware layer and the hardware layer complete the transmission of the complete data packet falls outside the data reception and transmission period indicated by the first time schedule. In this way, the target device cannot successfully receive the data packet. At this time, the retransmission process due to the transmission failure will also increase the power consumption to a certain extent. Another possibility is that although the moment when the firmware layer receives the data packet belongs to the data reception and transmission period indicated by the first time schedule, however, the firmware layer and the hardware layer have not completed the channel access process. Therefore, the data packet needs to be transmitted after the channel access time. In this way, it will occupy the time of the limited data reception and transmission period, thereby reducing the utilization rate of AW and affecting the data communication efficiency.
[0150] It can be seen from this that in the embodiments of the present application, when the driver layer transmits data packets to the firmware layer according to the second time schedule, it can maximize the reduction of the power consumption of the terminal device on the basis of fully improving the utilization rate of AW.
[0151] Furthermore, in the embodiments of the present application, the firmware layer is further configured to, when receiving the data packet corresponding to the target device transmitted by the driver layer at the second moment, determine the third end moment of the current data reception and transmission period according to the first time schedule; if the time difference between the second moment and the third end moment is less than or equal to the preset reserved time, stop transmitting the data packet to the target device; if the time difference between the second moment and the third end moment is greater than the preset reserved time, transmit the data packet to the target device at the second moment; where the preset reserved time is the sum of the channel access time and the preset data packet transmission time.
[0152] It can be understood that in the embodiments of the present application, since the driver layer transmits data to the firmware layer based on the data transmission period indicated by the second time schedule, therefore, the second moment when the firmware layer receives the data packet belongs to a data reception and transmission period indicated by the first time schedule, that is, the second moment is within the current data reception and transmission period.
[0153] It should be noted that in the embodiments of the present application, the preset reservation time can be obtained by calculating the channel access time and the preset packet sending time. The preset reservation time is the sum of the channel access time and the preset packet sending time, that is, the preset reservation time represents the time required for channel access processing and data sending processing when sending data.
[0154] Further, in the embodiments of the present application, if the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, it can be considered that the remaining time of the current data transceiver cycle is not sufficient to completely send a complete data packet. Therefore, the firmware layer can choose to stop sending the data packet to the target device.
[0155] It can be understood that in the embodiments of the present application, for the data packet received at the second moment, in the case where the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, if the firmware layer still sends the data packet to the target device, then after the channel access time and the preset packet sending time, the end moment when the firmware layer and the hardware layer complete the sending of the complete data packet may fall outside the current data transceiver cycle, so that the target device cannot successfully receive the data packet. Therefore, when the time difference between the second moment and the third end moment is less than or equal to the preset reservation time, the firmware layer stops the sending process of the data packet, thus solving the problem of increased power consumption caused by retransmission processing after sending failure.
[0156] Further, in the embodiments of the present application, if the time difference between the second moment and the third end moment is greater than the preset reservation time, it can be considered that the remaining time of the current data transceiver cycle can ensure the complete sending of a complete data packet. Therefore, the firmware layer can directly send the data packet to the target device at the second moment.
[0157] The embodiments of the present application also provide a terminal device. Figure 9 For the schematic diagram of the composition structure of the terminal device, as Figure 9 shown, the terminal device 20 may be configured with a baseband chip 10, and the baseband chip 10 may include a driver layer 11, a firmware layer 12, and a hardware layer 13. Among them, the driver layer is mainly responsible for sending the instructions and data sent from the upper layer to the firmware layer, and forwarding the data from the firmware layer to the upper layer; the firmware layer is in the middle of the driver layer and the hardware layer, responsible for managing, scheduling, and sending the data from the driver layer to the hardware layer, and also sending the data from the hardware layer to the driver layer; the hardware layer is mainly responsible for channel access, sending the data from the firmware layer to the air interface, and sending the data received from the air interface to the firmware layer.
[0158] In summary, for the baseband chip and the terminal device configured with the baseband chip proposed in the embodiments of the present application, on the one hand, the driver layer can maintain a DAW time schedule based on the AW time schedule, that is, construct a second time schedule based on the first time schedule, and can choose to send data packets to the firmware layer within the data transmission period indicated by the second time schedule, and not allow sending data packets to the firmware layer outside the data transmission period indicated by the second time schedule. Among them, even if the driver layer receives a data packet sent by the upper layer outside the data transmission period indicated by the second time schedule, it will not transmit the data packet to the firmware layer, so the chip will not be woken up prematurely. Instead, according to the second time schedule, the data packet is sent to the firmware layer before the first start time of the data reception and transmission period indicated by the first time schedule. Correspondingly, the firmware layer does not schedule the data packet at the start time of AW, but schedules the data packet in advance for a period of time, that is, schedules the packet for transmission at the channel access time before the first start time of the data reception and transmission period indicated by the first time schedule, so that the firmware layer can just send the data packet at the first start time, that is, just wake up the chip at the first start time, reducing the occupation of AW by the channel access processing and the data packet transmission process, and further reducing the power consumption to the greatest extent on the basis of improving the utilization rate of AW.
[0159] On the other hand, for the data communication method proposed in the embodiments of the present application, the time when the firmware layer stops sending data packets is no longer the first end time of the data reception and transmission period indicated by the first time schedule, that is, the firmware layer does not choose to stop sending data packets according to the end time of AW, but stops the packet sending process some time before the end time of AW. Among them, it can be selected to allow sending data packets to the hardware layer before the preset reserved time (end_margin) before the first end time, and not allow sending data packets to the hardware layer after the preset reserved time (end_margin) before the first end time, so as to reduce the error packet rate and further reduce the power consumption generated by the retransmission process.
[0160] Embodiments of the present application provide a baseband chip and a terminal device configured with the baseband chip. The baseband chip includes a driver layer, a firmware layer, and a hardware layer; the firmware layer sends a first time schedule to the driver layer; wherein, the first time schedule is used to indicate the data transmission and reception time with a target device; when a transmission instruction corresponding to the target device is received at a first moment, the driver layer transmits the data packet carried by the transmission instruction according to a second time schedule corresponding to the first time schedule; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer. It can be seen that in the embodiments of the present application, the driver layer maintains a second time schedule (DAW) based on the first time schedule (AW) used by the firmware layer. This second time schedule can indicate the data transmission time between the driver layer and the firmware layer, so that when the driver layer sends data packets to the firmware layer according to the data transmission period indicated by the second time schedule, it can ensure that the firmware layer sends data packets to the target device exactly at the start moment of the data transmission and reception period indicated by the first time schedule, thereby reducing the power consumption caused by premature wake-up of the chip and improving the utilization rate of the data transmission period; it can also ensure that the firmware layer stops packet sending processing before the end moment of the data transmission and reception period indicated by the first time schedule, thereby solving the problem that data packets cannot be successfully received by the target device and overcoming the defect of increased power consumption caused by retransmission processing. That is to say, the data communication method proposed in the embodiments of the present application, since the driver layer can maintain DAW generated based on AW and use DAW to control the transmission timing of data packets, can improve the effective utilization rate of AW while minimizing the device power consumption.
[0161] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0162] The present application is described with reference to the schematic flowchart and / or block diagram of the implementation process of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each process and / or block in the schematic flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the schematic flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the implementation process schematic Figure 1 one process or multiple processes and / or blocksFigure 1 means for the functions specified in one or more boxes.
[0163] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one or more of the illustrated Figure 1 flows or more flows and / or boxes Figure 1 in one or more boxes.
[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the illustrated Figure 1 flows or more flows and / or boxes Figure 1 in one or more boxes.
[0165] As described above, it is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A data communication method, characterized in that, the data communication method is applied to a baseband chip, and the baseband chip includes a driver layer, a firmware layer, and a hardware layer; the method includes: determining a first time schedule through a communication connection with a target device; wherein, the first time schedule is used to indicate the data transceiver time with the target device; the firmware layer sends the first time schedule to the driver layer; when a transmission instruction corresponding to the target device is received at a first moment, the driver layer transmits the data packet carried by the transmission instruction according to a second time schedule corresponding to the first time schedule; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
2. The method according to claim 1, characterized in that, after the firmware layer sends the first time schedule to the driver layer, the method further includes: the driver layer determines a first start time and a first end time of each data transceiver cycle with the target device according to the first time schedule; the driver layer determines a second start time of each data transmission cycle according to a preset transmission time, a channel access time, and the first start time of each data transceiver cycle; the driver layer determines the second end time of each data transmission cycle according to the preset transmission time, the channel access time, a preset packet sending time, and the first end time of each data transceiver cycle; the driver layer generates the second time schedule according to the second start time and the second end time of each data transmission cycle.
3. The method according to claim 2, characterized in that, the driver layer determines a second start time of each data transmission cycle according to a preset transmission time, a channel access time, and the first start time of each data transceiver cycle, including: the driver layer performs an addition operation on the preset transmission time and the channel access time to obtain a first advance time; the driver layer determines the second start time of each data transmission cycle according to the first advance time and the first start time of each data transceiver cycle.
4. The method according to claim 2, characterized in that, the driver layer determines the second end time of each data transmission cycle according to the preset transmission time, the channel access time, a preset packet sending time, and the first end time of each data transceiver cycle, including: the driver layer performs an addition operation on the preset transmission time, the channel access time, and the preset packet sending time to obtain a second advance time; the driver layer determines the second end time of each data transmission cycle according to the second advance time and the first end time of each data transceiver cycle.
5. The method according to any one of claims 1-4, characterized in that, When receiving the sending instruction corresponding to the target device at the first moment, the driver layer transmits the data packet carried by the sending instruction according to the second time schedule corresponding to the first time schedule, including: If the first moment does not belong to any data transmission period in the second time schedule, the driver layer stores the data packet, and at the same time determines the first data transmission period after the first moment in the second time schedule as the target data transmission period corresponding to the data packet; The driver layer transmits the data packet to the firmware layer at the third start moment of the target data transmission period.
6. The method according to any one of claims 1-4, wherein, When receiving the sending instruction corresponding to the target device at the first moment, the driver layer transmits the data packet carried by the sending instruction according to the second time schedule corresponding to the first time schedule, including: If the first moment belongs to a data transmission period in the second time schedule, the driver layer transmits the data packet to the firmware layer at the first moment.
7. The method according to claim 1, wherein, The method further includes: When receiving the data packet corresponding to the target device transmitted by the driver layer at the second moment, the firmware layer determines the third end moment of the current data sending and receiving period according to the first time schedule; If the time difference between the second moment and the third end moment is less than or equal to the preset reserved time, the firmware layer stops sending the data packet to the target device; If the time difference between the second moment and the third end moment is greater than the preset reserved time, the firmware layer sends the data packet to the target device at the second moment.
8. The method according to claim 7, wherein, The preset reserved time is the sum of the channel access time and the preset packet sending time.
9. The method according to claim 8, wherein, The method further includes: The firmware layer sends at least one of the following information to the driver layer: the preset transmission time, the channel access time, the preset packet sending time.
10. The method according to claim 8, wherein, The method further includes: The driver layer pre-stores at least one of the following information: the preset transmission time, the channel access time, the preset packet sending time.
11. A baseband chip, wherein, The baseband chip includes a driver layer, a firmware layer and a hardware layer; The firmware layer is configured to send a first time schedule to the driver layer; wherein, the first time schedule is determined through a communication connection with the target device; the first time schedule is used to indicate the data sending and receiving time with the target device; The driver layer is configured to, when receiving the sending instruction corresponding to the target device at the first moment, transmit the data packet carried by the sending instruction according to the second time schedule corresponding to the first time schedule; wherein, the second time schedule is used to indicate the data transmission time between the driver layer and the firmware layer.
12. The baseband chip according to claim 11, wherein, the driver layer is further configured to determine, according to the first time schedule, a first start time and a first end time of each data transceiver cycle between the baseband chip and the target device; determine a second start time of each data transmission cycle according to a preset transmission time, a channel access time, and the first start time of each data transceiver cycle; determine a second end time of each data transmission cycle according to the preset transmission time, the channel access time, a preset packet sending time, and the first end time of each data transceiver cycle; and generate the second time schedule according to the second start time and the second end time of each data transmission cycle.
13. The baseband chip according to claim 12, wherein, the driver layer is further configured to perform an addition operation on the preset transmission time and the channel access time to obtain a first advance time; and determine the second start time of each data transmission cycle according to the first advance time and the first start time of each data transceiver cycle.
14. The baseband chip according to claim 12, wherein, the driver layer is further configured to perform an addition operation on the preset transmission time, the channel access time, and the preset packet sending time to obtain a second advance time; and determine the second end time of each data transmission cycle according to the second advance time and the first end time of each data transceiver cycle.
15. The baseband chip according to any one of claims 11-14, wherein, the driver layer is further configured to store the data packet if the first time does not belong to any data transmission cycle in the second time schedule, and at the same time determine the target data transmission cycle corresponding to the data packet as the first data transmission cycle after the first time in the second time schedule; and transmit the data packet to the firmware layer at a third start time of the target data transmission cycle.
16. The baseband chip according to any one of claims 11-14, wherein, the driver layer is further configured to transmit the data packet to the firmware layer at the first time if the first time belongs to a data transmission cycle in the second time schedule.
17. The baseband chip according to claim 11, wherein, the firmware layer is further configured to determine a third end time of the current data transceiver cycle according to the first time schedule when receiving the data packet corresponding to the target device transmitted by the driver layer at a second time; stop transmitting the data packet to the target device if a time difference between the second time and the third end time is less than or equal to a preset reserved time; and transmit the data packet to the target device at the second time if the time difference between the second time and the third end time is greater than the preset reserved time; wherein, the preset reserved time is a sum of the channel access time and the preset packet sending time.
18. A terminal device, It is characterized in that the terminal device is configured with a baseband chip as described in any one of claims 11-17, and the terminal device is used to implement the method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Upper computer with real-time transmission function in Ethernet and Ethernet system
CN110545152A