Data Sending Method, Device, Storage Medium and Electronic Device

By receiving CTS messages, determining the data frame type and adjusting the transmission time, the problem of I-frame conflict in wireless data transmission is solved, and the transmission efficiency is improved and the delay is reduced.

CN114554617BActive Publication Date: 2025-07-22ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210143549.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-07-22
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

In wireless data transmission, multiple terminals are prone to conflicts when transmitting I frames simultaneously, resulting in network bandwidth bottlenecks and video streaming lags.

Method used

By receiving the CTS message sent by the access point, it is determined whether the data message of the second terminal contains a data frame of a specified type, and the target data message is sent at the target time to avoid conflicts.

Benefits of technology

Improves data transmission efficiency, avoids conflicts in data frames of specified types, and reduces delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114554617B_ABST
    Figure CN114554617B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a data sending method, apparatus, storage medium, and electronic device. The method includes: a first terminal receives a CTS message, where the CTS message is sent by an AP after a second terminal sends an RTS message to the AP; the first terminal determines whether a second data frame is included in a data packet to be sent by the second terminal based on the CTS message; in the case where it is determined that the second data frame is included in the data packet to be sent by the second terminal, the first terminal determines a target time for sending a target data packet, and sends the target data packet at the target time, where the target data packet includes a first data frame, and both the first data frame and the second data frame are specified type data frames. Through the present invention, the problem that data frame transmission in the related art is prone to conflicts, resulting in low efficiency, is solved, and the effect of improving data transmission efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communication technologies, and in particular, to a data sending method, apparatus, storage medium, and electronic device. Background Art

[0002] The RTS (Request to Send) / CTS (Clear to Send) mechanism is widely used in the field of wireless data transmission. Taking the transmission of a video stream as an example, a GoP (Group of Pictures) in a video stream is a set of consecutive pictures in the video stream. A GoP is a group of frames in video coding, that is, a group of coded image frames. Usually, in a GoP, the first coded frame is an I frame. Currently, real-time audio and video communication is mainly carried out in a public network scenario, and there is no relevant avoidance mechanism for I frame transmission. Usually, after the video stream is started, the video stream is encoded periodically according to the set GoP duration, that is, the first frame of each GoP period is encoded as an I frame to obtain an I frame. If there are multiple terminals in the network for real-time audio and video communication, when multiple terminals simultaneously perform I frame transmission, since the network transmission resources may be limited, multiple terminals will conflict in the uplink transmission of I frames, resulting in the I frame transmission taking more time and increasing the delay of the video stream. For example, as a transmission technology for the data link layer and the physical layer, the wireless frequency band where WiFi operates is vulnerable to interference and prone to network bandwidth fluctuations. When multiple I frames are transmitted simultaneously, it will cause a bottleneck in the WiFi link bandwidth, resulting in the problem of stuttering in WiFi video preview.

[0003] Regarding the problem that data frame transmission in related technologies is prone to conflicts, resulting in low efficiency, no effective solution has been proposed yet. Summary of the Invention

[0004] The embodiments of the present invention provide a data sending method, apparatus, storage medium, and electronic device to at least solve the problem that data frame transmission in related technologies is prone to conflicts, resulting in low efficiency.

[0005] According to an embodiment of the present invention, a data sending method is provided, including: a first terminal receives a Clear to Send (CTS) message, where the CTS message is sent by an access point (AP) after a second terminal sends a Request to Send (RTS) message to the AP; the first terminal determines whether a second data frame is included in a data packet to be sent by the second terminal based on the CTS message; when it is determined that the second data frame is included in the data packet to be sent by the second terminal, the first terminal determines a target time for sending a target data packet and sends the target data packet at the target time, where the target data packet includes a first data frame, and both the first data frame and the second data frame are data frames of a specified type.

[0006] In an exemplary embodiment, the first terminal determines whether a second data frame is included in a data packet to be sent by the second terminal based on the CTS message, including: the first terminal determines whether a second data frame is included in a data packet to be sent by the second terminal based on a target field included in the CTS message, where the target field is used to indicate a transmission duration required for the data packet to be sent by the second terminal.

[0007] In an exemplary embodiment, the first terminal determines whether a second data frame is included in a data packet to be sent by the second terminal based on a target field included in the CTS message, including: when the target field indicates that a transmission duration required for the data packet to be sent by the second terminal is greater than or equal to a predetermined threshold, the first terminal determines that the second data frame is included in the data packet to be sent by the second terminal; when the target field indicates that a transmission duration required for the data packet to be sent by the second terminal is less than the predetermined threshold, the first terminal determines that the second data frame is not included in the data packet to be sent by the second terminal.

