CN101267439B - Generation method, node communication method, device and system for medium access control protocol - Google Patents
Generation method, node communication method, device and system for medium access control protocol Download PDFInfo
- Publication number
- CN101267439B CN101267439B CN2008100950653A CN200810095065A CN101267439B CN 101267439 B CN101267439 B CN 101267439B CN 2008100950653 A CN2008100950653 A CN 2008100950653A CN 200810095065 A CN200810095065 A CN 200810095065A CN 101267439 B CN101267439 B CN 101267439B
- Authority
- CN
- China
- Prior art keywords
- function
- node
- configurable
- protocol
- extended
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
本发明公开了一种介质访问控制(MAC)协议生成方法,包括:预处理步骤:确定基本接入机制;根据用户需求设置多种扩充功能,并针对每一种扩充功能设置选择可配置参数;生成步骤:在用户根据目标MAC协议对可配置参数进行配置时,确定内容为预设数据的可配置参数对应的扩充功能;对选择的扩充功能与所述基本接入机制一起进行代码加载、编译,生成所述目标MAC协议。本发明同时还公开了实现上述方法的装置及一种节点间通信方法及无线多跳网络。本发明实施例解决了现有技术由于协议和用户需求紧密耦合,不具有通用性、兼容性的问题。
The invention discloses a method for generating a medium access control (MAC) protocol, which includes: a preprocessing step: determining a basic access mechanism; setting multiple expansion functions according to user requirements, and setting and selecting configurable parameters for each expansion function; Generation step: when the user configures the configurable parameters according to the target MAC protocol, determine the extension function corresponding to the configurable parameter whose content is preset data; perform code loading and compiling on the selected extension function together with the basic access mechanism , generating the target MAC protocol. The invention also discloses a device for realizing the above method, a communication method between nodes and a wireless multi-hop network. The embodiment of the present invention solves the problem that the prior art does not have universality and compatibility due to the tight coupling of protocols and user requirements.
Description
技术领域technical field
本发明涉及无线网络技术领域,更具体地说,涉及一种无线多跳网络中MAC(Media Access Control,介质访问控制)协议生成方法、装置,及基于该协议生成方法的节点通信方法和装置。The present invention relates to the field of wireless network technology, and more specifically, to a method and device for generating a MAC (Media Access Control) protocol in a wireless multi-hop network, and a method and device for node communication based on the method for generating the protocol.
背景技术Background technique
在无线网络中,有一种是无线多跳网络,无线多跳网络可以是自组网,也可以是传感器网络。In the wireless network, there is a wireless multi-hop network, and the wireless multi-hop network can be an ad hoc network or a sensor network.
下面以传感器网络为例进行说明:Let’s take the sensor network as an example to illustrate:
传感器网络由大量集成了无线通信、信息采集和信息处理功能的微小型传感器节点组成。每个传感器节点利用本身的传感器采集周围环境的信息,然后把该信息传输到网络中的数据汇聚节点(也称Sink节点)。由于该网络中节点多、范围覆盖大,又是采用无线通信方式,所以,在多个节点都要通信时,需要确立一定的准则,确定哪些节点可以通信,哪些节点不能通信,以避免造成冲突和信道资源的浪费,这就是MAC协议要解决的核心问题。The sensor network is composed of a large number of tiny sensor nodes integrating wireless communication, information collection and information processing functions. Each sensor node uses its own sensor to collect the information of the surrounding environment, and then transmits the information to the data aggregation node (also called the Sink node) in the network. Since there are many nodes in the network, the coverage is large, and wireless communication is adopted, when multiple nodes need to communicate, it is necessary to establish certain criteria to determine which nodes can communicate and which nodes cannot communicate, so as to avoid conflicts And the waste of channel resources, this is the core problem to be solved by the MAC protocol.
现有的MAC协议设计都是从用户需求角度出发进行的,在此,所述“用户需求”指的是用户对于网络中信息收集的不同要求。在传感器网络中,用户的需求是多种多样的,例如:注重信息传输的能耗,注重信息传输时延,注重信息传输的可靠性,等等。这种设计理念使得设计得出的协议和用户需求紧密耦合。这使得不同传感器网络中MAC协议差别很大。目前,一种MAC协议都只能以一种接入方式为基础来实现,难以支持多种不同应用场合,不具有兼容性,这使得支持该协议的产品不具有通用性,例如:针对煤矿井下安全定位的需求和黄河湿地环境监测的需求,现有技术通常会分别设计两个不同的MAC协议,及支持这两个不同协议的产品,浪费了资源。Existing MAC protocol designs are all carried out from the perspective of user requirements. Here, the "user requirements" refer to different requirements of users for information collection in the network. In the sensor network, the needs of users are various, such as: pay attention to the energy consumption of information transmission, pay attention to the delay of information transmission, pay attention to the reliability of information transmission, and so on. This design concept makes the designed protocol tightly coupled with user needs. This makes the MAC protocols in different sensor networks very different. At present, a MAC protocol can only be realized based on one access method, it is difficult to support a variety of different applications, and there is no compatibility, which makes the products supporting this protocol not universal, for example: for coal mine underground For the needs of safe positioning and environmental monitoring of the Yellow River wetland, the existing technology usually designs two different MAC protocols and products supporting these two different protocols, which wastes resources.
发明内容Contents of the invention
有鉴于此,本发明实施例提供一种介质访问控制协议生成方法、节点通信方法和装置,以解决现有技术由于协议和用户需求紧密耦合,不具有兼容性的问题。In view of this, the embodiments of the present invention provide a method for generating a medium access control protocol, a node communication method and an apparatus, so as to solve the problem of incompatibility in the prior art due to the tight coupling between protocols and user requirements.
本发明实施例是这样实现的:The embodiment of the present invention is realized like this:
一种介质访问控制MAC协议生成方法,包括:A method for generating a media access control MAC protocol, comprising:
预处理步骤:Preprocessing steps:
确定基本接入机制;Identify basic access mechanisms;
根据用户需求设置多种可配置机制的扩充功能,并针对每一种可配置机制的扩充功能设置可配置参数;Set the extension functions of multiple configurable mechanisms according to user needs, and set configurable parameters for the extension functions of each configurable mechanism;
生成步骤:Build steps:
在用户根据目标MAC协议对可配置参数进行配置时,确定内容为预设数据的可配置参数对应的可配置机制的扩充功能;When the user configures the configurable parameters according to the target MAC protocol, determine the extension function of the configurable mechanism corresponding to the configurable parameters whose content is preset data;
对选择的扩充功能与所述基本接入机制一起进行代码加载、编译,生成所述目标MAC协议。Perform code loading and compiling on the selected extended function together with the basic access mechanism to generate the target MAC protocol.
优选的,所述基本接入机制为p坚持的CSMA协议。Preferably, the basic access mechanism is a p-persistent CSMA protocol.
优选的,所述扩充功能为:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能或者同步管理功能。Preferably, the extended function is: resource reservation function, interception function, handshake function, backoff function, confirmation function, transmission probability control function or synchronization management function.
本发明同时还公开了一种节点通信方法,应用于无线多跳网络,包括:The present invention also discloses a node communication method, which is applied to a wireless multi-hop network, including:
预处理步骤:Preprocessing steps:
确定基本接入机制;Identify basic access mechanisms;
根据用户需求设置多种可配置机制的扩充功能,并针对每一种可配置机制的扩充功能设置可配置参数;Set the extension functions of multiple configurable mechanisms according to user needs, and set configurable parameters for the extension functions of each configurable mechanism;
生成步骤:Build steps:
发送节点在发送数据给接收节点之前,确定该接收节点的MAC协议,在用户根据该MAC协议对可配置参数进行配置时,确定内容等于预设数据的可配置参数对应的扩充功能;The sending node determines the MAC protocol of the receiving node before sending data to the receiving node, and when the user configures the configurable parameters according to the MAC protocol, determines the extended function corresponding to the configurable parameter whose content is equal to the preset data;
发送节点对选择的扩充功能与所述基本接入机制一起进行代码加载、编译,生成所述MAC协议;The sending node loads and compiles the selected extended function together with the basic access mechanism to generate the MAC protocol;
通信步骤:Communication steps:
所述发送节点和接收节点将所述MAC协议作为通信协议进行通信。The sending node and the receiving node communicate using the MAC protocol as a communication protocol.
优选的,上述方法中,发送节点确定接收节点的MAC协议的具体方式为:Preferably, in the above method, the specific manner for the sending node to determine the MAC protocol of the receiving node is:
发送节点通过空闲侦听,记录该接收节点的协议版本号信息,该版本号信息包含各扩展功能对应的可配置参数内容;The sending node records the protocol version number information of the receiving node through idle listening, and the version number information includes the configurable parameter content corresponding to each extended function;
发送节点根据所述可配置参数内容确定接收节点的MAC协议。The sending node determines the MAC protocol of the receiving node according to the content of the configurable parameter.
优选的,上述方法中,所述基本接入机制为p坚持的CSMA协议,所述扩充功能为:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能或者同步管理功能。Preferably, in the above method, the basic access mechanism is the CSMA protocol adhered to by p, and the extended function is: resource reservation function, listening function, handshake function, backoff function, confirmation function, transmission probability control function or synchronization management functions.
本发明还公开了另一种节点通信方法,应用于无线多跳网络,包括:预处理步骤:The invention also discloses another node communication method, which is applied to a wireless multi-hop network, including: preprocessing steps:
确定基本接入机制;Identify basic access mechanisms;
根据用户需求设置多种可配置机制的扩充功能,并针对每一种可配置机制的扩充功能设置可配置参数;Set the extension functions of multiple configurable mechanisms according to user needs, and set configurable parameters for the extension functions of each configurable mechanism;
生成步骤:Build steps:
接收节点确定发送节点的MAC协议,在用户根据该MAC协议对可配置参数进行配置时,确定内容等于预设数据的可配置参数对应的扩充功能;The receiving node determines the MAC protocol of the sending node, and when the user configures the configurable parameters according to the MAC protocol, determines the extended function corresponding to the configurable parameter whose content is equal to the preset data;
接收节点对选择的扩充功能与所述基本接入机制一起进行代码加载、编译,生成所述MAC协议;The receiving node loads and compiles the selected extended function together with the basic access mechanism to generate the MAC protocol;
通信步骤:Communication steps:
所述发送节点和接收节点将所述MAC协议作为通信协议进行通信。The sending node and the receiving node communicate using the MAC protocol as a communication protocol.
优选的,上述方法中,接收节点确定发送节点的MAC协议的具体方式为:Preferably, in the above method, the specific manner for the receiving node to determine the MAC protocol of the sending node is:
接收节点通过空闲侦听,记录发送节点的协议版本号信息,该版本号信息包含各扩展功能对应的可配置参数内容;The receiving node records the protocol version number information of the sending node through idle listening, and the version number information includes the configurable parameter content corresponding to each extended function;
接收节点根据所述可配置参数内容确定发送节点的MAC协议。The receiving node determines the MAC protocol of the sending node according to the content of the configurable parameter.
优选的,上述方法中,所述基本接入机制为p坚持的CSMA协议,所述扩充功能为:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能或者同步管理功能。Preferably, in the above method, the basic access mechanism is the CSMA protocol adhered to by p, and the extended function is: resource reservation function, listening function, handshake function, backoff function, confirmation function, transmission probability control function or synchronization management functions.
本发明同时公开了一种介质访问控制MAC协议生成装置,包括:The invention also discloses a medium access control MAC protocol generation device, including:
第一存储单元,用于存储基本接入机制标识及相应代码;The first storage unit is used to store the basic access mechanism identifier and the corresponding code;
第二存储单元,用于存储多种可配置机制的扩充功能标识及相应的代码,及与各可配置机制的扩充功能对应的配置参数;The second storage unit is used to store the extended function identifiers and corresponding codes of various configurable mechanisms, and configuration parameters corresponding to the extended functions of each configurable mechanism;
第一处理单元,用于在用户根据目标MAC协议对可配置参数进行配置时,确定内容等于预设数据的可配置参数对应的扩充功能标识;The first processing unit is configured to determine the extended function identifier corresponding to the configurable parameter whose content is equal to the preset data when the user configures the configurable parameter according to the target MAC protocol;
第二处理单元,用于对选择的扩充功能标识对应的代码与所述基本接入机制的代码一起进行加载、编译,生成所述目标MAC协议。The second processing unit is configured to load and compile the code corresponding to the selected extended function identifier together with the code of the basic access mechanism to generate the target MAC protocol.
优选的,上述装置中,基本接入机制为p坚持的CSMA协议,所述扩充功能为:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能或者同步管理功能。Preferably, in the above device, the basic access mechanism is the CSMA protocol adhered to by p, and the extended functions are: resource reservation function, interception function, handshake function, backoff function, confirmation function, transmission probability control function or synchronization management function .
本发明同时还公开了一种无线多跳网络,包括若干节点,所述节点包括通信单元,所述节点还包括介质访问控制MAC协议生成装置和MAC协议确定单元;The present invention also discloses a wireless multi-hop network, which includes several nodes, the nodes include a communication unit, and the nodes also include a medium access control MAC protocol generation device and a MAC protocol determination unit;
所述MAC确定单元用于在通信单元与目标节点进行通信之前,确定该目标节点的MAC协议,所述装置包括:The MAC determining unit is used to determine the MAC protocol of the target node before the communication unit communicates with the target node, and the device includes:
第一存储单元,用于存储基本接入机制标识及相应代码;The first storage unit is used to store the basic access mechanism identifier and the corresponding code;
第二存储单元,用于存储多种可配置机制的扩充功能标识及相应的代码,及与各可配置机制的扩充功能对应的可配置参数;The second storage unit is used to store the extended function identifiers and corresponding codes of various configurable mechanisms, and the configurable parameters corresponding to the extended functions of each configurable mechanism;
第一处理单元,用于在用户根据目标节点的MAC协议对可配置参数进行配置时,确定内容为预设数据的可配置参数对应的扩充功能标识;The first processing unit is configured to determine the extended function identifier corresponding to the configurable parameter whose content is preset data when the user configures the configurable parameter according to the MAC protocol of the target node;
第二处理单元,用于对选择的扩充功能标识对应的代码与所述基本接入机制的代码一起进行加载、编译,生成所述目标节点的MAC协议;The second processing unit is configured to load and compile the code corresponding to the selected extended function identifier together with the code of the basic access mechanism to generate the MAC protocol of the target node;
所述通信单元按照所述生成的MAC协议向目标节点发送数据,并接收该The communication unit sends data to the target node according to the generated MAC protocol, and receives the data
目标节点反馈的数据。The data fed back by the target node.
优选的,上述网络中,基本接入机制为p坚持的CSMA协议,所述扩充功能为:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能或者同步管理功能。Preferably, in the above network, the basic access mechanism is the CSMA protocol adhered to by p, and the extended functions are: resource reservation function, interception function, handshake function, backoff function, confirmation function, transmission probability control function or synchronization management function .
从上述的技术方案可以看出,与现有技术相比,本发明实施例以一种接入机制作为基本接入机制,将预先设置的可配置机制作为扩充部分。根据用户需求选择对扩充部分的机制进行配置,并与基本接入机制相结合,便可产生相应的协议。使用本发明实施例公开的MAC协议生成方法,可以根据需要生成相应的MAC协议,满足用户的多种需求,并且实现不同接入机制间的互 通:比如网络中一部分节点采用的是ALOHA协议,另一部分节点采用CSMA(Carrier Sense Multiple Access,载波侦听多路访问)协议,则这两部分的节点能够通过本发明公开的方案实现通信。It can be seen from the above technical solutions that, compared with the prior art, the embodiment of the present invention uses an access mechanism as a basic access mechanism, and uses a preset configurable mechanism as an extended part. Select and configure the mechanism of the extension according to the user's needs, and combine it with the basic access mechanism to generate a corresponding protocol. Using the MAC protocol generation method disclosed in the embodiment of the present invention, the corresponding MAC protocol can be generated according to the needs to meet the various needs of the user, and realize the intercommunication between different access mechanisms: for example, some nodes in the network use the ALOHA protocol, Another part of nodes adopts CSMA (Carrier Sense Multiple Access) protocol, and then the two parts of nodes can realize communication through the solution disclosed in the present invention.
附图说明Description of drawings
图1为本发明一种介质访问控制协议生成方法的实施例的流程图;FIG. 1 is a flowchart of an embodiment of a method for generating a media access control protocol according to the present invention;
图2为本发明实施例中时隙的结构示意图;FIG. 2 is a schematic structural diagram of a time slot in an embodiment of the present invention;
图3为本发明一种节点通信方法的实施例一流程图;FIG. 3 is a flow chart of Embodiment 1 of a node communication method according to the present invention;
图4为本发明一种节点通信方法的实施例二流程图;FIG. 4 is a flow chart of Embodiment 2 of a node communication method of the present invention;
图5为一种消息格式示意图;Fig. 5 is a schematic diagram of a message format;
图6为本发明一种介质访问控制生成装置的实施例的结构示意图。Fig. 6 is a schematic structural diagram of an embodiment of an apparatus for generating media access control according to the present invention.
具体实施方式Detailed ways
目前,无线传感器网络的MAC协议多种多样,主流协议有30种以上。但就其本质而言,都是对于网络内多个节点如何接入信道的协调和管理,无非就是基于ALOHA的MAC协议、基于CSMA的MAC协议和基于TDMA(Time Division Multiple Access,时分多址)的MAC协议。At present, there are various MAC protocols in wireless sensor networks, and there are more than 30 mainstream protocols. But in essence, it is all about the coordination and management of how multiple nodes in the network access the channel, nothing more than ALOHA-based MAC protocol, CSMA-based MAC protocol and TDMA (Time Division Multiple Access, Time Division Multiple Access) MAC protocol.
其中:in:
基于ALOHA的MAC协议包括有:时隙/非时隙ALOHA协议、以概率p发送的时隙/非时隙ALOHA协议和带确认的时隙/非时隙ALOHA协议等。ALOHA-based MAC protocols include: slotted/non-slotted ALOHA protocol, slotted/non-slotted ALOHA protocol sent with probability p, and slotted/non-slotted ALOHA protocol with acknowledgment, etc.
基于CSMA的MAC协议包括有:p坚持的时隙/非时隙CSMA协议、1坚持的时隙/非时隙CSMA协议、带握手机制的时隙/非时隙CSMA协议和带确认的时隙/非时隙CSMA协议等。CSMA-based MAC protocols include: p-persistent slotted/non-slotted CSMA protocol, 1-persistent slotted/non-slotted CSMA protocol, slotted/non-slotted CSMA protocol with handshake mechanism, and slotted acknowledgment / Non-slotted CSMA protocol, etc.
基于TDMA的MAC协议包括有:采用某种方式实现的预先分配的接入机制。The TDMA-based MAC protocol includes: a pre-allocated access mechanism implemented in a certain way.
各种协议都是针对用户的某个特定需求进行设计的,彼此之间不能通用。这样,要想在一个网络中使用不同协议或是让一组装置支持不同的接入机制是不可实现的。基于此,本发明提出了一种MAC协议生成方法,即以一种接入机制作为基本接入机制,将预先设置的可配置机制作为扩充部分。根据用 户需求选择对扩充部分的机制进行配置,并与基本接入机制相结合,便可产生相应的协议。Various protocols are designed for a specific requirement of the user, and cannot be used in common with each other. Thus, it is not possible to use different protocols in a network or to have a group of devices support different access mechanisms. Based on this, the present invention proposes a method for generating a MAC protocol, that is, an access mechanism is used as a basic access mechanism, and a preset configurable mechanism is used as an extended part. Select and configure the mechanism of the extension according to user needs, and combine it with the basic access mechanism to generate a corresponding protocol.
而国内外目前尚无通用MAC协议的相关文献。无线个域网标准802.15.4(Zigbee)的MAC协议或是802.11的MAC协议,虽然消息交互过程和具体规程上有变化,但从本质上来说只是基于CSMA的变形,不提供CSMA以外的,比如ALOHA或是TDMA接入方式。However, there is no relevant literature on the general MAC protocol at home and abroad. The MAC protocol of the wireless personal area network standard 802.15.4 (Zigbee) or the MAC protocol of 802.11, although there are changes in the message exchange process and specific procedures, is essentially a deformation based on CSMA and does not provide anything other than CSMA, such as ALOHA or TDMA access method.
为了使得本领域技术人员更好理解本发明实施例的技术方案,下面结合附图和实施例对本发明技术方案进行详细描述。In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, the technical solutions of the present invention will be described in detail below in conjunction with the accompanying drawings and embodiments.
请参考图1,为本发明一种介质访问控制协议生成方法的实施例的流程图。Please refer to FIG. 1 , which is a flowchart of an embodiment of a method for generating a media access control protocol according to the present invention.
具体包括以下步骤:Specifically include the following steps:
步骤S100、预处理步骤。Step S100, a preprocessing step.
该预处理步骤包括以下步骤:This preprocessing step includes the following steps:
步骤S101、确定基本接入机制。Step S101, determining a basic access mechanism.
在目前已有的自组网、传感器网络MAC协议中,主流协议超过60种,衍生协议100余种。其中90%是随机竞争类协议。85%是基于载波侦听、冲突避免机制的。说明用户需求是以这类协议为主。Among the existing ad hoc network and sensor network MAC protocols, there are more than 60 mainstream protocols and more than 100 derivative protocols. 90% of them are random competition type agreements. 85% are based on carrier sense and collision avoidance mechanisms. Explain that user needs are mainly based on this type of agreement.
在众多的MAC协议中,基本的接入方式只有三种:ALOHA协议、CSMA协议和TDMA协议。Among the numerous MAC protocols, there are only three basic access methods: ALOHA protocol, CSMA protocol and TDMA protocol.
原则上讲,上述三种协议中的任意一种都可以作为基本接入机制,比如,ALOHA可以作为基本接入机制,TDMA也可以作为基本接入机制。但是这些接入方式的用户群很少,并且,将ALOHA或者TDMA作为基本接入机制,其扩展复杂度相对于CSMA要大得多,所述扩展复杂度是指:在基本接入机制上生成其他具体协议所需要定义的扩展功能的种类及组合方法数。这个指标反映了协议的生成、编译过程的复杂程度。In principle, any one of the above three protocols can be used as a basic access mechanism, for example, ALOHA can be used as a basic access mechanism, and TDMA can also be used as a basic access mechanism. However, there are very few user groups for these access methods, and when ALOHA or TDMA is used as the basic access mechanism, its extended complexity is much greater than that of CSMA. The extended complexity refers to: generating The types and combination methods of extended functions that need to be defined by other specific protocols. This indicator reflects the complexity of the protocol generation and compilation process.
如图2所示,可以看出,采用p坚持的CSMA协议作为基本接入机制的扩展复杂度,相比将ALOHA和TDMA作为基本接入机制的扩展复杂度要小。As shown in Fig. 2, it can be seen that the expansion complexity of adopting p-adherent CSMA protocol as the basic access mechanism is smaller than that of ALOHA and TDMA as the basic access mechanism.
所以,本文确定p坚持的CSMA协议作为基本接入机制。Therefore, this paper determines that p adheres to the CSMA protocol as the basic access mechanism.
所述p坚持的CSMA协议的具体内容为:节点在发送数据之前先进行载波侦听,若信道为空闲,则以概率p发送数据,若信道为忙,则继续侦听直到信道变为空闲,然后,以概率p发送数据。The specific content of the CSMA protocol insisted by p is as follows: the node performs carrier sense before sending data, if the channel is idle, then sends data with probability p, if the channel is busy, then continues to listen until the channel becomes idle, Then, send data with probability p.
步骤S102、根据用户需求设置多种扩充功能。Step S102, setting various extension functions according to user requirements.
所述扩充功能是根据各种MAC协议的各种规定实现的功能,例如:侦听功能、握手功能或同步管理功能等。The extended function is a function implemented according to various regulations of various MAC protocols, for example: interception function, handshake function, or synchronization management function.
针对每一种扩充功能设置可配置参数。Set configurable parameters for each extension.
所述可配置参数包含用于指示对应的扩充功能是否被选择,例如数据为1,则表示选择扩充功能,为0则表示不选择扩充功能。The configurable parameter is used to indicate whether the corresponding extended function is selected, for example, if the data is 1, it means that the extended function is selected, and if it is 0, it means that the extended function is not selected.
用户可以通过控制所数参数开关来实现对扩充功能的选择。Users can realize the selection of extended functions by controlling the switches of all the parameters.
下面介绍一下几种扩充功能及相应的参数开关:The following introduces several extended functions and corresponding parameter switches:
①、资源预留功能①. Resource reservation function
在划分时隙的网络中,本发明实施例支持以预留的方式使用信道。In a network with time slots, the embodiments of the present invention support the use of channels in a reserved manner.
可预先分配某个时隙给某个节点,时隙分配的方法可以有很多,例如在布设网络时预先给一部分或是全部节电预先分配好部分时隙。A certain time slot can be pre-allocated to a certain node. There are many ways to allocate time slots. For example, when laying out the network, pre-allocate part of the time slots for part or all of the power saving.
可以在时隙结构中设置一预留标志位,如图3所示。为本发明实施例中时隙的结构示意图。A reserved flag bit can be set in the time slot structure, as shown in FIG. 3 . It is a schematic diagram of the structure of the time slot in the embodiment of the present invention.
从图3中可以看出,每时隙由若干时元构成,在每时隙的头上有一个时元的预留标志位,如果该时隙是某个节点的预留时隙且本节点有数据要发送,则该节点在预留标志中发送忙音信号。其它非TDMA方式的节点如果想要使用该时隙,则先判断该标志是否为空。如果非空,则不能使用这一时隙。It can be seen from Figure 3 that each time slot is composed of several time units, and there is a reserved flag bit of an time unit at the head of each time slot. If the time slot is a reserved time slot of a node and the node If there is data to be sent, the node sends a busy tone signal in the reserved flag. If other non-TDMA nodes want to use the time slot, they first judge whether the flag is empty. If non-empty, this slot cannot be used.
这种资源预留功能可以保证预留资源的节点具有最高的接入优先级。This resource reservation function can ensure that the node that reserves resources has the highest access priority.
配置参数Resource obligate-flag的内容:为1,表示采用TDMA(也即采用扩充功能);为0,表示采用默认设置(也即不采用扩充功能);为0XFF,表示手动设置无效,也即自动确定是否选择扩充功能。The content of the configuration parameter Resource obligate-flag: 1 means that TDMA is used (that is, the extended function is used); 0 means that the default setting is used (that is, the extended function is not used); 0XFF means that the manual setting is invalid, that is, the automatic Determines whether to select extensions.
②、侦听功能②, listening function
用户可以对配置参数CS-flag进行配置,如果配置参数CS-flag内容:为1,表示采用侦听功能;为0,表示不采用侦听功能,即不执行侦听功能,而是直接发送,也就是ALOHA方式;为0XFF,表示手动配置无效,也就是表示采用自动选择侦听机制,即:根据节点维护的邻居节点列表和信道业务量 统计表,节点个数和业务量较少时,不采用侦听机制,而是直接发送(ALOHA)。如果业务量或是节点个数较多,则采用载波侦听机制。The user can configure the configuration parameter CS-flag. If the content of the configuration parameter CS-flag is 1, it means that the interception function is used; That is the ALOHA mode; 0XFF means that the manual configuration is invalid, that is, the automatic selection listening mechanism is adopted, that is: according to the neighbor node list and the channel traffic statistics table maintained by the node, when the number of nodes and the traffic volume are small, no Use the listening mechanism instead of sending directly (ALOHA). If the traffic volume or the number of nodes is large, the carrier sense mechanism is adopted.
③、握手功能:③. Handshake function:
用户可以对配置参数Handshake-flag进行配置,如果配置参数Handshake-flag内容:为1时,表示采用握手功能;为0时,表示不采用握手功能(即纯CSMA);为0XFF时,表示手动配置无效。也就是表示自动选择是否采用侦听机制,即:对分组长度进行判断,如果分组长度长于某个门限值,采用握手机制;如果分组长度小于门限值,则不采用握手机制。The user can configure the configuration parameter Handshake-flag. If the content of the configuration parameter Handshake-flag is 1, it means that the handshake function is used; when it is 0, it means that the handshake function is not used (that is, pure CSMA); when it is 0XFF, it means manual configuration invalid. That is to say, it means to automatically choose whether to use the listening mechanism, that is, to judge the packet length, if the packet length is longer than a certain threshold value, the handshake mechanism is adopted; if the packet length is smaller than the threshold value, the handshake mechanism is not adopted.
协议的运行优先执行手动配置。The operation of the protocol takes precedence over manual configuration.
④、退避功能:④, retreat function:
用户可以对配置参数CWmin-fix进行配置,如果该配置参数CWmin-fix内容:为1时,表示手动设置固定退避窗,也即允许用户自己配置退避窗的大小;为0,表示手动设置最小退避窗的初始值(以时元为单位);为0XFF时,表示手动设置无效,也就是表示自动设置固定退避窗,退避算法可以采用BEB(二进制指数回退算法)算法,也可以是其它的退避算法。针对BEB算法,该设置固定退避窗的具体过程为:判断邻居节点列表中邻居节点个数,如果邻居节点列表中,邻节点个数小于某个门限值,则减少退避窗的最小值。否则,增加退避窗的最小值。The user can configure the configuration parameter CWmin-fix. If the content of the configuration parameter CWmin-fix is 1, it means manually setting a fixed backoff window, which means that the user is allowed to configure the size of the backoff window; if it is 0, it means manually setting the minimum backoff window The initial value of the window (in units of epochs); when it is 0XFF, it means that the manual setting is invalid, that is, it means that the fixed backoff window is automatically set, and the backoff algorithm can use the BEB (Binary Exponential Backoff Algorithm) algorithm, or other backoff algorithms algorithm. For the BEB algorithm, the specific process of setting a fixed backoff window is: determine the number of neighbor nodes in the neighbor node list, and if the number of neighbor nodes in the neighbor node list is less than a certain threshold value, reduce the minimum value of the backoff window. Otherwise, increase the minimum value of the backoff window.
协议的运行优先执行手动配置。The operation of the protocol takes precedence over manual configuration.
⑤、确认功能:⑤. Confirmation function:
配置参数包含反馈标志ACK-flag和反馈类型ACK-type。当ACK-flag内容:为1时,表示采用确认功能,哪些业务采用该功能由ACK-type说明;为0,表示不采用确认机制,那些业务不采用由ACK-type说明;为0XFF,表示手动配置无效,也就是表示采用自动选择确认机制,即:根据业务类型,选择是否采用确认机制。对于单播业务,采用确认机制,对于广播业务不采用确认机制。不同业务类型的区分通过目的节点地址来实现。The configuration parameters include the feedback flag ACK-flag and the feedback type ACK-type. When the content of ACK-flag is 1, it means the acknowledgment function is used, and which services use this function is explained by ACK-type; when it is 0, it means that the acknowledgment mechanism is not used, and those services that do not use it are explained by ACK-type; when it is 0XFF, it means manual The configuration is invalid, which means that the confirmation mechanism is automatically selected, that is, whether to use the confirmation mechanism is selected according to the business type. For the unicast service, the confirmation mechanism is adopted, and the confirmation mechanism is not adopted for the broadcast service. The distinction of different service types is realized through the address of the destination node.
ACK-type内容:为0X01时,表示单播;为0X02时,表示广播;为0X03时,表示组播,为0X00时,表示全部业务类型。用于指明对哪一类分组采用或是不采用确认机制。例如当ACK-flag为1,ACK-type为0X01时,表示对单播业务采用确认功能。ACK-type content: when it is 0X01, it means unicast; when it is 0X02, it means broadcast; when it is 0X03, it means multicast; when it is 0X00, it means all service types. It is used to indicate which type of packet adopts or does not adopt the confirmation mechanism. For example, when the ACK-flag is 1 and the ACK-type is 0X01, it indicates that the acknowledgment function is used for the unicast service.
协议的运行优先执行手动配置。The operation of the protocol takes precedence over manual configuration.
⑥发送概率控制功能:⑥Send probability control function:
本发明实施例允许用户手动配置发送概率,如:用户可以配置固定的发送概率,这样网络中的节点采用相同的基准发送概率,或是采用固定的发送概率。如果配置参数p-flag内容:为1,表示手动配置初始值;为0,表示采用手动方式配置固定的发送概率,为0XFF,表示手动配置无效,也就是表示采用自动选择发送概率的方法,即:节点维护的业务量统计表,如果业务量超过某个门限值,则降低发送概率,否则升高发送概率。这样,网络中各个节点可以根据自己周围的环境动态调整发送概率。具体的算法已发表为公开的论文,如果需要可以引用。The embodiment of the present invention allows the user to manually configure the sending probability, for example, the user can configure a fixed sending probability, so that nodes in the network use the same reference sending probability, or use a fixed sending probability. If the content of the configuration parameter p-flag is 1, it means that the initial value is manually configured; if it is 0, it means that the fixed sending probability is configured manually; if it is 0XFF, it means that the manual configuration is invalid, that is, the method of automatically selecting the sending probability is used, that is : The business volume statistics table maintained by the node. If the business volume exceeds a certain threshold, the sending probability will be reduced, otherwise the sending probability will be increased. In this way, each node in the network can dynamically adjust the sending probability according to its surrounding environment. The specific algorithm has been published as a public paper and can be cited if necessary.
协议的运行优先执行手动配置。The operation of the protocol takes precedence over manual configuration.
⑦、同步管理功能:⑦. Synchronization management function:
同步管理部分主要完成节点同步状态的维护,若是异步网络,则本部分不需要运行,如果是同步网络,本部分完成对时元和时隙的计数功能。The synchronization management part mainly completes the maintenance of the synchronization status of nodes. If it is an asynchronous network, this part does not need to run. If it is a synchronous network, this part completes the counting function of epochs and time slots.
协议默认的是异步网络的配置,如果要改变配置,则需要对配置参数Synchronization-flag的内容进行配置,当其内容:为1,表示同步网络,为0,表示异步网络。The protocol defaults to the configuration of the asynchronous network. If you want to change the configuration, you need to configure the content of the configuration parameter Synchronization-flag. When the content is 1, it means a synchronous network, and if it is 0, it means an asynchronous network.
需要说明的是,上述列出的扩充功能仅仅是扩充功能中的几种,可以根据协议实现功能,确定新的扩充功能。It should be noted that the above-listed extended functions are just some of the extended functions, and new extended functions can be determined according to the functions implemented according to the protocol.
另外,还需要说明的是,上述侦听功能、退避功能和发送概率控制功能中,邻居节点列表与业务量统计表可以有不同的实现方式,其具体方式可以如表1所示:In addition, it should be noted that, in the above-mentioned interception function, backoff function and transmission probability control function, the neighbor node list and the traffic statistics table can have different implementation methods, and the specific methods can be shown in Table 1:
表1 Table 1
该表主要用于发送概率的计算、退避窗的设置,在ALOHA协议中,因为无侦听功能,所以无法建立该表,也不支持发送概率和退避的自适应算法。This table is mainly used for the calculation of transmission probability and the setting of backoff window. In the ALOHA protocol, because there is no interception function, this table cannot be established, and the adaptive algorithm of transmission probability and backoff is also not supported.
在完成预处理步骤后,可以将多个扩充功能的标识及其代码存储于某预设地址,然后,进入生成步骤:After the preprocessing step is completed, the identifiers and codes of multiple extensions can be stored in a preset address, and then enter the generation step:
步骤S200、生成步骤。Step S200, a generating step.
生成步骤包括以下步骤:The generation step consists of the following steps:
步骤S201、获取可配置参数的内容。Step S201, acquiring the content of configurable parameters.
用户根据目标MAC协议的具体实现功能,通过设置可配置参数来选择相应的扩充功能。The user selects corresponding extended functions by setting configurable parameters according to the specific realization functions of the target MAC protocol.
在此过程中,获取可配置参数内容。During this process, the configurable parameter content is obtained.
步骤S202、确定内容为预设数据的可配置参数对应的扩充功能。Step S202, determining the extended function corresponding to the configurable parameter whose content is preset data.
根据可配置参数的内容,确定是否采用对应的扩充功能。例如,当某扩充功能的可配置参数内容为1,则表示该扩充功能被选择。According to the content of the configurable parameters, determine whether to use the corresponding extended function. For example, when the configurable parameter content of an extended function is 1, it means that the extended function is selected.
步骤S203、将确定的扩充功能和基本接入机制进行代码加载、编译,生成所述目标MAC协议。Step S203: Load and compile the determined extended functions and basic access mechanism to generate the target MAC protocol.
根据确定的扩充功能标识,从预设地址获取对应的代码,将该代码按照所述可配置参数内容,与基本接入机制的代码一起进行加载、编译,最终生成所述目标MAC协议。Obtain the corresponding code from the preset address according to the determined extended function identifier, load and compile the code together with the code of the basic access mechanism according to the content of the configurable parameters, and finally generate the target MAC protocol.
下面通过几个具体实例进行说明:Here are a few specific examples to illustrate:
(1)、假设目标MAC协议为TDMA协议,TDMA协议具体内容为:(1), assuming that the target MAC protocol is a TDMA protocol, the specific content of the TDMA protocol is:
假设根据节点ID号,为每个节点分配一个相应的时隙,即1号节点占用1号时隙,2号节点占用2号时隙。则:Assume that each node is assigned a corresponding time slot according to the node ID number, that is, node 1 occupies time slot 1, and node 2 occupies time slot 2. but:
节点在有数据要发送时,在自己的时隙的预留标志位上发送忙音。并在随后的时元开始时发送数据。When a node has data to send, it sends a busy tone on the reserved flag of its own time slot. and send data at the beginning of the subsequent epoch.
如果节点的数据量较大时,若某个时隙的预留标志位为空,可以在该时隙上发送数据,但是这样可能会造成数据的冲突。为避免冲突,节点发送数据的概率与节点的邻居节点个数成反比,(也可以经手动配置成固定的发送概率,这一点由发送概率控制部分决定。)。这里要用到同步管理单元,对时隙的计数。If the amount of data of a node is large, if the reserved flag of a certain time slot is empty, data can be sent on this time slot, but this may cause data conflicts. In order to avoid conflicts, the probability of a node sending data is inversely proportional to the number of neighbor nodes of the node (it can also be manually configured as a fixed sending probability, which is determined by the sending probability control part.). The synchronization management unit is used here to count the time slots.
可以看出,在基本接入机制上,需要的扩充功能包括:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能和同步管理功能。It can be seen that in the basic access mechanism, the required extended functions include: resource reservation function, interception function, handshake function, backoff function, confirmation function, transmission probability control function and synchronization management function.
通过将上述扩充功能对应的配置参数内容设置为预设数据(例如:1)来确定选择上述扩充功能,用户可以对相应的配置参数做以下配置:By setting the content of the configuration parameters corresponding to the above-mentioned extended functions as preset data (for example: 1) to determine the selection of the above-mentioned extended functions, the user can configure the corresponding configuration parameters as follows:
Resource obligate-flag置为1,表示采用TDMA;Resource obligate-flag is set to 1, indicating that TDMA is used;
CS-flag置为0,不采用载波侦听机制;CS-flag is set to 0, and the carrier sense mechanism is not used;
Handshake-flag置为0,不采用握手机制;Handshake-flag is set to 0, and the handshake mechanism is not used;
CWmin-fix置为1,表示手动设置固定退避窗,CWmin设为0;CWmin-fix is set to 1, indicating that the fixed backoff window is manually set, and CWmin is set to 0;
ACK-flag置为0,ACK-type置为0X00,表示全部业务类型不采用确认机制;ACK-flag is set to 0, ACK-type is set to 0X00, indicating that all business types do not use the confirmation mechanism;
p-flag置为0,表示手动配置固定发送概率,p设为1;If p-flag is set to 0, it means that the fixed transmission probability is manually configured, and p is set to 1;
Synchronization-flag置为1,表示采用同步网络,设节点个数为N,同步管理单元对时隙的计数进行模N计算。Synchronization-flag is set to 1, indicating that a synchronous network is used, and the number of nodes is set to N, and the synchronization management unit performs modulo N calculation on the count of time slots.
另外,为了避免自相矛盾的发生,可以在用户对配置参数进行配置后,进行逻辑关系检查。In addition, in order to avoid the occurrence of self-contradiction, a logic relationship check can be performed after the user configures the configuration parameters.
在检查通过后,再获取与上述扩充功能的代码,与基本接入机制代码一起进行代码加载、代码编译后成生所述TDMA协议代码。After the inspection is passed, the code for the above-mentioned extended function is obtained, and the code is loaded together with the basic access mechanism code, and the code is compiled to generate the TDMA protocol code.
(2)、假设目标MAC协议为ALOHA协议,ALOHA协议是一种想发就发的机制。为了避免冲突,可以在发送之前采用发送概率进行控制,如果要生成一个以概率p发送并要求回复确定的时隙ALOHA协议,其生成的过程如下:根据ALOHA协议的内容,可以看出在基本接入机制上,需要的扩充功能包括:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能和同步管理功能。(2) Assume that the target MAC protocol is the ALOHA protocol, and the ALOHA protocol is a mechanism for sending as desired. In order to avoid conflicts, the sending probability can be used to control before sending. If you want to generate a time slot ALOHA protocol that sends with probability p and requires a certain reply, the generation process is as follows: According to the content of the ALOHA protocol, it can be seen that in the basic interface In terms of the entry mechanism, the required extended functions include: resource reservation function, listening function, handshake function, backoff function, confirmation function, transmission probability control function and synchronization management function.
通过将上述扩充功能对应的配置参数内容设置为预设数据(例如:1)来确定选择上述扩充功能,用户可以对相应的配置参数做以下配置:By setting the content of the configuration parameters corresponding to the above-mentioned extended functions as preset data (for example: 1) to determine the selection of the above-mentioned extended functions, the user can configure the corresponding configuration parameters as follows:
Resource obligate-flag置为0XFF,表示无效;Resource obligate-flag is set to 0XFF, which means invalid;
CS-flag置为0,表示采用ALOHA;CS-flag is set to 0, indicating that ALOHA is used;
Handshake-flag置为0,不采用握手机制;Handshake-flag is set to 0, and the handshake mechanism is not used;
CWmin-fix置为1,CWmin设为0;CWmin-fix is set to 1, CWmin is set to 0;
ACK-flag置为1,有效;ACK-type:置为X02,表示对广播业务需要进行确认;ACK-flag is set to 1, valid; ACK-type: set to X02, indicating that the broadcast service needs to be confirmed;
p-flag置为0,表示采用手动固定配置,比如SENDP=0.2;Set p-flag to 0, which means manual fixed configuration is adopted, such as SENDP=0.2;
Synchronization-flag置为1,表示采用同步网络;同步管理单元对时隙的计数进行模M计数,比如,初始化M=20。Synchronization-flag is set to 1, indicating that a synchronous network is used; the synchronization management unit performs modulo M counting on the counting of time slots, for example, initializing M=20.
对上述参数进行逻辑检查,获取与上述扩充功能的代码,与基本接入机制代码一起进行代码加载、代码编译后成生所述ALOHA协议代码。Perform a logic check on the above parameters, obtain the code for the above-mentioned extended functions, and perform code loading and code compiling together with the basic access mechanism code to generate the ALOHA protocol code.
(3)、假设目标MAC协议为:带握手机制、带确认机制的非时隙CSMA协议,生成的过程如下:(3), assuming that the target MAC protocol is: a non-slotted CSMA protocol with a handshake mechanism and a confirmation mechanism, the generation process is as follows:
根据该协议内容,在基本接入机制上,需要的扩充功能包括:资源预留功能、侦听功能、握手功能、退避功能、确认功能、发送概率控制功能和同步管理功能。According to the content of the agreement, in the basic access mechanism, the required extended functions include: resource reservation function, interception function, handshake function, backoff function, confirmation function, transmission probability control function and synchronization management function.
通过将上述扩充功能对应的配置参数内容设置预设数据(例如:1)来确定选择上述扩充功能,用户可以对相应的配置参数做以下配置:By setting the configuration parameters corresponding to the above-mentioned extended functions to preset data (for example: 1) to determine the selection of the above-mentioned extended functions, the user can configure the corresponding configuration parameters as follows:
Resource obligate-flag置为0XFF,表示无效;Resource obligate-flag is set to 0XFF, which means invalid;
CS-flag置为0XFF,无效;CS-flag is set to 0XFF, invalid;
Handshake-flag置为1,有效;Handshake-flag is set to 1, valid;
CWmin-fix=0,手工设置,比如CWmin=32;CWmin-fix=0, manually set, such as CWmin=32;
ACK-flag置为1,有效;ACK-flag is set to 1, valid;
ACK-type置为X01,表示对单播业务需要进行确认;ACK-type is set to X01, indicating that the unicast service needs to be confirmed;
p-flag置为0,SENDP=0;Set p-flag to 0, SENDP=0;
Synchronization-flag置为0,表示采用异步网络。Setting the Synchronization-flag to 0 indicates that an asynchronous network is used.
对上述参数进行逻辑检查,获取与上述扩充功能的代码,与基本接入机制代码一起进行代码加载、代码编译后成生所带握手机制、带确认机制的非时隙CSMA协议代码。Check the logic of the above parameters, obtain the code for the above-mentioned extended functions, load the code together with the basic access mechanism code, and compile the code to generate the non-slotted CSMA protocol code with handshake mechanism and confirmation mechanism.
上述MAC协议生成方法实施例可以应用在无线多跳网络中,支持不同协议的节点之间的通信,假设节点A为源节点(即发送节点),节点B为目的节点(即接收节点),节点A运行的协议是时隙ALOHA协议,节点B运行的协议是四握手的载波侦听协议。The above embodiment of the MAC protocol generation method can be applied in a wireless multi-hop network, and supports communication between nodes of different protocols. It is assumed that node A is a source node (ie, a sending node), and node B is a destination node (ie, a receiving node). The protocol run by A is the time slot ALOHA protocol, and the protocol run by node B is the carrier sense protocol of four handshakes.
节点A和节点B如果要实现通信,则需要:节点A将协议转换为节点B所运行的协议,也即双方都以载波侦听协议作为通信协议;或者节点B将协议转换为节点A所运行的协议,也即双方都以时隙ALOHA协议作为通信协议。If node A and node B want to achieve communication, it is necessary: node A converts the protocol to the protocol run by node B, that is, both parties use the carrier sense protocol as the communication protocol; or node B converts the protocol to the protocol run by node A protocol, that is, both parties use the slotted ALOHA protocol as the communication protocol.
请参考图3,为本发明一种节点通信方法的实施例一流程图。Please refer to FIG. 3 , which is a flowchart of Embodiment 1 of a node communication method according to the present invention.
在完成上述MAC协议生成方法实施例中的预处理步骤之后,进入以下步骤:After completing the preprocessing steps in the above-mentioned MAC protocol generation method embodiment, enter the following steps:
步骤S301、节点A获知节点B所运行的MAC协议为四握手的载波侦听协议。Step S301 , Node A learns that the MAC protocol run by Node B is a four-handshake carrier sense protocol.
步骤S302、节点A生成四握手的载波侦听协议。Step S302, Node A generates a carrier sense protocol for four handshakes.
节点A按照前文所述MAC协议生成方法生成四握手的载波侦听协议。Node A generates a four-handshake carrier sense protocol according to the MAC protocol generation method described above.
步骤S303、节点A和节点B以四握手的载波侦听协议为通信协议进行通信。Step S303, Node A and Node B communicate using the carrier sense protocol of the four handshakes as the communication protocol.
节点A获知节点B所运行的MAC协议的方式可以如下:The way for node A to know the MAC protocol run by node B can be as follows:
节点A通过空闲侦听,记录下该节点B所使用的协议版本号,这个版本号就说明了节点B的接入机制及消息交互过程,如表2所示。Node A records the protocol version number used by node B through idle listening. This version number describes the access mechanism and message interaction process of node B, as shown in Table 2.
表2 Table 2
其中,自定义参数为用户自行设置的,以单独的方式存储,如果是协议原配参数,则无需记录。Among them, the user-defined parameters are set by the user and stored in a separate manner. If they are original parameters of the protocol, there is no need to record them.
协议的版本号可以存储在一预设地址,其在数据结构中可以指明协议的运行规则,主要用于不同协间的互通和共存,协议版本号的编排方式以表3为例进行说明,本发明实施例中采用的是每个版本号由三位数字构成:The version number of the protocol can be stored in a preset address, which can indicate the operating rules of the protocol in the data structure, which is mainly used for the intercommunication and coexistence between different protocols. The arrangement of the protocol version number is described in Table 3 as an example. What is adopted in the embodiment of the invention is that each version number consists of three digits:
第一位:表示基本接入机制是什么,如TDMA、ALOHA、CSMA;The first digit: indicates what the basic access mechanism is, such as TDMA, ALOHA, CSMA;
第二位:表示同步协议或是异步协议,如时隙ALOHA、非时隙ALOHA;The second digit: indicates synchronous protocol or asynchronous protocol, such as slotted ALOHA, non-slotted ALOHA;
第三位:表示各扩展功能的选择。The third digit: Indicates the selection of each extended function.
表3 table 3
[0185] [0185]
需要说明的是,如果是ALOHA为发,CSMA为收,则只能是CSMA转为ALOHA。因为ALOHA不侦听,无法获知收节点的协议版本号。针对这种情况,本发明提供了另外一种实施例。It should be noted that if ALOHA is used for sending and CSMA is used for receiving, then only CSMA can be converted to ALOHA. Because ALOHA does not listen, it cannot know the protocol version number of the receiving node. For this situation, the present invention provides another embodiment.
请参考图4,为本发明一种节点通信方法的实施例二流程图。Please refer to FIG. 4 , which is a flowchart of Embodiment 2 of a node communication method according to the present invention.
在完成上述MAC协议生成方法实施例中的预处理步骤之后,进入以下步骤:After completing the preprocessing steps in the above-mentioned MAC protocol generation method embodiment, enter the following steps:
步骤S401、节点B获知节点A所运行的MAC协议为时隙ALOHA协议。Step S401, Node B learns that the MAC protocol run by Node A is the slotted ALOHA protocol.
步骤S402、节点B生成时隙ALOHA协议。Step S402, Node B generates a slotted ALOHA protocol.
节点B按照前文所述MAC协议生成方法生成时隙ALOHA协议。Node B generates the slotted ALOHA protocol according to the method for generating the MAC protocol described above.
步骤S403、节点A和节点B以时隙ALOHA协议为通信协议进行通信。Step S403, Node A and Node B communicate using the slotted ALOHA protocol as the communication protocol.
节点B获知节点A所运行协议的方式与前文所述节点A获取节点B所运行的协议的方法同理,通过空闲侦听,记录下该节点A所使用的协议版本号,根据该协议版本号确定节点A所运行的MAC协议。The way node B learns the protocol run by node A is the same as the way node A gets the protocol run by node B mentioned above. Through idle listening, it records the protocol version number used by node A. According to the protocol version number Determine the MAC protocol that node A is running.
需要说明的是,为了完成不同的控制功能,一种协议中往往需要定义多种不同的分组格式。此外,对于相同的控制指标描述的方式也会多种多样,比如NAV(network allocation vector,网络分配向量)可以用绝对时间也可以用时元来描述。在本发明中,通用的消息格式的定义必须充分考虑协议中可能用到的各种控制消息、及指标描述字段。It should be noted that, in order to accomplish different control functions, it is often necessary to define multiple different packet formats in one protocol. In addition, there are various ways to describe the same control index. For example, NAV (network allocation vector, network allocation vector) can be described by absolute time or epoch. In the present invention, the definition of the general message format must fully consider various control messages and index description fields that may be used in the protocol.
本发明实施例基于对MAC协议中常用的消息类型进行了总结,预先建立了基本消息库,以满足大多数情况下用户的需求,同时预留出通用扩展接口以供用户进行自定义。Based on the summary of commonly used message types in the MAC protocol, the embodiment of the present invention pre-establishes a basic message library to meet the needs of users in most cases, and reserves a general extension interface for users to customize.
图5示出了一种消息格式示意图。Fig. 5 shows a schematic diagram of a message format.
其中:in:
Ver-Num:协议版本号:每个协议版本号对应MIB中的一组参数。Ver-Num: protocol version number: each protocol version number corresponds to a set of parameters in the MIB.
S-ID:源节点地址。S-ID: source node address.
D-ID:目的节点地址。D-ID: destination node address.
P-Type:帧类型。P-Type: frame type.
P-Subtype:子帧类型。P-Subtype: subframe type.
NAV:网络分配向量,说明通信还将持续多长时间。NAV: Network Allocation Vector, indicating how long the communication will continue.
SDU-len:服务数据单元的长度。SDU-len: length of service data unit.
Ext-len:扩展控制字段长度。Ext-len: Extended control field length.
对应上述一种介质访问控制MAC协议生成方法实施例,本发明公开了一种介质访问控制生成装置。Corresponding to the above-mentioned embodiment of a method for generating a MAC protocol for media access control, the present invention discloses a device for generating media access control.
请参考图6,为本发明一种介质访问控制生成装置的实施例的结构示意图。Please refer to FIG. 6 , which is a schematic structural diagram of an embodiment of an apparatus for generating media access control according to the present invention.
本实施例包括:第一存储单元111、第二存储单元112、第一处理单元113和第二处理单元114。This embodiment includes: a
其中:in:
所述第一存储单元111用于存储基本接入机制标识及相应代码。The
所述第二存储单元112用于存储多种扩充功能标识及相应的代码,及与各扩充功能对应的可配置参数。The
所述第一处理单元113用于在用户根据目标MAC协议对可配置参数进行配置选择内容等于预设数据的配置参数对应的扩充功能标识。The
所述第二处理单元114用于对选择的扩充功能标识对应的代码按照所述可配置参数内容,与所述基本接入机制的代码一起进行加载、编译,生成所述目标MAC协议。The
具体的工作原理和过程在前文方法实施例部分已经详细描述过,在此不再赘述。The specific working principles and processes have been described in detail in the foregoing method embodiments, and will not be repeated here.
针对前文所述节点通信方法实施例,本发明公开了一种无线多跳网络,包含若干节点,所述节点包括介质访问控制MAC协议生成装置、MAC协议确定单元及通信单元。Aiming at the embodiment of the node communication method described above, the present invention discloses a wireless multi-hop network, which includes several nodes, and the nodes include a medium access control MAC protocol generation device, a MAC protocol determination unit and a communication unit.
所述MAC确定单元用于在通信单元与目标节点进行通信之前,确定该目标节点的MAC协议。The MAC determining unit is used to determine the MAC protocol of the target node before the communication unit communicates with the target node.
所述MAC协议生成装置,预先存储基本接入机制标识及相应代码,及多种扩充功能标识及相应的代码,及与各扩充功能对应的可配置参数,并在用户根据目标节点的MAC协议对可配置参数进行配置时,获取内容等于预设数据的配置参数对应的扩充功能标识,然后,对选择的扩充功能标识对应的代码按照所述可配置参数内容,与所述基本接入机制的代码一起进行加载、编译,生成所述目标节点的MAC协议。The MAC protocol generation device pre-stores the basic access mechanism identification and corresponding codes, various extended function identifications and corresponding codes, and configurable parameters corresponding to each extended function, and the user configures the MAC protocol according to the target node. When the configurable parameters are configured, the extended function identification corresponding to the configuration parameter whose content is equal to the preset data is obtained, and then the code corresponding to the selected extended function identification is matched with the code of the basic access mechanism according to the content of the configurable parameters. Load and compile together to generate the MAC protocol of the target node.
所述通信单元按照所述生成的MAC协议向目标节点发送数据,并接收该目标节点反馈的数据。The communication unit sends data to the target node according to the generated MAC protocol, and receives data fed back by the target node.
所述MAC协议生成装置的组成及工作过程在前文已经详细描述过,在此不再赘述。节点之间的通信过程在前文节点通信方法实施例部分也已经详细描述过,在此同样不再赘述。同样的,所述MAC协议确定单元确定节点MAC协议的过程在前文也已详细描述,在此也不做赘述。The composition and working process of the MAC protocol generation device have been described in detail above, and will not be repeated here. The communication process between nodes has also been described in detail in the foregoing part of the node communication method embodiment, and will not be repeated here. Similarly, the process of the MAC protocol determining unit determining the MAC protocol of the node has been described in detail above, and will not be repeated here.
本发明实施例以一种接入机制作为基本接入机制,将预先设置的可配置机制作为扩充部分。根据用户需求选择对扩充部分的机制进行配置,并与基本接入机制相结合,便可产生相应的协议。使用本发明实施例公开的MAC协议生成方法,可以根据需要生成相应的MAC协议,满足用户的多种需求,并且实现不同接入机制间的互通:比如网络中一部分节点采用的是ALOHA协议,另一部分节点采用CSMA协议,则这两部分的节点能够通过本发明公开的方案实现通信。In the embodiment of the present invention, an access mechanism is used as a basic access mechanism, and a preset configurable mechanism is used as an extended part. Select and configure the mechanism of the extension according to the user's needs, and combine it with the basic access mechanism to generate a corresponding protocol. Using the MAC protocol generation method disclosed in the embodiment of the present invention, the corresponding MAC protocol can be generated as required to meet the various needs of users, and realize the intercommunication between different access mechanisms: for example, some nodes in the network use the ALOHA protocol, and other If a part of the nodes adopts the CSMA protocol, the two parts of the nodes can communicate through the solution disclosed in the present invention.
本领域技术人员可以理解,可以使用许多不同的工艺和技术中的任意一种来表示信息、消息和信号。例如,上述说明中提到过的消息、信息都可以表示为电压、电流、电磁波、磁场或磁性粒子、光场或以上任意组合。Those of skill in the art would understand that information, messages and signals may be represented using any of a number of different technologies and technologies. For example, the messages and information mentioned in the above description can be expressed as voltage, current, electromagnetic wave, magnetic field or magnetic particles, light field or any combination of the above.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008100950653A CN101267439B (en) | 2008-04-28 | 2008-04-28 | Generation method, node communication method, device and system for medium access control protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008100950653A CN101267439B (en) | 2008-04-28 | 2008-04-28 | Generation method, node communication method, device and system for medium access control protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101267439A CN101267439A (en) | 2008-09-17 |
CN101267439B true CN101267439B (en) | 2010-12-22 |
Family
ID=39989575
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008100950653A Expired - Fee Related CN101267439B (en) | 2008-04-28 | 2008-04-28 | Generation method, node communication method, device and system for medium access control protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101267439B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8351362B2 (en) * | 2009-02-13 | 2013-01-08 | Qualcomm Incorporated | Methods and systems for broadcasting alert and synchronization |
CN103220355B (en) * | 2013-04-19 | 2017-03-15 | 网宿科技股份有限公司 | Multi-user configuration method in content distributing network |
CN103327641A (en) * | 2013-07-04 | 2013-09-25 | 广西中烟工业有限责任公司 | Wireless sensor network and wireless channel processing method |
US10511668B2 (en) * | 2016-10-07 | 2019-12-17 | Hyundai Motor Company | Method of transmitting and receiving data in vehicle network and apparatus for the same |
CN110113823A (en) * | 2019-05-15 | 2019-08-09 | 云南大学 | Enhance the wireless sensor network random multi-access channel method of adaptive load ability |
CN110557377B (en) * | 2019-08-01 | 2021-08-27 | 福建星云电子股份有限公司 | Method and system for power battery pairing repair equipment to be compatible with multiple communication protocols |
CN110932607A (en) * | 2019-12-20 | 2020-03-27 | 广西师范大学 | Distributed Synchronous Control Method of Multi-motor Network System |
CN114710412B (en) * | 2022-03-08 | 2024-04-12 | 中电科思仪科技股份有限公司 | Network protocol signal simulation system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1451219A (en) * | 2000-02-07 | 2003-10-22 | 高通股份有限公司 | Method and apparatus for providing configurable layers and protocols |
CN1556641A (en) * | 2004-01-01 | 2004-12-22 | 浙江大学 | Component-based Realization Method of Communication Protocol |
CN1627255A (en) * | 2003-12-10 | 2005-06-15 | 英业达股份有限公司 | Method and system for automatically generating modular customer-tailored software |
CN101026575A (en) * | 2007-03-27 | 2007-08-29 | 浪潮电子信息产业股份有限公司 | High available, high scalble modularized network server system structure |
-
2008
- 2008-04-28 CN CN2008100950653A patent/CN101267439B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1451219A (en) * | 2000-02-07 | 2003-10-22 | 高通股份有限公司 | Method and apparatus for providing configurable layers and protocols |
CN1627255A (en) * | 2003-12-10 | 2005-06-15 | 英业达股份有限公司 | Method and system for automatically generating modular customer-tailored software |
CN1556641A (en) * | 2004-01-01 | 2004-12-22 | 浙江大学 | Component-based Realization Method of Communication Protocol |
CN101026575A (en) * | 2007-03-27 | 2007-08-29 | 浪潮电子信息产业股份有限公司 | High available, high scalble modularized network server system structure |
Also Published As
Publication number | Publication date |
---|---|
CN101267439A (en) | 2008-09-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101267439B (en) | Generation method, node communication method, device and system for medium access control protocol | |
JP6974454B2 (en) | Data communication method and equipment | |
US8831519B2 (en) | Distributed multi-channel cognitive MAC protocol | |
US7715354B2 (en) | Method of beacon exchange between devices with asymmetric links and system using the method | |
CN102695287B (en) | A kind of VANET media access control method | |
JP4663708B2 (en) | System and method for enabling WUSB applications in distributed UWBMAC | |
US20110128900A1 (en) | Method of performing power save multi-poll (psmp) procedure wireless local access network system and station supporting the procedure | |
WO2013107398A1 (en) | Node grouping method, node, and access point | |
US20230345362A1 (en) | Method and device for low-power operation-based communication in communication system supporting multi-link | |
EP1530325B1 (en) | Method and device for managing a shared transmission medium | |
kumar Gupta et al. | Design and analysis of IEEE 802.11 based full duplex WLAN MAC protocol | |
CN118748582A (en) | Channel indication method and related device in wireless local area network | |
CN101600255A (en) | Channel selection access method for multi-channel wireless network | |
WO2021190492A1 (en) | Method and apparatus for associated access point device and storage medium | |
JP5213862B2 (en) | Wireless network | |
CN117395780A (en) | Dynamic time slot allocation method suitable for high dynamic self-organizing network and related equipment | |
US12232222B2 (en) | Gateway for use in wireless communication | |
Kosek-Szott et al. | A new busy signal-based MAC protocol supporting QoS for ad-hoc networks with hidden nodes | |
CN111417206B (en) | Information transmission method and network side equipment | |
CN106851853A (en) | For the Multiple access control method and control device of multi-hop network without center | |
WO2017036258A1 (en) | Contention access method, contention access device, base station and contention access system | |
CN103037537B (en) | Discovery process time delay optimization method of bluetooth device | |
CN106488411A (en) | The monitoring method of network-off direct-passing terminal resource conflict | |
Asuti et al. | An optimal clear channel assessment in IEEE 802.15. 4 medium access control protocol for recurrent data transmission and long acknowledgement wait period | |
CN101146338A (en) | Method and radio terminal for preventing from multicast lock and radio access point and communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20101222 Termination date: 20170428 |