Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before proceeding to further detailed description of the disclosed embodiments, the terms and terms involved in the disclosed embodiments are described, which are applicable to the following explanation:
TDMA (Time Division Multiple Access): a multiple access technique for dividing a shared channel into a plurality of time slots in a time domain to enable a plurality of users to communicate on the same frequency. Each time slot is allocated to a user for communication. Each user can only transmit and receive data in its own assigned time slot, and other users communicate in other time slots. TDMA protocols are widely used in many communication systems, including mobile communication systems, satellite communication systems, and wireless local area networks. The method allows a plurality of users to use the same frequency resource at the same time, improves the frequency spectrum utilization rate, and can provide better anti-interference capability and reliability.
Ad-Hoc Network: an infrastructure-supported network is not required in which mobile devices can communicate directly to form a temporary network topology. In an ad hoc network, a routing protocol plays a key role in determining the transmission path of a data packet in the network. Nodes in the ad hoc network have peer-to-peer status and have no centralized control nodes. Each node may act as a sender and a receiver of data and enable data transfer between nodes through multi-hop communication. And nodes in the ad hoc network can be mobile, and the positions and the connection relations can be changed at any time. In an ad hoc network, a routing protocol plays an important role for determining a transmission path of a data packet in the network. Common ad hoc network routing protocols include AODV, DSR, OLSR and TORA, among others.
In the related art, unicast and broadcast are two common communication methods in a node network, but in some cases, for example, a mobile ad hoc network is a wireless network composed of mobile nodes, between which connections can be autonomously established and released. Because of mobility of nodes and instability of network topology, in order to accommodate dynamic changes of nodes, networks may prefer to use point-to-point communication modes, generally only for control, such as network access, routing, configuration, etc., most traffic is unicast, broadcast traffic is generally only periodic announcements, etc., and thus broadcast channels are often not configured. As another example, wireless sensor networks are typically composed of a large number of low power consumption sensor nodes that communicate data via wireless communications. Because the sensor nodes have limited computational and energy resources, the network may not allocate resources specifically for broadcast in order to extend network life. The network of nodes may not have specifically planned time slots or channels for broadcast due to resource utilization considerations. However, in a specific scenario, a broadcast function of one transmission and multiple reception is still required to be implemented.
Based on this, the embodiment of the application provides a broadcasting method, electronic equipment and storage medium on a wireless channel, which can realize a broadcasting function in a node network for communication based on a unicast channel, thereby improving the resource utilization rate of the unicast channel.
The method for broadcasting on a wireless channel, the electronic device and the storage medium provided in the embodiments of the present application are specifically described through the following embodiments, and the method for broadcasting on a wireless channel in the embodiments of the present application is first described.
In the embodiments of the present application, when related processing is required to be performed according to data related to a user identity or a characteristic, such as user information, user behavior data, user history data, user location information, and the like, permission or consent of the user is obtained first, for example, when data stored by the user and a request for accessing cached data of the user are obtained first. Moreover, the collection, use, and processing of such data, etc., complies with relevant national and regional laws and regulations. In addition, when the embodiment of the application needs to acquire the sensitive personal information of the user, the independent permission or independent consent of the user is acquired through a popup window or a jump to a confirmation page or the like, and after the independent permission or independent consent of the user is explicitly acquired, necessary user related data for enabling the embodiment of the application to normally operate is acquired.
The broadcasting method applied to the radio channel of the broadcasting source node in the node network in the embodiment of the present application may be described by the following embodiment.
Fig. 1 is an optional flowchart of a broadcast method on a wireless channel provided in an embodiment of the present application, where the method is applied to a broadcast source node in a node network, where the node network includes a plurality of nodes that communicate based on unicast channels, and the method in fig. 1 may include, but is not limited to, steps 110 to 130.
Step 110, obtain first broadcast information.
In this step, the first broadcast information acquired by the broadcast source node includes first broadcast content information, a broadcast source address, a unicast source address field, and a unicast target address field.
The first broadcast content information is content information of the current broadcast, and may be text, image, audio or other types of data, and the determination of specific content depends on the application scenario and requirements.
The broadcast source node fills its own address into a broadcast source address field that identifies the source of the broadcast information as the broadcast source node. By filling in the broadcast source address field, other nodes can know which node the sender of the first broadcast information is by parsing the broadcast source address field.
The unicast source address field and the unicast target address field are used to identify the unicast source node and the unicast target node in the unicast transmission, for example, in this embodiment, the unicast source address field is filled with the address of the broadcast source node, and the unicast target address field is filled with the address of the node adjacent to the broadcast source node.
Referring to fig. 2, in some embodiments, step 110 may include steps 111 through 113.
Step 111, acquiring first broadcast content information, a broadcast source address field, a unicast source address field and a unicast target address field.
Step 112, generating first broadcast identification information according to the node identification information of the broadcast source node.
After the broadcast source node acquires the first broadcast information to be broadcast, the broadcast source node generates first broadcast identification information according to the node identification information of the broadcast source node. The node identification information may be an identifier, such as a string, a serial number, etc., that uniquely identifies the broadcast source node.
The node identification information of the broadcast source node can be realized through a broadcast transmission sequence window configured in the node, and an embodiment for realizing the generation of the broadcast identification information based on the broadcast transmission sequence window is given below:
a broadcast source node with a broadcast transmission sequence window size of 3 transmits a broadcast of A, B, C, D, E. In the initial state of the sender, the serial number of the sending window is 0, which indicates that no broadcast is sent yet; the sender sends a broadcast A and sets the serial number of the broadcast to 0; the sender slides the sending window backwards by one bit, and the serial number is increased by 1; the sender sends a broadcast B and sets the serial number of the broadcast as follows; similarly, the sender transmits broadcast C and sets the serial number of the broadcast to 2; the sender continuously sends broadcasts D and E with their sequence numbers set to 3 and 4, respectively.
By assigning unique identification information to the broadcast, it is ensured that each broadcast message has a unique identification information. The recipient may be assisted in identifying and distinguishing between different broadcast messages. The receiver may filter, sort, or selectively process the broadcast message based on the identification information. The receiver can accurately identify the broadcast message, avoiding confusion or mishandling. In addition, the unique identification information may also be used to detect and handle collisions and redundancies of broadcast messages. The receiver can determine whether the same broadcast message has been received based on the identification information and the broadcast source address field, thereby avoiding repetitive processing or unnecessary resource consumption.
Step 113, integrating the first broadcast content information, the broadcast source address field, the unicast target address field and the first broadcast identification information to obtain first broadcast information.
In this step, the broadcast source node integrates the first broadcast content information, the broadcast source address field, the unicast target address field, and the first broadcast identification information to generate first broadcast information, i.e., a first broadcast message as shown in fig. 3. By integrating these fields, the broadcast source node may generate a complete first broadcast message. This broadcast information will contain broadcast content, broadcast source address, unicast target address, and broadcast identification for dissemination to the recipient during the broadcast.
It should be noted that the first broadcast message may further include a broadcast target address field, where the broadcast target address is a broadcast address, and is a special address for transmitting the data packet to all hosts in a network. The representation and manner of use of the broadcast address may vary in different network protocols. In an IPv4 network, the broadcast address is typically the last address of the network, i.e., the address that sets all host bits in the network address to 1. For example, for a network with a subnet address of 192.168.0.0/24, the broadcast address is 192.168.0.255. There is no broadcast address in the conventional sense in IPv6 networks. IPv6 uses Multicast (Multicast) to implement broadcast-like functions. The multicast address range for IPv6 is ff 00:8, where a portion of the address is reserved for a particular purpose, e.g., node local multicast address, link local multicast address, etc. In Ethernet (Ethernet), the broadcast address is called a special value of the MAC address. The broadcast address of the ethernet is a MAC address (FF: FF) of all 1 for broadcasting the data frame to all connected hosts.
In some embodiments, the first broadcast content information may be transmitted in multiple slices. Each slice contains the number of slices and corresponding slice sequence numbers to ensure that the receiver can correctly assemble and restore the original broadcast content information. The following is an example procedure illustrating how to divide the first broadcast content information into a plurality of slices:
The broadcast source node determines content information to be broadcast and calculates an appropriate fragment size.
The broadcast source node encapsulates the first broadcast content information into a plurality of fragments, each fragment containing a portion of the original content and a number of fragments and corresponding fragment numbers.
And the broadcast source node transmits each fragment as an independent broadcast message at different moments and identifies each fragment by using a corresponding sequence number.
After receiving the broadcast message, the receiver node sorts the fragments according to the fragment sequence numbers.
And the receiver node assembles the received fragments into complete first broadcast content information according to the fragment number and the fragment sequence number.
By slicing the first broadcast content information, the broadcast content information can be sliced and sent when the broadcast content information is overlong and the broadcast content information field length corresponding to the broadcast message is limited. And the number of fragments and sequence number information are contained in each fragment, the receiver can correctly receive and assemble the broadcast content information, and recovery can be performed even if loss, repetition or disorder exists in the broadcasting process. The specific slicing strategy and implementation may vary depending on the protocol and application requirements. The above examples provide a common practice, but may be adapted and optimized for the specific situation in practice.
Step 120, the first address of the broadcast source node is filled into the unicast source address field and the broadcast source address field.
In this step, the broadcast source node needs to acquire its own address in the node network. This address may be a network address, such as an IP address or MAC address, that uniquely identifies the broadcast source node. And the broadcast source node fills the acquired self address into a unicast source address field and a broadcast source address field in the first broadcast information. By filling in the unicast source address field and the broadcast source address field, the broadcast source node identifies itself as the unicast source node and the broadcast source node in the broadcast information spreading process.
Step 130, inputting the first broadcast information into the node network based on the unicast channel used by the broadcast source node for communication, such that the first broadcast content information is propagated continuously between the nodes in the node network based on the unicast channel.
In this step, the broadcast source node transmits the first broadcast information to other nodes in the network of nodes using a unicast channel. Specifically, the broadcast source node transmits a broadcast message containing first broadcast content information, a broadcast source address field, a unicast source address field, and a unicast target address field to other nodes through a unicast channel. When other nodes receive this broadcast message, they can determine from the unicast source address field that the source of the broadcast message is the broadcast source node. The nodes may then update the unicast source address field to their own address and the unicast target address field to the next receiving node, thereby continuing to propagate the first broadcast content information to other nodes over the unicast channel. In this way, the first broadcast content information may be propagated continuously in the node network based on the unicast channel, thereby achieving a broadcast effect in the node network.
Referring to fig. 4, in some embodiments, step 130 may include steps 131 through 132.
Step 131, obtain the second address of the second node, and fill the second address into the unicast target address field.
A second address of the second node is obtained and filled into the unicast target address field. In this sub-step, the broadcast source node obtains the second address of the second node adjacent thereto and fills the unicast target address field with the address. The unicast target address field is used to specify target address information for the unicast message. The broadcast source node indicates that the recipient of the broadcast message is the second node by populating the second address of the second node.
Step 132, after the first broadcast information is filled in by the first address and the second address, the first broadcast information is sent to the second node, so that the second node updates the unicast source address field based on the second address, updates the unicast target address field based on the third address of the third node, and then sends the first broadcast information updated according to the second address and the third address to the third node.
In this step, the broadcast source node fills the first broadcast information with the first address and the second address. Then, the broadcast source node transmits the first broadcast information to the second node. The second node may update the unicast source address field based on its second address and the unicast target address field based on a third address of a third node adjacent thereto. The second node will then forward the updated first broadcast information to the third node.
The broadcast source node transmits the broadcast message from the first node to the second node by updating the unicast target address and the source address field of the broadcast message, and the second node further updates the unicast source address field and the unicast target address field according to the second address of the second node and the third address of the adjacent third node. In this way, broadcast messages may be propagated continuously between nodes in a network of nodes based on unicast channels.
Wherein the second node is represented as all nodes adjacent to the broadcast source node in the node network, and the third node is represented as all nodes adjacent to the second node in the node network. A neighbor table may be used to obtain nodes adjacent thereto. The neighbor table is a data structure maintained by the node and is used for recording information of other nodes directly connected with the node in the node network. The neighbor table typically contains the address of each neighbor node, the connection status, and other relevant information. When a node needs to propagate a broadcast message in a network of nodes, it can refer to the neighbor table to determine the nodes adjacent to it and communicate with those nodes using unicast channels.
In some embodiments, a TDMA protocol may be used to determine the number of time slots and the slot period needed based on network requirements and the number of nodes. The number of slots should be sufficient to accommodate unicast communications for all nodes and the slot period should be long enough to accommodate the communication needs of all nodes. The slot cycle is divided into unicast slot pairs, each slot pair being used for unicast communication of one node. By means of static planning, independent time slot pairs are allocated to each node, and unicast communication among the nodes is guaranteed not to collide. According to the unicast time slot pair configuration of the nodes, each node transmits broadcast information in its designated time slot pair. In the designated time slot pair, the node exclusively uses the time slot for broadcast communication without worrying about transmission collision. Broadcast information is transmitted in unicast slot pairs of each node, propagated hop-by-hop through unicast communications between nodes. Each node receives the broadcast information from the previous hop node according to the self time slot pair configuration, and forwards the broadcast information to the next hop node in the appointed time slot pair.
The broadcasting method applied to the wireless channel of the broadcast forwarding node in the node network in the embodiment of the present application may be described by the following embodiment.
Fig. 5 is an optional flowchart of a broadcast method on a wireless channel provided in an embodiment of the present application, where the method is applied to a broadcast forwarding node in a node network, where the node network includes a plurality of nodes that communicate based on unicast channels, and the method in fig. 5 may include, but is not limited to, steps 210 to 230.
In step 210, the broadcast forwarding node obtains first broadcast information from neighboring nodes in the node network based on the unicast channel.
In this step, the broadcast forwarding node communicates with its neighboring nodes through a unicast channel and acquires the first broadcast information. The adjacent node is a node directly connected with the broadcast forwarding node in the node network, and can be a broadcast source node or other nodes.
It should be noted that, the first broadcast information is that, by acquiring the first broadcast information by the broadcast source node, the first broadcast information includes first broadcast content information, a broadcast source address field, a unicast source address field and a unicast target address field, and then the first address of the broadcast source node is filled into the unicast source address field, and finally the first broadcast information is input into the node network based on a unicast channel used for communication by the broadcast source node, which is described in the foregoing description of how the specific broadcast source node transmits the first broadcast information into the node network, and will not be described herein again.
In some embodiments, each node in the node network is configured with an identification information comparison reference, and after step 210, the method further includes:
when the first broadcast identification information accords with the identification information comparison reference corresponding to the broadcast forwarding node, the identification information comparison reference is updated, so that the first broadcast identification information does not accord with the updated identification information comparison reference.
In this step, in the node network, each broadcast forwarding node is configured with an identification information comparison reference. When the broadcast forwarding node receives the first broadcast information from the adjacent node and the identification information of the broadcast information is matched with the identification information comparison standard corresponding to the broadcast forwarding node, the identification information comparison standard can be updated to ensure that the first broadcast identification information no longer accords with the updated identification information comparison standard, thereby avoiding repeated forwarding of the first broadcast information from the broadcast source node.
In some embodiments, in a network of nodes, each broadcast forwarding node individually maintains a receive window for all other nodes as follows:
WIN node [SEQ,SEQ+n),SEQ=ARROUND(SEQ rcv +1)
receiving window WIN node Comprises a left end sequence number SEQ and a right end sequence number SEQ+n, wherein the right end sequence number is equal to the left end sequence number SEQ plus the receiving window width n, and the left end The sequence number is equal to the broadcast sequence number SEQ of the last received broadcast information rcv And adding one. After receiving the broadcast information from the neighbor node, the node firstly analyzes the broadcast source address field in the broadcast information, indexes the receiving window of the current node to the broadcast source node according to the broadcast source address, then analyzes the broadcast identification information in the broadcast information, judges whether the broadcast identification information is in the [ SEQ, SEQ+n ] range, and if so, confirms the receiving of the broadcast information. If not, the broadcast information is discarded, which indicates that the broadcast information has been received, the window has been shifted to the right, and so on, possibly before the broadcast information has been received from other neighbors.
Step 220, updating the unicast source address field based on the fourth address of the broadcast forwarding node.
In this step, the broadcast forwarding node updates the unicast source address field in the first broadcast information using its fourth address. By populating the unicast source address field with the fourth address of the broadcast forwarding node, the broadcast message source is identified to the downstream target node as self.
And step 230, forwarding the first broadcast information updated based on the fourth address to adjacent nodes in the node network of the broadcast forwarding node through a unicast channel, so that the first broadcast content information is continuously propagated between the nodes in the node network based on the unicast channel.
And forwarding the first broadcast information updated based on the fourth address to adjacent nodes of the broadcast forwarding node in the node network through a unicast channel, so that the first broadcast content information is continuously propagated between the nodes in the node network based on the unicast channel. In this step, the broadcast forwarding node transmits the updated first broadcast information to nodes adjacent thereto through a unicast channel. Through such a forwarding procedure, the first broadcast content information may be propagated successively between the various nodes in the network of nodes based on the unicast channel.
In summary, after receiving the broadcast information from the previous hop node, the broadcast forwarding node updates the unicast target address field in the broadcast information to its own neighbor node address, updates the unicast source address field to its own node address, and keeps other parts of the broadcast information unchanged from being forwarded to all nodes adjacent to itself.
In some embodiments, to avoid information loops, to ensure that the broadcast message is not received by the sender itself, the broadcast message may be sent to all neighboring nodes of itself, but not to the sender node of the broadcast message (i.e., excluding the unicast source address). This ensures that broadcast messages propagate in the network of nodes while avoiding loops. The method of specifically achieving this goal may vary from one network protocol to another and from one system design to another. The following is one possible implementation:
The broadcast forwarding node acquires the message content to be broadcast and creates a broadcast message;
the broadcast forwarding node determines a neighbor node list of the broadcast forwarding node, namely other nodes connected with the broadcast forwarding node;
the broadcast source node copies the broadcast message for a plurality of times, and each message is respectively sent to one neighbor node;
before each broadcast message is sent, the broadcast forwarding node needs to confirm that the address filled in the unicast target address field is not the address of the sender node of the broadcast message received this time.
In this way, the broadcast forwarding node sends the broadcast message to all its neighbors, ensuring that the message propagates in the node network while avoiding loops and senders from receiving the broadcast message. The specific implementation may vary with different network protocols, application requirements, and system designs. The foregoing description is of a general implementation, and the specific details and steps may vary from case to case.
The broadcasting method applied to the wireless channel of the broadcast forwarding node in the node network in the embodiment of the present application may be described by the following embodiment.
Fig. 6 is an alternative flowchart of a broadcast method on a wireless channel provided in an embodiment of the present application, the method being applied to a broadcast target node in a node network including a plurality of nodes communicating based on unicast channels, the method in fig. 6 may include, but is not limited to including step 310.
In step 310, the broadcast target node obtains first broadcast information from neighboring nodes in the node network based on the unicast channel.
In this step, the broadcast target node communicates with its neighboring nodes through a unicast channel and acquires the first broadcast information. The adjacent node is a node directly connected with the broadcast target node in the node network, and can be a broadcast source node or a broadcast forwarding node.
It should be noted that, the first broadcast information is that, by acquiring the first broadcast information by the broadcast source node, the first broadcast information includes first broadcast content information, a broadcast source address field, a unicast source address field and a unicast target address field, and then the first address of the broadcast source node is filled into the unicast source address field, and finally the first broadcast information is input into the node network based on a unicast channel used for communication by the broadcast source node, which is described in the foregoing description of how the specific broadcast source node transmits the first broadcast information into the node network, and will not be described herein again.
Referring to fig. 7, in some embodiments, each node in the node network is configured with an identification information comparison reference, and the first broadcast information further includes first broadcast identification information, and step 310 may further include steps 410 to 420.
In step 410, when the broadcast identification information accords with the identification information comparison reference corresponding to the broadcast target node, the identification information comparison reference is updated, so that the first broadcast identification information no longer accords with the updated identification information comparison reference.
In this step, in the node network, each broadcast target node is configured with an identification information comparison reference. When the broadcast target node receives the first broadcast information from the adjacent node and the first identification information of the broadcast information is matched with the identification information comparison standard corresponding to the broadcast target node, the identification information comparison standard can be updated to ensure that the first broadcast identification information no longer accords with the updated identification information comparison standard, thereby avoiding the broadcast target node from repeatedly receiving the first broadcast information from the broadcast source node.
In some embodiments, in a network of nodes, each broadcast target node individually holds a receive window for all other nodes as follows:
WIN node [SEQ,SEQ+n),SEQ=ARROUND(SEQ rcv +1)
receiving window WIN node Comprises a left end sequence number SEQ and a right end sequence number SEQ+n, wherein the right end sequence number is equal to the left end sequence number SEQ plus the receiving window width n, and the left end sequence number is equal to the broadcast sequence number SEQ of the last received broadcast information rcv And adding one. After receiving the broadcast information from the neighbor node, the broadcast target node firstly analyzes a broadcast source address field in the broadcast information, indexes a receiving window of the current node to the broadcast source node according to the broadcast source address, then analyzes broadcast identification information in the broadcast information, judges whether the broadcast identification information is in the [ SEQ, SEQ+n ] range, and if so, confirms that the broadcast information is received. If not, the broadcast information is discarded, which means that the broadcast information has been received, the window has been shifted to the right, and so on, possibly before the broadcast information has been received from other neighbors
The broadcast target node takes the node address as an index, and an independent receiving window is respectively stored for all nodes in the node network, so that window confusion is avoided when broadcasting from any address in the node network.
In some embodiments, when the broadcast target node receives data that is within the window range but not expected to be received by the window left boundary, a timer may be started and wait for the sequence number (SEQ) of the window left boundary. During the waiting time, the receiver can process the received data normally, but without moving the window. If the receiver receives the broadcast information corresponding to the sequence number of the left boundary of the window before the timer times out or during the waiting period, the receiver can move the window to the right once and move the right boundary of the window to the position of the received sequence number plus one. Before timing timeout or receiving the left boundary sequence number, the received data in the window is only stored in the node, the data is not subjected to slicing and reorganization, and is not submitted upwards, so that the aim is to wait for a period of time, and if the left boundary is reached, the data can be submitted according to the correct sequence.
In some embodiments, if the node receives a plurality of discontinuous broadcast information sequence numbers on the right side of the left boundary of the window within the waiting time of the timer on the left boundary of the window, when the timer is overtime or the receiving party receives the broadcast information corresponding to the sequence number on the left boundary of the window during the waiting time, the left boundary of the window is moved to the position of the sequence number of the first broadcast information which is not received on the right side at one time, and the timer is reset to wait for receiving the broadcast information corresponding to the sequence number.
The purpose of the timer is to handle the following cases: when the expected sequence number has not arrived, but some data has been received by the receiver during the waiting period. This may be because there is a forwarding delay for intermediate forwarders, resulting in the order in which the data arrives not necessarily being ordered. Thus, the recipient cannot rely on the behavior of the intermediate forwarder. By means of a timer mechanism, the recipient can wait a period of time, ensuring that the desired left boundary sequence number is received as much as possible during that time. If the expected sequence number is received before the timeout, the receiver can safely shift the window to the right. The processing mode can help the receiver to effectively process the received data without depending on the action of the intermediate forwarder, can ensure that the sequence submitted to the upper layer is consistent with the sequence sent by the sender, cannot be disordered due to disorder of intermediate forwarding, and keeps correct movement and processing of the window.
Step 420, constructing index information based on the broadcast source address field, the broadcast identification information, and the unicast source address field, and storing the first broadcast information based on the index information.
In this step, index information may be constructed based on the broadcast source address field, the broadcast identification information, and the unicast source address field, and the first broadcast information may be stored using the index information. The broadcast source address field is used for uniquely identifying a broadcast source node address, the broadcast identification information is used for uniquely identifying a broadcast serial number, and the unicast source address field uniquely identifies a unicast source node address. By using the broadcast information index table, broadcast information can be more efficiently searched and accessed without traversing or linearly searching the entire memory structure. This may improve the efficiency of the search and save resources.
Referring to fig. 8, in some embodiments, a broadcast source node divides first broadcast information into a plurality of first broadcast information slices, and inputs the first broadcast information slices into the node network through the unicast channel, where each first broadcast information slice further includes a slice number and a slice sequence number corresponding to each broadcast information slice, and step 420 may include steps 421 to 424.
Step 421, first level index sub-information is constructed based on the broadcast source address field and the broadcast identification information.
The process of slicing the first broadcast information by the broadcast source node is described above, and is not described herein. In this step, in order to store the first broadcast information in a classified manner according to its broadcast source node and the unique broadcast identification assigned thereto, a data structure of primary index information, such as a hash table or an associated array, may be constructed using the broadcast source address field and the broadcast identification information as keys, each key corresponding to a value, which may be a data structure storing a fragment of the broadcast information, or a pointer to a location where a fragment of the broadcast information is stored, or a next-level index. By using the first-level index sub-information, the corresponding broadcast information fragment or broadcast information fragment index can be quickly positioned according to the broadcast source address and the broadcast identification information. This can improve the efficiency of finding and accessing the broadcast information fragments.
Step 422, based on the primary index sub-information, constructing secondary index sub-information based on the unicast source address field, and storing all the first broadcast information fragments based on the secondary index sub-information.
Referring to fig. 9, in this step, secondary index sub-information may be constructed from unicast source address fields using the primary index sub-information as a basis. The secondary index sub-information may be a data structure, such as a hash table or an associative array. For each unicast source address, the unicast source address may be used as a key value or index, and the corresponding value may be a data structure for storing broadcast information fragments, or a pointer for pointing to a position where the broadcast information fragments are stored, and each time a broadcast information fragment is received, the broadcast information fragment is stored in the node storage space according to the primary index sub-information and the secondary index sub-information. By using the secondary index sub-information, the corresponding broadcast information fragment can be quickly located according to the unicast source address. This allows more accurate storage and access of the broadcast information fragments.
In some embodiments, the broadcast source node may be further used as primary index sub-information, the broadcast identification information is secondary index sub-information, and the unicast source node is tertiary index sub-information, so that the multi-index level can improve the data organization and retrieval efficiency, and the broadcast information fragments of the specific broadcast source node, the broadcast identification information and the unicast source node can be accessed and processed more quickly.
Step 423, determining that all the first broadcast information fragments corresponding to the secondary index sub-information are received according to the number of fragments and the fragment sequence number.
In this step, the number of received fragments is compared with the number of fragments in the broadcast information to determine whether all the broadcast information fragments belonging to the broadcast source node and the broadcast identification information index have been received. If the number of received fragments is equal to the desired number of fragments, it may be confirmed that all the broadcast information fragments corresponding to the broadcast source node and the broadcast identification information combination have been received. The purpose of this step is to ensure that all broadcast information fragments have been successfully received for subsequent reassembly and processing.
As shown in fig. 9, the secondary index sub-information under the index of the broadcast source address and the broadcast identification information includes a unicast source address 1, a unicast source address 2, and a unicast source address 3, and the nodes corresponding to the three addresses forward the broadcast information from the broadcast source node to the broadcast target node, respectively, and assuming that the number of pieces in the broadcast information is 3, the broadcast target node receives the broadcast information piece 1 from the unicast source node 1, the broadcast information piece 1 and the broadcast information piece 2 from the unicast source node 2, and all three broadcast information pieces from the unicast source node 3, as shown in the drawing.
In some embodiments, after the broadcast target node determines that all fragments from a certain unicast source node are collected, fragments of broadcast information that are not collected under other unicast source address indexes may be discarded, so as to save storage space.
A specific example is given below, where there are 4 nodes, node a, node B, node C, node D in the network. The node a transmits the broadcast with the identification information of 90, and is split into 3 pieces, and the 3 pieces are respectively transmitted to the node B and the node C on unicast time slots of the node a and the node B and the node a and the node C. Wherein, the broadcast identification information is 90, and the total number of the fragments and the fragment serial numbers corresponding to the fragments are marked in each broadcast information fragment. Node D can only receive node B, and node C forwards the broadcast information fragment, but cannot receive node a. Node D receives the data forwarded from node B and node C, receives a total of 6 slices, and the order is variable, depending on the unicast slot configuration between node B and node D and between node C and node D, and also depending on the forwarding policies of node B and node C. Therefore, when node D stores 6 fragments, the broadcast source address is stored under the index of node a and the broadcast identification information is 90, and the unicast source address is stored with node B and node C as indexes, respectively, when 3 messages of node B or node C are collected, the broadcast information fragments with the broadcast identification information equal to 90 are considered to be completely received, the receiving window is shifted to the right, and the data under the index of node B is deleted at the same time.
And step 424, reorganizing all the first broadcast information slices corresponding to the secondary index sub-information according to the slice sequence numbers.
In this step, the slicing sequence numbers are used as a sorting basis, and the slicing sequences are combined according to the sequence of the slicing sequence numbers so as to restore the original first broadcast information. And obtaining the fragment serial number corresponding to each broadcast information fragment by traversing the corresponding broadcast information in the secondary index sub-information, and then combining the fragments in sequence according to the sequence of the fragment serial numbers so as to restore the original first broadcast information. Through such a reorganization process, the original broadcast information can be restored for subsequent processing and use.
Fig. 10 is another flow chart of a broadcasting method on a wireless channel provided by the present disclosure. In the embodiment of the present disclosure, a method for broadcasting on a wireless channel provided by the present disclosure will be described in detail by applying the method to a computer device, where the method specifically includes the following steps:
step 1001, a broadcast transmission request is transmitted to a network layer.
In step 1002, the network layer determines a broadcast transmission request.
In step 1001 to step 1002, after receiving the broadcast transmission request, the network layer performs corresponding processing and judgment, for example, verifying the validity of the broadcast transmission request, checking whether the broadcast range meets the specification, determining the transmission mode of the broadcast message, and the like. Based on these decisions and processing, the network layer decides whether to allow the broadcast operation and possibly takes further action to ensure efficient transmission of the broadcast.
Step 1003, obtain the current broadcast sequence number, and simultaneously send the sequence number window to shift one bit to the right.
The broadcast transmitting node obtains the serial number of the broadcast. The broadcast sequence number is a unique identifier for identifying the broadcast message, typically an incremental number or other form of identification. By using the sequence number, the receiver can correctly identify and process the broadcast message.
Meanwhile, the broadcast transmitting node shifts the sequence number window by one bit to the right. The sequence number window is a window for managing transmission sequence numbers, and the right shift window means that the transmitting node discards already used sequence numbers. By right shifting the window, the transmitting node can ensure that each broadcast message is provided with a unique broadcast sequence number.
Step 1004, searching neighbor nodes according to the neighbor table, and determining a broadcast target node.
The neighbor table is a data structure which records information of adjacent nodes in the network. It contains a list of direct neighbors of the broadcast source node, each neighbor corresponding to a network address or identifier. The broadcast sender finds nodes directly adjacent to it by looking up the neighbor table, which will act as target nodes for the broadcast. The target nodes are the target nodes of the broadcast message that they will receive and forward the broadcast message. By looking up the neighbor table, the broadcast source node can determine the target node of the broadcast in order to send the broadcast message to the correct target. The process can be determined according to network topology and neighbor relation, so as to ensure that the broadcast message can be effectively transmitted to the target node, thereby achieving the purpose of broadcasting.
Step 1005, entering a transmission queue of the broadcast target node.
In this step, the broadcast source node adds itself to the broadcast target node's transmit queue. The transmission queue is a queue for managing broadcast messages to be transmitted by the broadcast target node, and stores the broadcast messages to be transmitted in a certain order.
Step 1006, waiting for a sending time slot of the broadcast target node, and slicing and packaging the broadcast information to form a plurality of broadcast messages.
In steps 1005 to 1006, the broadcast source node waits for a unicast slot with the broadcast target node. Unicast slots refer to periods of time during which a broadcast target node is allowed to transmit broadcast messages within a particular time window. And waiting for the broadcast source node to acquire the sending time slot, slicing and packaging the broadcast information to form a plurality of broadcast messages. The slicing and encapsulation operation slices the broadcast message into smaller fragments and adds the necessary header and trailer information for each fragment so that the receiver can properly reassemble and process the broadcast message. According to the unicast time slot pair configuration, finally the broadcast source node sends the broadcast message fragments to N broadcast target nodes at different moments, if the fragment number is C i The actual number of transmissions is
Step 1007, send a broadcast message.
In this step, the broadcast source node transmits the fragmented and encapsulated broadcast message. The broadcast message is a data packet generated and transmitted by the broadcast source node, and includes a broadcast source node address field, a broadcast address, a unicast source node address field, a unicast target node address field, a sequence number field and a broadcast content field. The broadcast source node sends the broadcast message to the network layer via an appropriate communication mechanism, such as an API call or other communication protocol in the network protocol stack. The network layer is responsible for sending broadcast messages to the corresponding broadcast target nodes. After receiving the broadcast message, the network layer transmits the broadcast message to the corresponding broadcast target node according to the unicast target node address field of the broadcast message.
And step 1008, the index receiving window judges the validity of the broadcast message.
In this step, the broadcast target node uses the broadcast source node address to index the corresponding receiving window to determine the validity of the received broadcast message. The index receiving window is a window used by the broadcast target node to manage and receive broadcast messages, and defines the range of the sequence numbers of the broadcast messages. The sequence numbers within the window represent the expected sequence number range of the broadcast message. When the broadcast target node receives a broadcast message, it first checks the sequence number of the message. The broadcast target node may determine whether the message falls within the window by comparing to the expected sequence number range in the index receiving window. If the sequence number of the message is in the window, that is, the message corresponding to the sequence number is not received yet, the broadcast target node marks the message as legal and performs subsequent processing. If the sequence number of the message is not in the window, the message corresponding to the sequence number is received, and the broadcast target node ignores the repeated message or adopts other processing strategies so as to avoid repeated reception of the broadcast message.
By using the index receiving window to determine the validity of the broadcast message, the broadcast target node can filter out messages or repeated messages beyond the window range, thereby ensuring that only valid and unprocessed broadcast messages are processed. This helps to maintain the ordering and accuracy of the broadcast.
In step 1009, the broadcast message is saved according to the source address.
In this step, the broadcast target node saves the broadcast message according to its source address. Index information may be constructed based on the broadcast source address field, the broadcast identification information, and the unicast source address field, and the first broadcast information may be stored using the index information. The broadcast source address field is used for uniquely identifying a broadcast source node address, the broadcast identification information is used for uniquely identifying a broadcast serial number, and the unicast source address field uniquely identifies a unicast source node address. By using the broadcast information index table, broadcast information can be more efficiently searched and accessed without traversing or linearly searching the entire memory structure. This may improve the efficiency of the search and save resources.
Step 1010, check if the broadcast message fragment is received intact.
Specifically, in checking the integrity of the broadcast message fragments, the broadcast target node may operate as follows:
The determination of the total number of broadcast message fragments may be generally obtained from the header information of the broadcast message fragments.
And recording the received fragment sequence number, and comparing the fragment sequence number with the expected fragment sequence number to ensure the continuity and correctness of the sequence number.
If the received fragment sequence number does not match the expected sequence number or there is a missing fragment, the broadcast target node may wait for a period of time, attempt to re-receive the missing fragment, or take other error handling strategies.
In step 1011, the receive sequence number window is shifted one bit to the right.
After all the broadcasting message fragments are confirmed to be received, the receiving serial number window corresponding to the broadcasting message is shifted to the right by one bit. The receive sequence number window is typically a fixed size window that is used to track the sequence number of the received data packet. And each position in the window corresponds to a serial number, indicates whether a data packet of the serial number is received, and moves the whole window to the right one bit after the broadcast message corresponding to the serial number at the leftmost end is confirmed to be received, so as to ensure that the broadcast message corresponding to the serial number at the leftmost end is not received any more.
Step 1012, searching for neighbor nodes according to the neighbor table.
Step 1013, forwarding the broadcast message to a neighboring node of the broadcast target node.
In steps 1012 to 1013, the broadcast target node may query the neighbor table as needed to obtain information of the neighbor node directly connected thereto. This may be achieved by performing a search or lookup operation in the neighbor table. Through the query of the neighbor table, the broadcast target node can determine which nodes are its neighbor nodes, i.e., the nodes directly connected thereto. These neighbor nodes will be the target of broadcast message forwarding. In this step, the broadcast target node forwards all received broadcast messages to its neighbor nodes in fragments to realize the propagation and diffusion of broadcast messages. Specifically, when forwarding all broadcast message fragments, the broadcast target node uses the neighbor node information obtained in step 1012 to determine the forwarding target. The method copies all received broadcast message fragments, and sends all copied broadcast message fragments to each neighbor node. According to the unicast time slot pair configuration, the broadcast target node finally sends the broadcast message fragments to N neighbors at different moments, if the number of fragments is C i The actual number of transmissions is
After receiving the broadcast message from the previous hop node, the broadcast forwarding node updates the unicast target address field in the broadcast message to the own neighbor node address, updates the unicast source address field to the own node address, and keeps other fields of the broadcast message unchanged and forwards to all nodes adjacent to the broadcast forwarding node.
In step 1014, the broadcasting message fragments are recombined according to the fragment sequence numbers, and the original broadcasting content information is restored.
The broadcast target node may combine the received broadcast message fragments in the correct order to recover the original broadcast content information, via step 1014. In this way, the integrity and accuracy of the broadcast message is guaranteed.
By adopting the broadcasting method on the wireless channel, the broadcasting function can be realized in the node network which is communicated based on the unicast channel, so that the resource utilization rate of the unicast channel is improved, and the receiving node can remove the duplication of the broadcasting information, thereby selectively receiving and forwarding the broadcasting information, and avoiding loops and broadcasting storms in the network.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the broadcasting method on the wireless channel when executing the computer program. The electronic equipment can be any intelligent terminal including a tablet personal computer, a vehicle-mounted computer and the like.
Referring to fig. 11, fig. 11 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
The processor 1101 may be implemented by a general purpose CPU (central processing unit), a microprocessor, an application specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), or one or more integrated circuits, etc. for executing related programs to implement the technical solutions provided by the embodiments of the present application;
the memory 1102 may be implemented in the form of read-only memory (ReadOnlyMemory, ROM), static storage, dynamic storage, or random access memory (RandomAccessMemory, RAM). The memory 1102 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present application are implemented by software or firmware, relevant program codes are stored in the memory 1102, and the processor 1101 invokes the broadcast method on the wireless channel to perform the embodiments of the present application;
an input/output interface 1103 for implementing information input and output;
the communication interface 1104 is configured to implement communication interaction between the device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
Bus 1105 transmits information between the various components of the device (e.g., processor 1101, memory 1102, input/output interface 1103, and communication interface 1104);
wherein the processor 1101, memory 1102, input/output interface 1103 and communication interface 1104 enable communication connection therebetween within the device via bus 1105.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the broadcasting method on the wireless channel when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the technical solutions shown in the figures do not constitute limitations of the embodiments of the present application, and may include more or fewer steps than shown, or may combine certain steps, or different steps.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one (item)" and "a number" mean one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed systems and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the above elements is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.