[0008] In an exemplary embodiment, the first terminal determines a target time for sending a target data packet, including: the first terminal determines the target time for sending the target data packet based on the current time, a reserved duration, and a frame interval, where the reserved duration is used to represent a transmission duration required for the data packet to be sent by the second terminal indicated by the CTS message, and the frame interval is used to indicate a time interval between sending two data frames of the specified type.

[0009] In an exemplary embodiment, the first terminal determines the target time for sending a target data packet based on the current time, a reserved duration, and a frame interval, including: the first terminal determines the target time t1 according to the following formula based on the current time, the reserved duration, and the frame interval: where t0 represents the current time, NAVCTS represents the reserved duration, I interval represents the frame interval, and random() represents the random number function.

[0010] In an exemplary embodiment, the method further includes: when it is determined that the data packet to be sent by the second terminal does not contain the second data frame, the first terminal sends the target data packet.

[0011] In an exemplary embodiment, the specified type of data frame includes an I-frame.

[0012] According to another embodiment of the present invention, there is also provided a data sending device, which is applied to a first terminal and includes: a receiving module, configured to receive a clear-to-send (CTS) packet, where the CTS packet is sent by an access point (AP) after a second terminal sends a request-to-send (RTS) packet to the AP; a determining module, configured to determine whether the data packet to be sent by the second terminal contains a second data frame based on the CTS packet; and a processing module, configured to, when it is determined that the data packet to be sent by the second terminal contains the second data frame, determine a target time for sending a target data packet and send the target data packet at the target time, where the target data packet contains a first data frame, and both the first data frame and the second data frame are of a specified type.

[0013] According to still another embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0014] According to still another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] Through the present invention, the first terminal receives the CTS message sent by the AP, and then determines whether the data packet to be sent by the second terminal contains a specified type of data frame based on the CTS message. When it is determined that the data packet to be sent by the second terminal contains a specified type of data frame, the first terminal determines the target time for sending the target data packet, and then sends the target data packet containing the specified type of data frame at the target time. This can avoid the conflict between the specified type of data frame sent by the first terminal and the specified type of data frame sent by the second terminal, and also avoid the problem that more time may be occupied during the transmission of the specified type of data frame, resulting in a long delay. Therefore, the problem of low efficiency caused by easy conflict in data frame transmission in the related art is solved, and the effect of improving data transmission efficiency is achieved. Description of the Drawings

[0016] Figure 1 is a block diagram of the hardware structure of the mobile terminal for the data sending method according to an embodiment of the present invention;

[0017] Figure 2 is a flowchart of the data sending method according to an embodiment of the present invention;

[0018] Figure 3 is a schematic diagram of data frame sending according to a specific embodiment of the present invention;

[0019] Figure 4 is a block diagram of the structure of the data sending device according to an embodiment of the present invention. Detailed Embodiments

[0020] The embodiments of the present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.

[0022] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a block diagram of the hardware structure of the mobile terminal for the data sending method according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1The structure shown is only illustrative and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than those shown in Figure 1 or have a different configuration from that shown in Figure 1 .

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data sending method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] In this embodiment, a data sending method is provided. Figure 2 is a flowchart of the data sending method according to the embodiment of the present invention, as shown in Figure 2 . The process includes the following steps:

[0026] Step S202, the first terminal receives a clear to send (CTS) packet, where the CTS packet is sent by the access point (AP) after the second terminal sends a request to send (RTS) packet to the AP;

[0027] Step S204, the first terminal determines whether the data packet to be sent by the second terminal contains a second data frame based on the CTS packet;

[0028] Step S206. When it is determined that the data packet to be sent by the second terminal contains the second data frame, the first terminal determines the target time for sending the target data packet and sends the target data packet at the target time, where the target data packet contains a first data frame, and both the first data frame and the second data frame are data frames of a specified type.

[0029] Through the above steps, the first terminal receives the CTS packet sent by the AP, and then determines whether the data packet to be sent by the second terminal contains a data frame of a specified type based on the CTS packet. When it is determined that the data packet to be sent by the second terminal contains a data frame of a specified type, the first terminal determines the target time for sending the target data packet, and then sends the target data packet containing the data frame of the specified type at the target time. This can avoid the conflict between the data frames of the specified type sent by the first terminal and the data frames of the specified type sent by the second terminal, and also avoid the problem that more time may be occupied during the transmission of the data frames of the specified type, resulting in long delays. Therefore, the problem of easy conflict in data frame transmission and low efficiency in the related art is solved, and the effect of improving data transmission efficiency is achieved.

