Wireless communication method, system, device and medium
By using determined channels and anchor channels for data packet verification and retransmission in wireless communications, the problem of multiple FM channel establishment connections affecting real-time communication is solved, improving the real-time and reliability of communication transmission and avoiding the need to re-establish The connection time is extended.
Patent Information
- Application Number
- CN202211336651.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-10-28
AI Technical Summary
In the connection-oriented way of establishing multiple FM channels, the real-time communication is interfered with, resulting in a long time to re-establish the connection when synchronization is lost, and the performance of the communication processing MCU and the data packet processing performance are required to be high, which affects the communication transmission. efficiency.
During the data packet transmission process between the sender and the receiver, the determined agreed channel and anchor channel are used for data packet verification and retransmission to avoid re-establishing connections in multiple channels and directly perform data packet retransmission through the determined channel. transmission to improve the real-time and reliability of communication transmission.
When an error occurs in data packet transmission, it is retransmitted directly through the determined channel, avoiding the need to re-establish connections in multiple channels, improving the real-time and reliability of communication transmission, and ensuring the real-time and performance of communication transmission.
Smart Images

Figure CN116112121B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a wireless communication method, system, device and medium. Background Art
[0002] 2.4G RF or BLE Bluetooth wireless works in the crowded 2.4G ISM band and is susceptible to interference, which can cause errors in data packet reception. One way to avoid interference is to use multiple FM channels and establish a connection-oriented approach to establish a synchronous transmission mechanism between the communicating parties.
[0003] When this method of establishing a connection is disturbed and synchronization is lost, it takes a long time to re-establish the connection, affecting the real-time performance of communication transmission. In addition, this method of connection has high requirements on the performance of the communication processing MCU and the processing performance of the data packet. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the defect in the prior art that connection-oriented establishment on multiple frequency modulation channels affects the real-time performance of communication, and to provide a wireless communication method, system, device and medium.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] A wireless communication method, applied to a transmitting end, the wireless communication method comprising:
[0007] Send data packets to the receiving end;
[0008] After the data packet is sent, an ACK frame is received, wherein the ACK frame is sent by the receiving end, and the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel;
[0009] Determining whether the verification result is correct;
[0010] If the judgment result is no, the data packet is resent to the receiving end through the agreed channel.
[0011] Optionally, sending a data packet to a receiving end includes:
[0012] The data packets are sent to the receiving end in sequence through multiple channels.
[0013] Optionally, receiving an ACK frame after the data packet is sent includes:
[0014] After the data packet is sent, the channel is switched to the anchor channel, and the ACK frame is received through the anchor channel.
[0015] Optionally, after receiving an ACK frame after the data packet is sent, the method further comprises:
[0016] After a preset time, determining whether the ACK frame is received;
[0017] If the judgment result is no, then continue to execute the step of sending the data packet to the receiving end.
[0018] A wireless communication method, applied to a receiving end, the wireless communication method comprising:
[0019] Receive data packets sent by the sender;
[0020] After the data packet is received, an ACK frame is sent to the sending end, wherein the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel;
[0021] In the case that the verification result of the data packet is incorrect, the data packet is received again through the agreed channel.
[0022] Optionally, receiving a data packet sent by a sending end includes:
[0023] The data packets are received sequentially through a plurality of channels.
[0024] Optionally, sending an ACK frame to the transmitting end after receiving the data packet includes:
[0025] After the data packet is received, the channel is switched to the anchor channel, and the ACK frame is sent through the anchor channel.
[0026] Optionally, after sending an ACK frame to the transmitting end after receiving the data packet, the method further comprises:
[0027] In the case that the sending end does not receive the ACK frame, the step of receiving the data packet sent by the sending end is continued.
[0028] A wireless communication system, applied to a transmitting end, comprising:
[0029] A first sending module, used for sending a data packet to a receiving end;
[0030] A first receiving module, configured to receive an ACK frame after the data packet is sent, wherein the ACK frame is sent by the receiving end, and the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel;
[0031] A judgment module, used to judge whether the verification result is correct; if the judgment result is no, calling the resending module;
[0032] A retransmission module is used to resend the data packet to the receiving end through the agreed channel.
[0033] A wireless communication system, applied to a receiving end, comprising:
[0034] A second receiving module, used for receiving a data packet sent by a sending end;
[0035] A second sending module, configured to send an ACK frame to the sending end after the data packet is received, wherein the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel;
[0036] The re-receiving module is used to re-receive the data packet through the agreed channel when the verification result of the data packet is incorrect.
[0037] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the wireless communication methods described above when executing the computer program.
[0038] A computer-readable storage medium stores a computer program, wherein the computer program implements any one of the wireless communication methods described above when executed by a processor.
[0039] The positive and progressive effects of the present invention are: when an error occurs in the transmission of a data packet, the data packet is directly retransmitted through a determined agreed channel, without the need to re-establish a connection-oriented communication in multiple channels, thereby improving the real-time performance of communication transmission; the response signal of the receiving end is transmitted through a determined anchor channel and an agreed channel, thereby ensuring the reliability of communication transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A first flow chart of a wireless communication method provided by an exemplary embodiment of the present invention;
[0041] Figure 2 A channel diagram of a wireless communication method provided by an exemplary embodiment of the present invention;
[0042] Figure 3 A second flow chart of a wireless communication method provided by an exemplary embodiment of the present invention;
[0043] Figure 4 A schematic diagram of a first communication mode of a wireless communication method provided by an exemplary embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a second communication mode of a wireless communication method provided by an exemplary embodiment of the present invention;
[0045] Figure 6A schematic diagram of a third communication mode of a wireless communication method provided by an exemplary embodiment of the present invention;
[0046] Figure 7 A first module diagram of a wireless communication system provided by an exemplary embodiment of the present invention;
[0047] Figure 8 A second module diagram of a wireless communication system provided by an exemplary embodiment of the present invention;
[0048] Fig. 9 A structural diagram of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present invention is further described below by way of an exemplary embodiment, but the present invention is not limited to the scope of the embodiment.
[0050] An exemplary embodiment of the present invention provides a wireless communication method, which is applied to a transmitting end, see Figure 1 , methods include:
[0051] S101, sending a data packet to a receiving end.
[0052] In one embodiment, there are 14 channels in the 2.4 GHz frequency channel, and multiple channels can be determined from the 14 channels and data packets can be sent sequentially through the multiple channels to ensure that the data packets can be sent to the receiving end smoothly. The channels used to send data packets can include custom private channels and Bluetooth broadcast channels.
[0053] For example, channels 2423 MHz (private channel A), 2470 MHz (private channel B), 2402 MHz (Bluetooth broadcast channel 37), 2426 MHz (Bluetooth broadcast channel 38), and 2480 MHz (Bluetooth broadcast channel 38) are determined as the transmission channels for data packets. The transmission process is as follows: Figure 2 As shown, the five channels send data packets in turn.
[0054] In one embodiment, the transmitting end switches to the receiving mode after each data packet transmission is completed.
[0055] S102, receiving an ACK (Acknowledge character) frame after the data packet is sent. The ACK frame is sent by the receiving end, and the ACK frame includes the verification result of the receiving end on the data packet and the agreed channel.
[0056] In one embodiment, after each data packet is sent, the sender switches to the receiving mode and receives an ACK frame on the anchor channel. The anchor channel can be selected by the sender according to the transmission performance of each channel, or randomly selected from multiple determined channels.
[0057] In one embodiment, after each data packet is sent, the sending end determines whether an ACK frame sent by the receiving end is received after a preset time period; if the judgment result is no, it is considered that the sending end did not receive the ACK frame or the receiving end did not receive the data packet due to channel interference, and step S101 can be continued to resend the data packet to the receiving end through multiple channels. When the number of resending the data packet exceeds a limited number, an error needs to be reported to the upper application layer of the software so that the software restarts a new transmission at the application layer. If the judgment result is yes, S103 is executed.
[0058] In one embodiment, an ACK frame is defined as follows:
[0059]
[0060] The preamble code has the same definition as the preamble code of standard Bluetooth, that is, when the first bit of the access address is 0, the preamble code is 01010101; when the first bit of the access address is 1, the preamble code is 10101010.
[0061] The access address is a custom fixed 4-byte address. The frame length is the frame length including the access address and CRC field.
[0062] The frame type indicates that this is an ACK frame, which is a reply confirmation to the previous application data packet.
[0063] CRC (Cyclic Redundancy Check Code) is the verification result of the data packet in this embodiment.
[0064] The ACK information indicates whether the CRC verification is correct and the agreed channel for retransmitting the data packet when the CRC verification is wrong. The agreed channel can be selected by the receiving end based on the transmission performance of each channel, or it can be randomly selected from multiple channels, as follows:
[0065]
[0066] S103, determine whether the verification result is correct; if the determination result is no, execute S104.
[0067] In one embodiment, if the ACK frame sent by the receiving end is received by the sending end and the CRC is correct, that is, the verification result is correct, then it means that the receiving end has successfully received the data packet, and the sending and receiving of the data packet is successfully completed. If the ACK frame sent by the receiving end is received by the sending end and the CRC is wrong, then it means that the receiving end has received the data packet, and it is believed that there is channel interference causing the data packet to be wrong. At this time, the data packet needs to be resent to the receiving end through the agreed channel determined by the receiving end.
[0068] S104. Resend the data packet to the receiving end through the agreed channel.
[0069] In one embodiment, when the number of times the data packet is resent exceeds a limited number, an error needs to be reported to the upper application layer of the software.
[0070] An exemplary embodiment of the present invention provides a wireless communication method, which is applied to a receiving end. Figure 3 , methods include:
[0071] S301, receiving a data packet sent by a sending end.
[0072] In one embodiment, the multiple channels determined by the above embodiment receive the data packets in sequence to ensure that the data packets can be received smoothly.
[0073] S302. After receiving the data packet, an ACK frame is sent to the sending end. The ACK frame includes the verification result of the data packet by the receiving end and the agreed channel.
[0074] In one embodiment, the receiving end switches to the receiving mode after each ACK frame is sent.
[0075] In one embodiment, after receiving the data packet, the receiving end calculates whether the CRC of the data packet is correct, verifies whether the result is correct, and fills the CRC and the agreed channel of the retransmitted data packet into the response bit of the ACK information content.
[0076] In one embodiment, after receiving the data packet, the channel is switched to the anchor channel, and an ACK frame is sent through the anchor channel. The anchor channel can be determined by the sending end in the above embodiment.
[0077] In one embodiment, the receiving end switches to the receiving mode after the ACK frame is sent. When the sending end fails to successfully receive the ACK frame, the sending end needs to resend the application data packet to the receiving end, so the receiving end needs to continue to perform S301 and re-receive the data packet through multiple channels.
[0078] S303: When the verification result of the data packet is incorrect, the data packet is received again through the agreed channel.
[0079] In one embodiment, when the CRC is displayed incorrectly, the receiving end switches to a receiving mode and re-receives the data packet sent by the sending end on the agreed channel.
[0080] The following further describes various communication modes of the wireless communication method according to the embodiment of the present invention by using specific implementation methods:
[0081] See also Figure 4 , the sender sends the same data packet to the receiver through five channels, namely CH_A, CH_B, CH_37, CH_38, and CH_39, in sequence, where CH_B is the anchor channel. After receiving the data packet on any channel, the receiver performs CRC verification on the data packet. When the verification result is correct, the verification result and the agreed channel are written into the ACK frame and sent to the sender through the anchor channel CH_B. At this time, the ACK frame is represented by ACK_CRC_OK. After receiving ACK_CRC_OK on the anchor channel, the sender indicates that the data packet transmission and reception has been successfully completed, and switches to the receiving state to receive or prepare for a new data packet to be sent. At the same time, the receiver also switches to the receiving state to receive or prepare for a new data packet to be sent.
[0082] See also Figure 5 , the sender sends the same data packet to the receiver in sequence through five channels, namely CH_A, CH_B, CH_37, CH_38, and CH_39, where CH_B is the anchor channel. After receiving the data packet on any channel, the receiver performs CRC verification on the data packet. When the verification result is an error, the verification result and the agreed channel are written into the ACK frame and sent to the sender through the anchor channel CH_B, and then switched to the agreed channel. At this time, the ACK frame is represented by ACK_CRC_ERROR. After receiving ACK_CRC_ERROR on the anchor channel CH_B, the sender switches to the agreed channel to resend the data packet according to the instruction of the ACK frame. The receiver re-receives the data packet on the agreed channel until the ACK frame sent by the receiver indicates that the verification result of the data packet is correct, and the sender re-receives ACK_CRC_OK on the anchor channel CH_B, that is, an ACK frame indicating that the verification result is correct. When the number of resending the data packet exceeds the limit, it is necessary to report the error to the upper application layer of the software.
[0083] See also Figure 6, the sender sends the same data packet to the receiver through five channels, namely CH_A, CH_B, CH_37, CH_38, and CH_39, in sequence, where CH_B is the anchor channel. If the receiver receives the data packet on any channel, it performs CRC verification on the data packet, writes the verification result and the agreed channel into the ACK frame, and sends it to the sender through the anchor channel CH_B. If the sender does not receive the ACK frame on the anchor channel CH_B, there are two situations: the receiver does not receive the application data packet or the sender does not receive the ACK frame. Both of the above situations indicate that there is interference in the channel. The sender continues to send the same data packet to the receiver through the above five channels. The receiver switches to the receiving mode after each ACK frame is sent, and continues to re-receive the data packet until the ACK frame sent by the receiver indicates that the verification result of the data packet is correct, and the sender re-receives ACK_CRC_OK on the anchor channel CH_B, that is, the ACK frame indicating that the verification result is correct. When the number of resending the data packet exceeds the limit, it is necessary to report the error to the upper application layer of the software.
[0084] An exemplary embodiment of the present invention provides a wireless communication system, which is applied to a transmitting end, see Figure 7 , the system includes:
[0085] A first sending module 71, used for sending a data packet to a receiving end;
[0086] The first receiving module 72 is used to receive an ACK frame after the data packet is sent. The ACK frame is sent by the receiving end, and the ACK frame includes the verification result of the receiving end on the data packet and the agreed channel;
[0087] The judgment module 73 is used to judge whether the verification result is correct; if the judgment result is no, the resending module is called;
[0088] The retransmission module 74 is used to retransmit the data packet to the receiving end through the agreed channel.
[0089] An exemplary embodiment of the present invention provides a wireless communication system, which is applied to a receiving end, see Figure 8 , the system includes:
[0090] A second receiving module 81, used for receiving a data packet sent by a sending end;
[0091] The second sending module 82 is used to send an ACK frame to the sending end after the data packet is received. The ACK frame includes the verification result of the receiving end on the data packet and the agreed channel;
[0092] The re-receiving module 83 is used to re-receive the data packet through the agreed channel when the verification result of the data packet is incorrect.
[0093] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0094] An exemplary embodiment of the present invention provides an electronic device, referring to Fig. 9 , which shows a structural diagram of an exemplary electronic device 90 suitable for implementing the embodiments of the present invention. Fig. 9 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0095] like Fig. 9 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).
[0096] The bus 93 includes a data bus, an address bus, and a control bus.
[0097] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0098] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0099] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the method provided in any of the above embodiments.
[0100] The electronic device 90 may also communicate with one or more external devices 94. Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the model-generated electronic device 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 97. As shown, the network adapter 97 communicates with other modules of the model-generated electronic device 90 via a bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0101] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0102] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method provided by any of the above embodiments is implemented.
[0103] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0104] In a possible implementation manner, the embodiment of the present invention may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute a method for implementing any of the above embodiments.
[0105] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0106] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A wireless communication method, applied to a transmitting end, characterized in that: The wireless communication method comprises: Send data packets to the receiving end; After the data packet is sent, an ACK frame is received, wherein the ACK frame is sent by the receiving end, and the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel; Determining whether the verification result is correct; If the judgment result is no, resending the data packet to the receiving end through the agreed channel; The receiving an ACK frame after the data packet is sent includes: After the data packet is sent, the channel is switched to the anchor channel, and the ACK frame is received through the anchor channel.
2. The wireless communication method according to claim 1, wherein: The sending of the data packet to the receiving end comprises: The data packets are sent to the receiving end in sequence through multiple channels.
3. The wireless communication method according to claim 1, wherein: After receiving the ACK frame after the data packet is sent, the method includes: After a preset time, determining whether the ACK frame is received; If the judgment result is no, then continue to execute the step of sending the data packet to the receiving end.
4. A wireless communication method, applied to a receiving end, characterized in that: The wireless communication method comprises: Receive data packets sent by the sender; After the data packet is received, an ACK frame is sent to the sending end, wherein the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel; If the verification result of the data packet is incorrect, re-receiving the data packet through the agreed channel; The sending of an ACK frame to the transmitting end after the data packet is received comprises: After the data packet is received, the channel is switched to the anchor channel, and the ACK frame is sent through the anchor channel.
5. The wireless communication method according to claim 4, wherein: The receiving of a data packet sent by a transmitting end comprises: The data packets are received sequentially through a plurality of channels.
6. The wireless communication method according to claim 4, wherein: After the data packet is received, the ACK frame is sent to the transmitting end, comprising: In the case that the sending end does not receive the ACK frame, the step of receiving the data packet sent by the sending end is continued.
7. A wireless communication system, applied to a transmitting end, characterized in that: The wireless communication system comprises: A first sending module, used for sending a data packet to a receiving end; A first receiving module, configured to receive an ACK frame after the data packet is sent, wherein the ACK frame is sent by the receiving end, and the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel; A judgment module, used to judge whether the verification result is correct; if the judgment result is no, calling the resending module; A retransmission module, used for retransmitting the data packet to the receiving end through the agreed channel; The first receiving module is further configured to switch to the anchor channel after the data packet is sent, and receive the ACK frame through the anchor channel.
8. A wireless communication system, applied to a receiving end, characterized in that: The wireless communication system comprises: A second receiving module, used for receiving a data packet sent by a sending end; A second sending module, configured to send an ACK frame to the sending end after the data packet is received, wherein the ACK frame includes a verification result of the data packet by the receiving end and an agreed channel; A re-receiving module, configured to re-receive the data packet through the agreed channel if the verification result of the data packet is incorrect; The second sending module is further configured to switch to the anchor channel after the data packet is received, and send the ACK frame through the anchor channel.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the wireless communication method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the wireless communication method according to any one of claims 1 to 6 is implemented.
