The present invention provides a method for cooperative multi-channel and opportunistic routing applied in wireless networks. The method considers the transmission efficiency of the sender and the conflict of the receiver at the same time, and combines the characteristics of both multi-channel communication and opportunistic routing. At the same time, their advantages are retained and the effectiveness of low-power wireless network transmission is improved.
 In order to be able to understand the above objectives, features and advantages of the present invention more clearly, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other if they do not conflict with each other.
 In the following description, many specific details are explained in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from the scope described here. Therefore, the protection scope of the present invention is not disclosed below. Limitations of specific embodiments.
 Please refer to figure 1 This application provides the main steps of the method of allocating channels of the present invention: each sender sends a beacon to all potential recipients, receives the bitmap returned from the recipient, and puts "1" to indicate the receipt of the data packet , "0" means the loss of the data packet; the sender uses the channel-based routing opportunity method to sort all possible channels according to the bitmap in step 1, and sends them out; each receiver receives the channel sort order Then, by calculating the benefit/cost ratio ρ i To select the sender to cooperate with, and at the same time select the channel ranked first as the working channel; the recipient adopts a lightweight voting mechanism to select the remaining unselected senders and channels; the recipient completes After the selection of the channel and the sender, the sender determines the channel and repeater to be used by calculating the size of the additional expected number of transmissions cETX; if the channel selected by the sender and the receiver are inconsistent, the receiver will base on the sender’s Channel selection to change its main channel. among them,
 A. The sender sends beacons to all potential receivers and receives the returned information:
 1) We convert the reception and loss of packets in the link into bitmaps, with "1" indicating the receipt of data packets, and "0" indicating the loss of data packets.
 B. The sender sorts all possible channels according to the returned information, and sends the sorting result in the form of anycast:
 1) The average routing opportunity is used as the routing opportunity of a sender. The calculation formula of the average routing opportunity is:
 Where p a Represents the packet reception rate of anycast, among them, Represents the bitwise XOR operation, |b| represents the number of "1"s in the bitmap b, and m represents the length of the bitmap of the bitmap set Bs of the sender s. From this we can calculate the average routing opportunity size on each channel.
 2) After the sender sorts all the channel conditions, the sorted information is sent to all possible receivers so that the receiver can select the appropriate channel and sender.
 C. After receiving the channel ranking information from all potential senders, each receiver decides to choose a working channel and a sender with whom it wants to cooperate. Specifically, the receiver decides which channel to choose and the cooperating sender by calculating a benefit/cost ratio:
 ρ i = P a (i,j)/n c (i)
 Where p a (i,j) represents the opportunity size of routing on channel i calculated by sender j, n c (i) represents the number of senders on channel i. In this way, the sender and channel with the largest ρ will be selected as the working channel and sender.
 D. After the receiver has selected the main channel and the corresponding sender, there are other unselected senders. Here, a lightweight voting mechanism is adopted: for each channel, we record their ranking information in different senders And check which channel is most likely to be selected. If a channel is more likely to be selected in a lower channel ranking, then we will choose this channel first and choose the highest ranked sender.
 E. After the receiver has completed the selection of the channel and the corresponding sender, and has voted for other senders and channels that are not the first choice, it is the sender's turn to decide which channel to work on. Here, we comprehensively consider the possibility of minimizing the expected number of transmissions ETX and the channel conflict, and select the channel by calculating the additional expected number of transmissions cETX:
 cETX=ETX×(1+q collision )
 Where q collision Is the probability of collision, the calculation formula is:
 q collision = 1-p st -p nt
 p st Indicates the probability of a successful transmission, p nt Indicates that there is no possibility that the sender will try to transmit. The calculation formula is as follows:
 N is the number of outbound links, p ta Is the transmission attempt probability. p ta The calculation formula is:
 Where T trans Represents the backoff timer for data transmission.
 In this way, we can calculate the additional expected number of transmissions, allowing the sender to select the appropriate channel for work.
 F. If the channels selected by the sender and the receiver are different, we propose a refined correction method: the receiver changes its main channel according to the channel selected by the sender. Since the channels of all senders have been determined at this time, the receiver has to change the channel: 1. The channel is included in the sender's bitmap, 2. The link quality from the sender is better than that of other senders.
 Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
 Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.