[0030] Among them, the execution subject of the above steps can be a terminal, or a device. For example, the above first terminal, or a processor with human-computer interaction capabilities configured on a storage device, or a processing device or processing unit with similar processing capabilities, etc., but not limited thereto. The following takes the first terminal executing the above operations as an example (only an exemplary illustration, and in actual operations, other devices or modules can also execute the above operations) for description:

[0031] In the above embodiment, the first terminal receives the CTS packet sent by the access point AP. The CTS packet is sent by the AP after the second terminal sends an RTS packet to the AP. For example, the AP can be a wireless router, a base station, or other network devices or network nodes. The first terminal and the second terminal belong to the same network. The first terminal and the second terminal can send data to the cloud through a wireless router. For example, the first terminal and the second terminal can be network camera devices, and send the image frame group obtained by encoding the acquired video stream to the cloud. Before the first terminal sends the target data packet, if the second terminal sends an RTS packet to the AP, that is, the second terminal requests to occupy the wireless channel to send data. When the AP receives the RTS packet sent by the second terminal, it will send a CTS frame in a broadcast form. The second terminal can be one terminal or multiple terminals. In this way, the above-mentioned first terminal will receive the CTS packet sent by the AP; the first terminal then determines whether the data packet to be sent by the second terminal contains a second data frame based on the CTS packet. For example, when the second terminal sends an RTS packet to the AP, the value in the NAV (Network Allocate Vector) field in the RTS frame represents the time expected to occupy the wireless channel. This time includes the time for the AP to send the CTS packet and the time for the second terminal to send the data packet. The CTS frame sent by the AP in a broadcast form also contains a NAV field. Among them, the NAV field in the CTS frame indicates the time required for the next data packet transmission. Therefore, the first terminal can determine whether the data packet to be sent by the second terminal contains a second data frame (specified type data frame) based on the CTS packet. For example, the I frame and P frame in the video frame. The second data frame can be an I frame; when the first terminal determines that the data packet to be sent by the second terminal contains a second data frame, the first terminal determines the target time for sending the target data packet and sends the target data packet at the target time. The target data packet can contain a specified type data frame, such as an I frame. In this way, it can avoid the conflict between the specified type data frame sent by the first terminal and the specified type data frame sent by the second terminal, and also avoid the problem that more time may be required during the transmission of the specified type data frame, resulting in a long delay. Therefore, the problem of easy conflict in data frame transmission in the related art, which leads to low efficiency, is solved, and the effect of improving data transmission efficiency is achieved.

[0032] In an optional embodiment, the first terminal determines whether the data packet to be sent by the second terminal contains a second data frame based on the CTS message, including: the first terminal determines whether the data packet to be sent by the second terminal contains a second data frame based on a target field included in the CTS message, where the target field is used to indicate the transmission duration required for the data packet to be sent by the second terminal. In this embodiment, the first terminal can determine whether the data packet to be sent by the second terminal contains a second data frame based on the target field (such as the NAV field) included in the CTS message. For example, taking video frame transmission as an example, video frames are mainly divided into I frames and P frames. Since I frames contain more information and are much larger than P frames, when the data packet sent by the second terminal (such as a WiFi device) contains an I frame, the reserved time for occupying the wireless medium is necessarily longer than the time without an I frame. Therefore, the value of NAV in the CTS frame broadcast by the AP can be used to determine whether there are other devices in the current network sending I frames, that is, the first terminal can determine whether there is a second terminal sending an I frame through the CTS frame. Through this embodiment, the purpose of determining whether the data packet to be sent by the second terminal contains a specified type of data frame based on the CTS message is achieved, that is, the purpose of determining the type of data frame contained in the data packet to be sent by the second terminal is achieved.

[0033] In an optional embodiment, the first terminal determines whether the data packet to be sent by the second terminal contains a second data frame based on the target field included in the CTS packet, including: when the target field indicates that the transmission duration required for the data packet to be sent by the second terminal is greater than or equal to a predetermined threshold, the first terminal determines that the data packet to be sent by the second terminal contains the second data frame; when the target field indicates that the transmission duration required for the data packet to be sent by the second terminal is less than the predetermined threshold, the first terminal determines that the data packet to be sent by the second terminal does not contain the second data frame. In this embodiment, when the target field included in the CTS packet indicates that the time required for the data packet to be sent by the second terminal (such as other terminals or other devices) is greater than or equal to a predetermined threshold (such as 1 s, or 2 s, or other time), the first terminal can determine that the data packet to be sent by the second terminal contains a second data frame (such as an I frame). In practical applications, the predetermined threshold can be set according to the size of the data frame sent by the terminal; when the target field included in the CTS packet indicates that the time required for the data packet to be sent by the second terminal (such as other terminals or other devices) is less than the predetermined threshold (such as 1 s, or 2 s, or other time), the first terminal can determine that the data packet to be sent by the second terminal does not contain a second data frame (such as an I frame). Through this embodiment, the purpose of determining whether the data packet sent by the second terminal contains a second data frame based on the target field included in the CTS packet is achieved.

[0034] In an optional embodiment, the first terminal determines the target time for sending a target data packet, including: the first terminal determines the target time for sending the target data packet based on the current time, a reserved duration, and a frame interval, where the reserved duration is used to represent the transmission duration required for the data packet to be sent by the second terminal indicated by the CTS packet, and the frame interval is used to indicate the time interval between sending two specified type data frames. In this embodiment, when the first terminal determines that the data packet sent by the second terminal contains a second data frame, the first terminal determines the target time for sending the target data packet based on the current time, the reserved duration, and the frame interval. Through this embodiment, the purpose of staggering the target data packet sent by the first terminal from the data packet sent by the second terminal can be achieved, that is, to avoid conflicts between the specified type data frames sent by the first terminal and the specified type data frames sent by the second terminal.

[0035] In an optional embodiment, the first terminal determines the target time for sending the target data packet based on the current time, a reserved duration, and a frame interval, including: the first terminal determines the target time t1 according to the following formula based on the current time, the reserved duration, and the frame interval: where t0 represents the current time, NAV CTS represents the reserved duration, and I interval represents the frame interval, and random() represents the random number function. In this embodiment, the first terminal can determine the target time t1 for sending the target data packet according to the formula In the related art, a control platform is used to parse the data frame type and then the control platform allocates the requested protection time for each terminal. Through this embodiment, the purpose that each terminal can select a suitable sending time by itself can be achieved, so as to prevent multiple terminals from sending data frames simultaneously and causing conflicts, and at the same time avoid the problem of relying on the control platform in the related art.

[0036] In an alternative embodiment, the method further includes: when it is determined that the data packet to be sent by the second terminal does not include the second data frame, the first terminal sends the target data packet. In this embodiment, when the first terminal determines that the data packet to be sent by the second terminal does not include the second data frame (such as an I frame), the first terminal can send the target data packet. For example, the target data packet includes a specified type of data frame (such as an I frame). Through this embodiment, the purpose that the first terminal can directly send the target data packet when it is determined that the data packets to be sent by other terminals do not include the specified type of data frame is achieved.

[0037] In an alternative embodiment, the specified type of data frame includes an I frame. In this embodiment, the above-mentioned specified type of data frame may include an I frame, or may include an I frame and a P frame at the same time, etc.

[0038] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. The present invention will be described in conjunction with specific embodiments below. Taking the video frame transmission of a distributed WiFi network camera as an example.

[0039] In the transmission technology of WiFi, at any moment when a WiFi device (such as a WiFi network camera) has data to send, it will first evaluate whether the channel is idle through the Clear Channel Assessment. When the channel is idle, the next step is to reserve the usage time of the wireless channel through RTS / CTS (Request To Send / Clear To Send) interaction. Among them, RTS is the message sent by the WiFi network camera to the wireless router. The value in the NAV (Network Allocate Vector) field in the RTS frame represents the time expected to occupy the wireless channel. During this time period, other WiFi devices need to remain silent, that is, do not send data during this time period, otherwise conflicts will occur. The reserved time in the RTS frame includes the transmission time of the CTS and the transmission time of the data message. When the AP receives the RTS, it will send a CTS frame in broadcast form. The CTS frame also contains a NAV field, and the time value in this field is the reserved time of the RTS minus the transmission time of the CTS (corresponding to the aforementioned reserved duration). That is, the NAV of the CTS indicates the time required for the next data message transmission. At this time, all WiFi network cameras connected to the same wireless router can receive the CTS, and the duration of silence can be known through the NAV time of the CTS.

[0040] Video frames are mainly divided into I frames and P frames. Since I frames contain more information and are much larger than P frames, when the data message sent by the WiFi device contains an I frame, the reserved time for occupying the wireless medium must be longer than that without an I frame. Therefore, the value of the NAV in the CTS frame broadcast by the AP can be used to determine whether there are other devices sending I frames in the current network.

[0041] The WiFi network camera judges whether there is an I frame transmission at this moment through the NAV in the CTS frame. If there is and the frame to be transmitted by itself at the next moment is also an I frame, then it can be considered that an I frame conflict has occurred. Therefore, it is necessary to randomly select a backoff delay according to the I frame interval of the current network camera for I frame transmission. By the random backoff transmission delay, the peak staggering of I frames can be ensured.

[0042] The calculation formula for the I frame transmission time is as follows:

[0043]

[0044] Among them, t0 represents the current time, NAV CTS represents the reserved media duration in the CTS frame (corresponding to the aforementioned reserved duration), I interval represents the I frame interval (corresponding to the aforementioned frame interval), with the unit of fps (indicating how many frames per second), and random represents the random number function.

[0045] The following is an explanation in conjunction with the accompanying drawings. Figure 3 FIG. is a schematic diagram of data frame transmission according to a specific embodiment of the present invention. As Figure 3 shown, the AP sends a CTS frame to each terminal (including Figure 3 STA1 and STA2 in FIG., and may also include more terminals) in a broadcast form. When STA2 (corresponding to the aforementioned first terminal) determines that the data packet to be sent by STA1 (corresponding to the aforementioned second terminal) contains a second data frame (such as Figure 3 the I frame sent by STA1 in FIG.), STA2 determines the transmission time of the target data packet to be sent by itself. When the target data packet to be sent by STA2 includes a specified type of data frame (such as an I frame), a backward delay is selected for the I frame transmission. For example, Figure 3 the delay (including NAV, random) of STA2 sending the I frame relative to STA1 sending the I frame in FIG. In this way, the purpose of staggering the I frame sent by STA2 from the I frame sent by STA1 can be achieved, and the effect of I frame anti-collision can be achieved.

[0046] Through the above embodiments, the video frame type is distinguished by specific fields in the WiFi frame, and the peak staggering of video frame transmission is performed through random time slots. Each terminal independently selects a suitable I frame transmission time slot through a distributed technology on the WiFi data link layer to finally achieve the purpose of I frame anti-collision.

[0047] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

[0048] In this embodiment, a data sending device is further provided, which is applied to the above-mentioned first terminal. Figure 4 FIG. is a structural block diagram of the data sending device according to an embodiment of the present invention. As Figure 4 shown, the device includes:

[0049] A receiving module 402, configured to receive a clear-to-send CTS message, where the CTS message is sent by the AP after a second terminal sends a request-to-send RTS message to the access point AP;

[0050] A determination module 404, configured to determine whether a data packet to be sent by the second terminal contains a second data frame based on the CTS message;

[0051] A processing module 406, configured to determine a target time for sending a target data packet and send the target data packet at the target time when it is determined that the data packet to be sent by the second terminal contains the second data frame, where the target data packet contains a first data frame, and both the first data frame and the second data frame are specified type data frames.

[0052] In an optional embodiment, the above determination module 404 includes: a first determination unit, configured to determine whether a data packet to be sent by the second terminal contains a second data frame based on a target field included in the CTS message, where the target field is used to indicate a transmission duration required for the data packet to be sent by the second terminal.

[0053] In an optional embodiment, the above first determination unit includes: a first determination subunit, configured to determine that the data packet to be sent by the second terminal contains the second data frame when the target field indicates that the transmission duration required for the data packet to be sent by the second terminal is greater than or equal to a predetermined threshold; a second determination subunit, configured to determine that the data packet to be sent by the second terminal does not contain the second data frame when the target field indicates that the transmission duration required for the data packet to be sent by the second terminal is less than the predetermined threshold.

[0054] In an optional embodiment, the above processing module 406 includes: a second determination unit, configured to determine the target time for sending the target data packet based on the current time, a reserved duration, and a frame interval, where the reserved duration is used to represent the transmission duration required for the data packet to be sent by the second terminal indicated by the CTS message, and the frame interval is used to indicate a time interval between sending two specified type data frames.

[0055] In an optional embodiment, the above second determination unit includes: a third determination subunit, configured to determine the target time t1 according to the following formula based on the current time, the reserved duration, and the frame interval: where t0 represents the current time, NAV CTS represents the reserved duration, I interval represents the frame interval, and random() represents a random number function.

[0056] In an optional embodiment, the above device further includes: a sending module, configured to send the target data packet when it is determined that the data packet to be sent by the second terminal does not contain the second data frame.

[0057] In an alternative embodiment, the above-specified type of data frame includes I-frames.

[0058] It should be noted that the above-mentioned respective modules can be implemented by software or hardware. For the latter, it can be achieved in the following ways, but not limited thereto: the above modules are all located in the same processor; or, the above-mentioned respective modules are separately located in different processors in any combination.

[0059] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0060] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs, etc., various media that can store computer programs.

[0061] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0062] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0063] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0064] Obviously, those skilled in the art should understand that the above-mentioned respective modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0065] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A data sending method, characterized in that Including: A first terminal receives a CTS message, where the CTS message is sent by an access point AP after a second terminal sends a request-to-send (RTS) message; The first terminal determines, based on the CTS message, whether a data packet to be sent by the second terminal contains a second data frame; When it is determined that the data packet to be sent by the second terminal to the cloud contains the second data frame, the first terminal determines a target time for sending a target data packet and sends the target data packet to the cloud at the target time, where the target data packet contains a first data frame, and both the first data frame and the second data frame are data frames of a specified type; The first terminal determines, based on the CTS message, whether the data packet to be sent by the second terminal contains a second data frame, including: the first terminal determines, based on a target field included in the CTS message, whether the data packet to be sent by the second terminal contains a second data frame, where the target field is used to indicate a transmission duration required for the data packet to be sent by the second terminal; when the transmission duration required for the data packet to be sent by the second terminal indicated by the target field at the first terminal is greater than or equal to a predetermined threshold, it is determined that the data packet to be sent by the second terminal contains the second data frame; when the transmission duration required for the data packet to be sent by the second terminal indicated by the target field at the first terminal is less than the predetermined threshold, it is determined that the data packet to be sent by the second terminal does not contain the second data frame.

2. The method according to claim 1, characterized in that The first terminal determines the target time for sending the target data packet, including: The first terminal determines the target time for sending the target data packet based on the current time, a reserved duration, and a frame interval, where the reserved duration is used to represent the transmission duration required for the data packet to be sent by the second terminal indicated by the CTS message, and the frame interval is used to indicate a time interval between sending two data frames of the specified type.

3. The method according to claim 2, wherein The first terminal determines the target time for sending the target data packet based on the current time, the reserved duration, and the frame interval, including: The first terminal determines the target time t1 according to the following formula based on the current time, the reserved duration, and the frame interval: Among them, t0 represents the current time, and NAV CTS represents the reserved duration, and I interval represents the frame interval, and random() represents the random number function.

4. The method according to claim 1, wherein The method further includes: When it is determined that the data packet to be sent by the second terminal does not contain the second data frame, the first terminal sends the target data packet.

5. The method according to any one of claims 1 to 4, characterized in that, The data frame of the specified type includes an I-frame.

6. A data sending device, characterized in that, Applied to a first terminal, including: A receiving module, configured to receive a CTS message, where the CTS message is sent by an access point AP after a second terminal sends a request-to-send (RTS) message; A determining module, configured to determine, based on the CTS message, whether a data packet to be sent by the second terminal contains a second data frame; A processing module, configured to determine a target time for sending a target data packet when it is determined that the data packet to be sent by the second terminal to the cloud contains the second data frame, and send the target data packet to the cloud at the target time, where the target data packet contains a first data frame, and both the first data frame and the second data frame are data frames of a specified type; The first terminal is configured to determine whether the data packet to be sent by the second terminal contains a second data frame based on the CTS packet in the following manner: The first terminal determines whether the data packet to be sent by the second terminal contains a second data frame based on a target field included in the CTS packet, where the target field is used to indicate the transmission duration required for the data packet to be sent by the second terminal; when the transmission duration required for the data packet to be sent by the second terminal indicated by the target field in the first terminal is greater than or equal to a predetermined threshold, it is determined that the data packet to be sent by the second terminal contains the second data frame; when the transmission duration required for the data packet to be sent by the second terminal indicated by the target field in the first terminal is less than the predetermined threshold, it is determined that the data packet to be sent by the second terminal does not contain the second data frame.

7. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 5.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • NDN link layer and network layer fusion transmission method in wireless scene

    CN110690945A