[go: up one dir, main page]

CN110662182B - Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles - Google Patents

Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles Download PDF

Info

Publication number
CN110662182B
CN110662182B CN201910912214.9A CN201910912214A CN110662182B CN 110662182 B CN110662182 B CN 110662182B CN 201910912214 A CN201910912214 A CN 201910912214A CN 110662182 B CN110662182 B CN 110662182B
Authority
CN
China
Prior art keywords
node
cluster
stable
cluster head
neighbor
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.)
Active
Application number
CN201910912214.9A
Other languages
Chinese (zh)
Other versions
CN110662182A (en
Inventor
刘凯
张玥
曹先彬
张涛
肖振宇
谢晋东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201910912214.9A priority Critical patent/CN110662182B/en
Publication of CN110662182A publication Critical patent/CN110662182A/en
Application granted granted Critical
Publication of CN110662182B publication Critical patent/CN110662182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • H04W4/08User group management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/04Communication route or path selection, e.g. power-based or shortest path routing based on wireless node resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/248Connectivity information update
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/32Connectivity information management, e.g. connectivity discovery or connectivity update for defining a routing cluster membership

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例提供一种适合高动态大规模车联网的分簇方法、装置和设备,该方法包括:第一节点接收第二节点发送的通信消息;所述第一节点根据其自身更新后的邻居表中所有邻节点的信息,确定所有第一稳定节点;所述第一节点根据所有第一稳定节点的节点信息,计算所述第一节点的簇首代价;若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点会直接解散本簇或者选择一个准簇首成立新的簇。本申请实施例提供的方法能够克服现有的分簇方法产生簇结构稳定性差,簇分布不均匀,分簇开销大,节点之间通信可靠性不高的问题。

Figure 201910912214

Embodiments of the present application provide a clustering method, device, and device suitable for high-dynamic large-scale Internet of Vehicles. The method includes: a first node receives a communication message sent by a second node; the first node is updated according to its own The information of all neighboring nodes in the neighbor table determines all the first stable nodes; the first node calculates the cluster head cost of the first node according to the node information of all the first stable nodes; if the first node is a cluster The first node, and according to the cluster head cost of the first node, when it is determined that the first node meets the preset conditions for intra-cluster switching or the preset conditions for switching between clusters, the first node will Disband the current cluster directly or select a quasi-cluster head to form a new cluster. The method provided by the embodiment of the present application can overcome the problems of poor cluster structure stability, uneven cluster distribution, high clustering overhead, and low communication reliability between nodes caused by the existing clustering method.

Figure 201910912214

Description

适合高动态大规模车联网的分簇方法、装置和设备Clustering method, device and equipment suitable for high dynamic large-scale vehicle networking

技术领域technical field

本申请实施例涉及高动态大规模无线自组网技术领域,尤其涉及一种适合高动态大规模车联网的分簇方法、装置和设备。The embodiments of the present application relate to the technical field of high-dynamic large-scale wireless ad hoc networks, and in particular, to a clustering method, apparatus, and device suitable for high-dynamic large-scale vehicle networking.

背景技术Background technique

针对大规模高动态网络,扁平式网络(分布式结构)会造成严重的隐藏终端节点和信道竞争问题。由于没有一个中心单元作为协调者,数据包碰撞的概率会显著增加,由此会导致丢包率以及传输时延的增加。这种不利的效果在网络密度较大时会更加严重。针对这种情况基于基础设施的网络(集中式结构)相比于扁平式网络则有很大的优势,这是因为基础设施(Access Point,AP,接入点或者Road Side Unit,RSU,路边单元)能够以一种相对简单地方式对信道接入和网络资源的分布做出最优的调度。然而这需要在目的覆盖范围内应用有一定数量的基础设施,这将导致经济和基础设施安装的成本增加。为了实现基于基础设施类型网络的优势,分簇可作为一种替代技术产生层级的网络拓扑。For large-scale and highly dynamic networks, flat network (distributed structure) will cause serious hidden terminal nodes and channel contention problems. Since there is no central unit as the coordinator, the probability of packet collision will increase significantly, which will lead to increased packet loss rate and transmission delay. This adverse effect is exacerbated when the network density is higher. In this case, an infrastructure-based network (centralized structure) has great advantages over a flat network because the infrastructure (Access Point, AP, Access Point or Road Side Unit, RSU, roadside unit) can make optimal scheduling of channel access and distribution of network resources in a relatively simple manner. However, this requires a certain amount of infrastructure to be applied within the intended coverage area, which will lead to increased economic and infrastructure installation costs. To realize the advantages of infrastructure-based networks, clustering can be used as an alternative technique to generate hierarchical network topologies.

目前现存的分簇算法使用多种度量标准进行分簇算法的设计,比如位置,速度,方向,链路生存时间,节点的连通度,相对目的地、最终目的地、通信范围、相对移动性、链路质量、车辆密度、无线电功率等。在车联网中分簇算法是分簇算法的目的是对某些实现目标比如簇的稳定性,连通性,簇形成的速度,最小化开销等进行优化。其中最重要的目标为安全和紧急服务提供良好的体验质量,这与网络良好的连通性,通信的可靠性以及最大时延上界等紧密相关。通常在一个分簇算法中要综合运用多种度量标准对节点进行分簇,并且大部分分簇算法都是以增加簇结构的稳定性和生存时间为目的。通常分簇过程可以分为簇首选择,簇形成和簇维护三大部分。簇首选择允许节点以分布式或集中式地方式选择一个CH。CH主要用于管理本簇内的节点,维护本簇的簇结构。簇形成过程主要是建立CH和CMs之间的通信链路。通常一个稳定的簇要求CH和CMs之间具有稳定的链路。然而由于网络的动态特性,这些独立的链路可能会不可预测地产生和失效,使得高速移动节点之间通信的建立与维护变得困难起来。簇维护过程主要解决簇的再形成和节点重新加入簇的问题。如何选择一个CH以及节点如何形成特定的簇对于簇的稳定性有很大的影响。Existing clustering algorithms use a variety of metrics to design clustering algorithms, such as location, speed, direction, link lifetime, node connectivity, relative destination, final destination, communication range, relative mobility, Link quality, vehicle density, radio power, etc. In the Internet of Vehicles, the clustering algorithm is the purpose of the clustering algorithm to optimize certain realization goals, such as cluster stability, connectivity, speed of cluster formation, and minimizing overhead. One of the most important goals is to provide a good quality of experience for security and emergency services, which is closely related to good network connectivity, reliability of communication, and upper bound on maximum delay. Usually in a clustering algorithm, a variety of metrics are used to cluster nodes, and most of the clustering algorithms are aimed at increasing the stability and survival time of the cluster structure. Generally, the clustering process can be divided into three parts: cluster head selection, cluster formation and cluster maintenance. Cluster head selection allows nodes to select a CH in a distributed or centralized manner. The CH is mainly used to manage the nodes in the cluster and maintain the cluster structure of the cluster. The cluster formation process is mainly to establish the communication link between CH and CMs. Usually a stable cluster requires stable links between CHs and CMs. However, due to the dynamic nature of the network, these independent links may arise and fail unpredictably, making it difficult to establish and maintain communications between high-speed mobile nodes. The cluster maintenance process mainly solves the problem of cluster reformation and nodes rejoining the cluster. How a CH is chosen and how nodes form a particular cluster has a large impact on the stability of the cluster.

尽管分簇可以带来很大的优势,但是分簇也面临一些重要的挑战比如:节点的移动性,簇形成和维护的额外开销,以及信道衰落,信号遮挡等。其中对移动节点分簇最具有挑战性的问题是节点移动过程中对簇进行维护。由于节点的高移动性、拓扑的频繁变化以及无线信道的脆弱及时变特性,节点之间的通信链路连续会频繁断裂,所以分簇算法应该能够检测并对拓扑变化做出反应来维持适当的簇结构。在动态的网络环境下,簇的再配置和簇首变化是不可避免的,在网络内需要周期性地启动重新分簇的过程,这通常会导致稳定性较差的簇结构。所以应该尝试设计出一个簇首变化次数较少的分簇算法,提高簇结构的稳定性的同时还能够支持节点之间的可靠通信。此外还要求算法能够快速收敛,使得所有节点都尽可能快地加入到网络中去,尽可能地最小化分簇过程带来的控制开销和时间开销。Although clustering can bring great advantages, clustering also faces some important challenges such as: node mobility, additional overhead of cluster formation and maintenance, as well as channel fading, signal occlusion, etc. Among them, the most challenging problem of clustering mobile nodes is the maintenance of clusters during node movement. Due to the high mobility of nodes, frequent changes in topology, and the fragile and time-varying nature of wireless channels, the communication link between nodes will break frequently in succession, so clustering algorithms should be able to detect and react to topology changes to maintain appropriate cluster structure. In a dynamic network environment, cluster reconfiguration and cluster head changes are unavoidable, and the process of re-clustering needs to be started periodically in the network, which usually leads to a less stable cluster structure. Therefore, we should try to design a clustering algorithm with fewer cluster head changes, which can improve the stability of the cluster structure and support reliable communication between nodes. In addition, it is also required that the algorithm can converge quickly, so that all nodes can join the network as quickly as possible, and minimize the control overhead and time overhead brought by the clustering process as much as possible.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种适合高动态大规模车联网的分簇方法、装置和设备,以克服现有的适合高动态大规模车联网的分簇方法无法解决簇结构稳定性差,簇分布不均匀,分簇开销大,节点之间通信可靠性不高的问题。The embodiments of the present application provide a clustering method, device and equipment suitable for high-dynamic large-scale IoV, so as to overcome the inability of existing clustering methods suitable for high-dynamic large-scale IoV to solve the problem of poor cluster structure stability and uneven cluster distribution , the clustering overhead is high, and the communication reliability between nodes is not high.

第一方面,本申请实施例提供一种适合高动态大规模车联网的分簇方法,包括:In the first aspect, the embodiments of the present application provide a clustering method suitable for high-dynamic and large-scale Internet of Vehicles, including:

第一节点接收第二节点发送的通信消息,所述第一节点将所述通信消息更新到所述第一节点的邻居表中;The first node receives the communication message sent by the second node, and the first node updates the communication message to the neighbor table of the first node;

所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;The first node determines all stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node are the updated stable neighbor nodes. Nodes that are mutually stable neighbors with the first node in the neighbor table of the first node;

所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;The first node calculates the cluster head cost of the first node according to the node information of all stable neighbor nodes of the first node;

若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;If the first node is the cluster head node, and according to the cluster head cost of the first node, it is determined that the first node meets the preset conditions for intra-cluster head switching or the preset conditions for inter-cluster head switching , then the first node determines a cluster head node to be determined, and the first node dissolves the cluster where the first node is located, wherein a new cluster is established when the cluster head node to be determined satisfies the preset conditions for the establishment of a new cluster , and when the intra-cluster head switches or the inter-cluster head switches, the cluster head that establishes a new cluster is the node with the smallest cluster head generation value within the distance threshold range;

若所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值,则所述第一节点对所述第一节点所在簇的所有簇员发送解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;If the first node is the cluster head node, and the sum of the number of cluster members in the cluster where the first node is located and the number of target unclustered nodes in the updated neighbor table of the first node is less than the preset cluster Dissolution scale threshold, the first node sends a message of disbanding the cluster to all cluster members in the cluster where the first node is located, and the target unclustered node is an undistributed node that is a stable neighbor to the first node. cluster node;

若所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;If the first node is a cluster member node, and according to the cluster head cost of the first node, it is determined that the first node and the cluster head nodes in the cluster where the first node is located do not satisfy the requirement that they are mutually stable neighbors. When the condition of distance or angle is satisfied, the first node changes the cluster head node corresponding to the first node;

若所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点,则所述第一节点发送申请加入请求,用以申请加入所述目标簇首节点所在簇;If the first node is an unclustered node, and it is determined that the target cluster head node exists in the neighbor table of the first node, the first node sends an application join request to apply for joining the target cluster head node the cluster;

若所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点,则根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,若所述第一节点符合所述新簇成立的预设条件,则将所述第一节点作为新簇的簇首节点。If the first node is an unclustered node, and it is confirmed that the target cluster head node does not exist in the neighbor table of the first node, it is determined whether the first node satisfies the new requirements according to the neighbor table of the first node. The preset condition for the establishment of the cluster, if the first node meets the preset condition for the establishment of the new cluster, the first node is used as the cluster head node of the new cluster.

第二方面,本申请实施例提供一种适合高动态大规模车联网的分簇装置,包括:In a second aspect, an embodiment of the present application provides a clustering device suitable for high-dynamic and large-scale Internet of Vehicles, including:

邻居表更新模块,用于接收第二节点发送的通信消息,将所述通信消息更新到第一节点的邻居表中;a neighbor table update module, configured to receive a communication message sent by the second node, and update the communication message to the neighbor table of the first node;

稳定邻节点确定模块,用于根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;The stable neighbor node determination module is configured to determine all the stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node are the Nodes that are mutually stable neighbors with the first node in the updated neighbor table of the first node;

簇首代价计算模块,用于根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;a cluster head cost calculation module, configured to calculate the cluster head cost of the first node according to the node information of all stable neighbor nodes of the first node;

簇首切换模块,用于在所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;A cluster head switching module, configured to determine that the first node complies with the preset conditions for intra-cluster switching or inter-cluster switching according to the cluster head cost of the first node when the first node is the cluster head When the preset condition of the first switch is used, a cluster head node to be determined is determined, and the first node dissolves the cluster where the first node is located, wherein a new cluster is established when the cluster head node to be determined satisfies the preset conditions for the establishment of a new cluster When the cluster head is switched within the cluster or the cluster head is switched between the clusters, the cluster head of the new cluster is the node with the smallest cluster head generation value within the distance threshold range;

簇解散模块,用于在所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值时,对所述第一节点广播解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;A cluster disbanding module, configured to include the number of target unclustered nodes in the updated neighbor table of the first node when the first node is a cluster head node, and the number of cluster members of the cluster where the first node is located and the updated neighbor table of the first node When the sum is smaller than the preset cluster disbanding scale threshold, broadcast a message of disbanding the cluster to the first node, and the target unclustered node is an unclustered node that is a stable neighbor to the first node;

簇首变更模块,用于在所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;The cluster head change module is used to determine whether the first node is different from the cluster head node in the cluster where the first node is located according to the cluster head cost of the first node when the first node is a cluster member node. The first node changes the cluster head node corresponding to the first node when the condition of being a distance or an angle of mutually stable adjacent nodes is satisfied;

加入簇申请模块,用于在所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点时,发送申请加入请求,用以申请加入所述目标簇首节点所在簇;A cluster joining application module is used to send an application joining request to apply for joining the target cluster when the first node is an unclustered node and it is determined that the target cluster head node exists in the neighbor table of the first node The cluster where the first node is located;

新簇成立模块,用于在所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点时,根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,在所述第一节点符合所述新簇成立的预设条件时,将所述第一节点作为新簇的簇首节点。The new cluster establishment module is used to determine the first node according to the neighbor table of the first node when the first node is an unclustered node and it is confirmed that the target cluster head node does not exist in the neighbor table of the first node. Whether the first node satisfies the preset condition for the establishment of a new cluster, and when the first node meets the preset condition for the establishment of the new cluster, the first node is used as the cluster head node of the new cluster.

第三方面,本申请实施例提供一种水资源优化配置设备,包括:至少一个处理器和存储器;In a third aspect, an embodiment of the present application provides a device for optimal configuration of water resources, including: at least one processor and a memory;

所述存储器存储计算机执行指令;the memory stores computer-executable instructions;

所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面所述的适合高动态大规模车联网的分簇方法。The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the clustering method suitable for a high-dynamic large-scale Internet of Vehicles as described in the first aspect above.

本实施例提供的适合高动态大规模车联网的分簇方法、装置和设备,首先第一节点接收第二节点发送的通信消息,所述第一节点将所述通信消息更新到所述第一节点的邻居表中;所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;若所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值,则所述第一节点对所述第一节点所在簇的所有簇员发送解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;若所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;若所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点,则所述第一节点发送申请加入请求,用以申请加入所述目标簇首节点所在簇;若所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点,则根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,若所述第一节点符合所述新簇成立的预设条件,则将所述第一节点作为新簇的簇首节点,进而提高分簇结构的连通性和稳定性,由于稳定性的提高,避免切换时间和次数,进而节约时间和资源,解决了簇结构稳定性差,簇分布不均匀,分簇开销大,节点之间通信可靠性不高的问题。In the clustering method, device, and device suitable for high-dynamic and large-scale vehicle networking provided by this embodiment, first, a first node receives a communication message sent by a second node, and the first node updates the communication message to the first node. In the neighbor table of the node; the first node determines all the stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node is a node that is a stable neighbor to the first node in the updated neighbor table of the first node; the first node calculates the first node according to the node information of all stable neighbor nodes of the first node. The cluster head cost of a node; if the first node is the cluster head node, and according to the cluster head cost of the first node, it is determined that the first node complies with the preset conditions for intra-cluster head switching or inter-cluster cluster head switching When the preset condition of the first switch is used, the first node determines a cluster head node to be determined, and the first node disbands the cluster where the first node is located, wherein the cluster head node to be determined satisfies the pre-determination for the establishment of a new cluster. When the conditions are set, a new cluster is established, and when the intra-cluster head is switched or the cluster head is switched between clusters, the cluster head of the new cluster is the node with the smallest cluster head generation value within the distance threshold; if the first node is the cluster head node, and the sum of the number of cluster members in the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node is less than the preset cluster dissolution scale threshold, then the The first node sends a message of disbanding the cluster to all cluster members in the cluster where the first node is located, and the target unclustered node is an unclustered node that is a stable neighbor to the first node; if the The first node is a cluster member node, and according to the cluster head cost of the first node, it is determined that the first node and the cluster head node in the cluster where the first node is located do not satisfy the distance or angle of mutually stable neighbor nodes When the conditions are met, the first node changes the cluster head node corresponding to the first node; if the first node is an unclustered node, and it is determined that the target cluster head node exists in the neighbor table of the first node, Then the first node sends an application join request to apply for joining the cluster where the target cluster head node is located; if the first node is an unclustered node, and confirms that there is no target in the neighbor table of the first node The cluster head node, according to the neighbor table of the first node, to determine whether the first node meets the preset conditions for the establishment of a new cluster, and if the first node meets the preset conditions for the establishment of the new cluster, then The first node is used as the cluster head node of the new cluster, thereby improving the connectivity and stability of the cluster structure. Due to the improvement of stability, switching time and times are avoided, thereby saving time and resources, and solving the problem of poor cluster structure stability. The cluster distribution is uneven, the clustering overhead is high, and the communication reliability between nodes is not high.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present application, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本申请实施例提供的适合高动态大规模车联网的分簇方法的流程示意图;1 is a schematic flowchart of a clustering method suitable for high dynamic large-scale Internet of Vehicles provided by an embodiment of the present application;

图2为本申请再一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图;FIG. 2 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale Internet of Vehicles provided by yet another embodiment of the present application;

图3为本申请另一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图;3 is a schematic flowchart of a clustering method suitable for highly dynamic large-scale Internet of Vehicles provided by another embodiment of the present application;

图4为本申请又一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图;4 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale Internet of Vehicles provided by another embodiment of the present application;

图5为本申请实施例提供的适合高动态大规模车联网的分簇装置的结构示意图;5 is a schematic structural diagram of a clustering device suitable for a high-dynamic large-scale Internet of Vehicles provided by an embodiment of the present application;

图6为本申请实施例提供的适合高动态大规模车联网的分簇设备的结构示意图。FIG. 6 is a schematic structural diagram of a clustering device suitable for a high-dynamic large-scale Internet of Vehicles provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例,例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to Describe a particular order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the application described herein, for example, can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

本申请实施例提供一种适合高动态大规模车联网的分簇方法,为了解决上述问题,综合考虑了多种分簇度量标准,在簇形成的时候运用方向,距离,速度,连接时间等因素,使得只有移动方向相近,距离小于阈值,稳定连接时间大于阈值的节点才会被划分到一个簇中,避免将连接时间短的节点加入簇后又马上离开簇的情形,同时距离阈值的限制一定程度上能够维护链路的有效性,使分簇算法适用于复杂多变的无线信道环境,提高分簇结构的连通性和稳定性。The embodiment of the present application provides a clustering method suitable for high-dynamic and large-scale IoV. In order to solve the above problems, a variety of clustering metrics are comprehensively considered, and factors such as direction, distance, speed, and connection time are used when clusters are formed. , so that only nodes with similar moving directions, distances less than the threshold, and stable connection time greater than the threshold will be divided into a cluster, avoiding the situation where nodes with short connection time are added to the cluster and then immediately leave the cluster, and the distance threshold is limited. To a certain extent, it can maintain the validity of the link, make the clustering algorithm suitable for the complex and changeable wireless channel environment, and improve the connectivity and stability of the clustering structure.

图1为本申请实施例提供的适合高动态大规模车联网的分簇方法的流程示意图,本实施例的执行主体可以为作为第一节点的装置、设备,本实施例此处对执行主体不做限定。FIG. 1 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale Internet of Vehicles provided by an embodiment of the present application. The execution body of this embodiment may be a device or equipment serving as a first node, and the execution body of this embodiment is not described here. Do limit.

参见图1,所述适合高动态大规模车联网的分簇方法,包括:Referring to Fig. 1, the described clustering method suitable for high dynamic large-scale Internet of Vehicles includes:

S101、第一节点接收第二节点发送的通信消息,所述第一节点将所述通信消息更新到所述第一节点的邻居表中,所述邻居表中包含至少一个与所述邻居表对应的节点互为邻节点的节点信息。S101. A first node receives a communication message sent by a second node, and the first node updates the communication message to a neighbor table of the first node, where the neighbor table includes at least one node corresponding to the neighbor table The nodes are the node information of each other's neighbor nodes.

本实施例中,第一节点和第二节点均可以为车联网形成的网络中移动节点的任一节点,比如,第一节点和第二节点均可以为车辆节点,其中第一节点可以工作在以下任一状态:未分簇状态(Undecided Node,UN):所有节点的初始状态,表示节点不属于任何簇,也未成功加入到任何簇;簇成员状态(Cluster Member,CM):已经加入到一个簇中,并能够直接与簇首进行通信,任何一个节点只属于一个簇;簇首状态(Cluster Head,CH):簇的管理者,能够与所有的本簇内所有的簇成员进行一跳通信。因此,所述第一节点可以为簇首节点、簇员节点以及未分簇节点中任一节点。In this embodiment, both the first node and the second node may be any node of the mobile node in the network formed by the Internet of Vehicles. For example, both the first node and the second node may be vehicle nodes, and the first node may work in the following Any state: Undecided Node (UN): the initial state of all nodes, indicating that the node does not belong to any cluster and has not successfully joined any cluster; Cluster Member (CM): has joined a cluster In the cluster, and can communicate directly with the cluster head, any node belongs to only one cluster; Cluster Head state (Cluster Head, CH): The manager of the cluster can communicate with all the cluster members in the cluster in one hop . Therefore, the first node may be any one of a cluster head node, a cluster member node, and an unclustered node.

其中,第一节点周期性地不断广播消息,同时也在不断地接收其他节点广播的消息即通信消息。每个节点都有自身的邻居表,邻居表中可能为空也可能存储有与自身互为邻节点的节点信息,若第一节点接收到所述第二节点发送的通信消息即表明所述第一节点和所述第二节点互为邻节点,则将所述第二节点的节点信息添加或更新至所述第一节点的邻居表中。具体地,所述第一节点周期性检测自己的邻居表时,更新并删除失效的邻居表条目。如果第一节点发现已经连续三个HELLO周期间隔没有收到第二节点的任何消息时,第一节点会认为第二节点与自身不再互为邻节点,且会从邻居表中删除第二节点的相关条目。Wherein, the first node continuously broadcasts messages periodically, and also continuously receives messages broadcasted by other nodes, that is, communication messages. Each node has its own neighbor table. The neighbor table may be empty or may store information about nodes that are neighbors to itself. If the first node receives the communication message sent by the second node, it indicates that the first node If a node and the second node are adjacent nodes to each other, the node information of the second node is added or updated to the neighbor table of the first node. Specifically, when the first node periodically detects its own neighbor table, it updates and deletes invalid neighbor table entries. If the first node finds that it has not received any message from the second node for three consecutive HELLO period intervals, the first node will consider that the second node and itself are no longer neighbors, and will delete the second node from the neighbor table. related articles.

S102、所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所有第一稳定节点,所述第一稳定节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定节点的节点。S102. The first node determines all first stable nodes according to the node information of all neighboring nodes in the updated neighbor table of the first node, where the first stable node is the updated neighbor table of the first node A node that is mutually stable with the first node.

本实施例中,在一个簇中,规定UN节点在加入簇的时候与CH必须满足互为稳定邻节点的条件,CH与本簇内所有的CM都必须满足互为稳定邻节点中的方向和距离者两个限制条件,但同簇内的CM节点之间则无条件要求。其中稳定邻节点的定义如下所示:如果节点i和节点j之间的距离Di,j小于一定的阈值Dth,两个节点之间的相对移动方向|Δθi,j|小于一定的阈值θth,稳定连接时间SLTi,j大于或等于一定的阈值Tth,则节点i和节点j则互为稳定邻节点。In this embodiment, in a cluster, it is stipulated that the UN node and the CH must satisfy the condition of being mutually stable neighbors when joining the cluster, and the CH and all CMs in this cluster must satisfy the direction and the direction in the mutually stable neighbors. There are two constraints on the distance, but there is an unconditional requirement between CM nodes in the same cluster. The definition of stable neighbor nodes is as follows: if the distance D i, j between node i and node j is less than a certain threshold D th , the relative movement direction |Δθ i,j | between the two nodes is less than a certain threshold θ th , the stable connection time SLT i,j is greater than or equal to a certain threshold T th , then node i and node j are stable neighbors to each other.

其中,Dth=DistanceThreshold=R*DistanceThresholdcoeffWherein, D th =DistanceThreshold=R*DistanceThresholdcoeff

R=TransmissonRangeR=TransmissonRange

Vth=Speed Threshold=5V th = Speed Threshold = 5

θth=Angle Threshold=π/2θ th =Angle Threshold=π/2

Tth=Time Threshold=(R-Dth)/Vth T th =Time Threshold=(RD th )/V th

步骤S103、所述第一节点根据所有第一稳定节点的节点信息,计算所述第一节点的簇首代价。Step S103, the first node calculates the cluster head cost of the first node according to the node information of all the first stable nodes.

其中,在所述计算所述第一节点的簇首代价之后,还包括:Wherein, after the calculating the cluster head cost of the first node, the method further includes:

若所述第一节点为簇首节点,则所述第一节点获取所述第一节点所在簇的簇成员数目以及所述更新后的第一节点的邻居表中含有目标未分簇节点的数目。本实施例中,通过用簇首代价CL(Cost Level)来衡量一个节点被选为CH的差距,这个值越小表示节点成为CH的资格越高越有能力承担CH的角色,同时被选择为CH的概率就越大。在选择CH时总是选择具有最小CL值的节点。If the first node is the cluster head node, the first node obtains the number of cluster members of the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node . In this embodiment, the cluster head cost CL (Cost Level) is used to measure the gap between a node being selected as CH. The smaller the value is, the higher the qualification of the node to become CH is, the more capable it is to assume the role of CH. At the same time, it is selected as The greater the probability of CH. When choosing CH always choose the node with the smallest CL value.

其中,下表显示的是在分簇过程中节点间传输的消息,除了业务数据包之外,其他数据包均为在网络层传输的分簇控制数据包。Among them, the following table shows the messages transmitted between nodes during the clustering process. Except for the service data packets, other data packets are the clustering control data packets transmitted at the network layer.

Figure BDA0002215034060000091
Figure BDA0002215034060000091

S104、若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点。S104. If the first node is a cluster head node, and according to the cluster head cost of the first node, determine that the first node complies with a preset condition for intra-cluster head switching or a preset condition for inter-cluster head switching condition, the first node determines a to-be-determined cluster head node, and the first node disbands the cluster where the first node is located, wherein a new cluster is established when the to-be-determined cluster head node satisfies the preset conditions for the establishment of a new cluster. When the cluster head is switched within the cluster or the cluster head is switched between the clusters, the cluster head of the new cluster is the node with the smallest cluster head generation value within the distance threshold range.

本实施例中,簇内簇首切换指的是当CH不再是一个最优的CH时,它会将CH的角色授予给一个本簇内的一个CM节点。为了避免频繁的簇首切换,在本实施例中,只有本簇CH的CL值排名不在本簇前1/4范围之内时,才进行簇内簇首切换。In this embodiment, the intra-cluster head handover refers to that when the CH is no longer an optimal CH, it will grant the role of the CH to a CM node in a local cluster. In order to avoid frequent cluster head switching, in this embodiment, the intra-cluster head switching is performed only when the CL value ranking of the CH of the current cluster is not within the top 1/4 range of the current cluster.

其中,节点加入簇或者是离开簇时都会导致簇规模的变化以及CH的CL值在簇内的排名变化。所以当簇规模变化的时候就要检测是否要发生簇内簇首切换。而即使簇规模不发生变化也可能会导致CH的CL值在簇内的排名变化。所以在本实施例中设置节点会在BEAT消息到达时,周期地进行是否发生簇内簇首切换的检测。Among them, when a node joins a cluster or leaves a cluster, it will cause the change of the cluster size and the change of the CL value of CH in the ranking of the cluster. Therefore, when the cluster size changes, it is necessary to detect whether the cluster head switch within the cluster occurs. And even if the cluster size does not change, it may cause the CL value of CH to change in the ranking of the cluster. Therefore, in this embodiment, when the BEAT message arrives, the node is set to periodically detect whether the intra-cluster switch of the cluster head occurs.

具体地,在检测是否需要进行簇内簇首切换时首先要判断该簇是否满足簇自杀的条件即CH当前的簇规模和其稳定邻节点中UN节点的数量这两者之和小于二分之一的簇规模阈值1/2*ClusterSizeThreshold(即预设簇规模阈值)。如果满足簇自杀的条件,CH就会解散该簇。否则CH会继续判断是否要进行簇内簇首切换。CH节点会在邻居表中遍历所有的CM成员,得到CM成员的CL值,统计CL值比自身小的CM节点数m,并记录具有最小CL值的CM成员。如果满足以下公式则发生簇内簇首切换,即簇内簇首切换的预设条件为:m>*RankThresholdcoeff*CurrentClusterSize。这里RankThresholdcoeff=1/4。Specifically, when detecting whether the intra-cluster head switch needs to be performed, it is first necessary to judge whether the cluster satisfies the condition of cluster suicide, that is, the sum of the current cluster size of CH and the number of UN nodes in its stable neighbors is less than half A cluster size threshold of 1/2*ClusterSizeThreshold (ie, the preset cluster size threshold). If the conditions for cluster suicide are met, CH dissolves the cluster. Otherwise, the CH will continue to judge whether to perform intra-cluster head handover. The CH node traverses all CM members in the neighbor table, obtains the CL value of the CM member, counts the number m of CM nodes whose CL value is smaller than its own, and records the CM member with the smallest CL value. If the following formula is satisfied, intra-cluster head switching occurs, that is, the preset condition for intra-cluster head switching is: m>*RankThresholdcoeff*CurrentClusterSize. Here RankThresholdcoeff=1/4.

这时选出的这个具有最小CL值的CM会成为准CH(QCH)。之后CH会转变为UN状态,将这个QCH的Id信息存储在目标簇首Id这一字段中并发送一个CH_HANDOVER消息向周围节点广播QCH的信息。所有接收到CH_HANDOVER消息的原簇的CM成员会将自己的状态变为UN,进入UN节点的初始化加入簇的流程。而对于QCH节点在接收到CH_HANDOVER消息后将自己的状态变更为CH,并发送一个CH_ANNOUNCE消息,等待其他节点加入本簇中。The CM selected at this time with the smallest CL value becomes the quasi-CH (QCH). After that, the CH will change to the UN state, store the Id information of the QCH in the Id field of the target cluster head, and send a CH_HANDOVER message to broadcast the QCH information to the surrounding nodes. All CM members of the original cluster that receive the CH_HANDOVER message will change their status to UN and enter the process of initializing the UN node to join the cluster. For the QCH node, after receiving the CH_HANDOVER message, it changes its state to CH, and sends a CH_ANNOUNCE message, waiting for other nodes to join the cluster.

另外,簇间簇首切换可以认为是簇融合,簇融合指的是两个簇合发生较大程度的重叠的现象。在所述第一节点符合簇间簇首切换的预设条件时,CH会进行簇间簇首切换操作促使两个簇合并成一个簇。这里可以简单地将簇融合等价为簇间簇首切换。节点进行簇间簇首切换也就是簇融合的流程。如果CH的邻居表中检测到的CH节点与节点同向行驶且两个CH处于互相靠近的状态,则有可能发生簇融合。这里的互相靠近指的是当检测到的CH节点在自己前方且行驶速度比自己小,或者检测到的CH节点在自己后方且行驶速度比自己大,也就是说当两个CH互为邻节点且一个CH可能会追上另一个CH的情况。但是只有当CH节点检测到与另一个CH节点同向行驶且二者之间的距离小于阈值时才必须要进行簇融合。然而在进行簇融合之前,CH会先判断是否要满足簇自杀的条件,如果满足自杀的条件则会解散该簇,不再进行簇融合。如果不满足簇自杀条件这时CH会从在两个CH以及在两个簇重叠区内的节点集合中选择一个具有最小CL值的节点。每个CH都会遍历自己的邻居表,试图从表中寻找一个距离两个CH都小于Dth且具有最小CL值的节点,然后将这个最小的CL值与两个CH的CL值进行比较,确定一个最佳的准CH(QCH)节点。由于满足条件的节点一定同时存在于两个CH的邻居表中,所以两个CH选择的QCH节点一定是同一个节点。In addition, the switching of cluster heads between clusters can be considered as cluster fusion, and cluster fusion refers to the phenomenon that two clusters overlap to a large extent. When the first node meets the preset condition for switching between cluster heads among clusters, the CH will perform an operation of switching between cluster heads among clusters to cause two clusters to be merged into one cluster. Here, cluster fusion can be simply equivalent to switching between cluster heads. Nodes perform cluster head switching between clusters, which is the process of cluster fusion. If the CH node detected in the CH neighbor table and the node travel in the same direction and the two CHs are in a state of being close to each other, cluster fusion may occur. The mutual proximity here refers to when the detected CH node is in front of you and the driving speed is lower than yourself, or the detected CH node is behind you and the driving speed is higher than yourself, that is to say, when two CH nodes are adjacent nodes to each other And one CH may catch up with another CH. However, cluster fusion is only necessary when a CH node detects that it is traveling in the same direction as another CH node and the distance between them is less than a threshold. However, before performing cluster fusion, CH will first determine whether the conditions for cluster suicide are satisfied, and if the conditions for suicide are satisfied, the cluster will be dissolved and no cluster fusion will be performed. If the cluster suicide condition is not met, then the CH will select a node with the smallest CL value from the node sets in the two CHs and in the overlapping area of the two clusters. Each CH will traverse its own neighbor table, trying to find a node from the table that is less than Dth from both CHs and has the smallest CL value, and then compares this smallest CL value with the CL values of the two CHs to determine a node. The best quasi-CH (QCH) node. Since the nodes that satisfy the conditions must exist in the neighbor tables of the two CHs at the same time, the QCH nodes selected by the two CHs must be the same node.

如果QCH为两个CH中的某一个则该CH保持CH状态不变,另一个CH会变为UN状态并发送CH_DISSOLUTION消息。如果QCH为某个CH的CM成员,则这个CH变为UN状态并发送CH_HANDOVER消息,这时在这个簇内发生的簇融合等同于簇内簇首切换。而另一个CH则会变为UN状态并发送CH_DISSOLUTION消息解散该簇。如果QCH为UN节点,那么这两个CH都将变为UN状态并发送CH_DISSOLUTION消息解散该簇。If the QCH is one of the two CHs, the CH remains in the CH state, and the other CH changes to the UN state and sends a CH_DISSOLUTION message. If the QCH is a CM member of a certain CH, the CH changes to the UN state and sends a CH_HANDOVER message. At this time, the cluster fusion in this cluster is equivalent to the intra-cluster head handover. The other CH will change to the UN state and send the CH_DISSOLUTION message to dissolve the cluster. If the QCH is a UN node, then both CHs will change to the UN state and send the CH_DISSOLUTION message to dissolve the cluster.

其中,发生簇融合的主要分为三种情形:Among them, cluster fusion occurs mainly in three cases:

1)如果QCH为两个CH中的某一个,则该CH保持CH状态不变,另一个CH会变为UN状态并发送CH_DISSOLUTION消息;1) If the QCH is one of the two CHs, the CH remains in the CH state, and the other CH changes to the UN state and sends a CH_DISSOLUTION message;

2)如果QCH为某个CH的CM成员,则这个CH变为UN状态并发送CH_HANDOVER消息,这时在这个簇内发生的簇融合等同于簇内簇首切换。而另一个CH则会变为UN状态并发送CH_DISSOLUTION消息解散该簇;2) If the QCH is a CM member of a certain CH, the CH changes to the UN state and sends a CH_HANDOVER message. At this time, the cluster fusion in this cluster is equivalent to the intra-cluster head handover. The other CH will change to the UN state and send the CH_DISSOLUTION message to dissolve the cluster;

3)如果QCH为UN节点,那么这两个CH都将变为UN状态并发送CH_DISSOLUTION消息解散该簇。3) If the QCH is a UN node, then both CHs will become UN state and send the CH_DISSOLUTION message to dissolve the cluster.

本实施例中,第一节点通过更新和维护自身的邻居表,进一步地确定第一节点的邻居表中与所述第一节点互为稳定节点的第一稳定节点,然后计算第一节点的簇首代价,且在所述第一节点为簇首节点时,进而确定第一节点是否需要切换,即所述第一节点是否符合簇内簇首切换的预设条件或簇间簇首切换的预设条件,若符合,则确定所述第一节点所在簇对应的新簇首节点,并将所述新簇首节点切换成所述第一节点所在簇的簇首节点,进而提高分簇结构的连通性和稳定性,同时由于稳定性的提高,避免切换时间和次数,进而节约时间和资源,解决了簇结构稳定性差,簇分布不均匀,分簇开销大,节点之间通信可靠性不高的问题。In this embodiment, by updating and maintaining its own neighbor table, the first node further determines the first stable node in the neighbor table of the first node that is mutually stable with the first node, and then calculates the cluster of the first node. When the first node is the cluster head node, it is further determined whether the first node needs to be switched, that is, whether the first node complies with the preset conditions for intra-cluster switch head switching or the pre-set conditions for inter-cluster cluster head switching. If the conditions are met, the new cluster head node corresponding to the cluster where the first node is located is determined, and the new cluster head node is switched to the cluster head node of the cluster where the first node is located, thereby improving the clustering structure. Connectivity and stability, at the same time, due to the improvement of stability, it avoids switching time and times, thereby saving time and resources, solving the problem of poor cluster structure stability, uneven cluster distribution, high clustering overhead, and low communication reliability between nodes. The problem.

S105、若所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值,则所述第一节点对所述第一节点所在簇的所有簇员发送解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点。在实际应用中,发生簇解散的情况有三种,分别对应三种簇死亡的情形:第一种情况是小规模簇的解散。如果所述第一节点为簇首节点,该CH当前的簇规模和CH节点周围稳定邻居中UN节点的数量这两者之和小于簇规模阈值的一半1/2*ClusterSizeThreshold这时会发生簇解散。由于成员流失而进行簇解散的簇死亡类型为簇自杀(CD_Drain);S105. If the first node is a cluster head node, and the sum of the number of cluster members in the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node is less than a predetermined number Set the threshold of cluster disbanding scale, then the first node sends a message of disbanding the cluster to all cluster members in the cluster where the first node is located, and the target non-clustered node is a stable neighbor node with the first node. Unclustered nodes. In practical applications, there are three situations of cluster disbanding, corresponding to three situations of cluster death: the first situation is the disbanding of small-scale clusters. If the first node is the cluster head node, the sum of the current cluster size of the CH and the number of UN nodes in the stable neighbors around the CH node is less than half of the cluster size threshold 1/2*ClusterSizeThreshold. At this time, cluster dissolution will occur. . The cluster death type of cluster dissolution due to the loss of members is cluster suicide (CD_Drain);

第二种情况是发生簇内簇首切换的簇解散。这时虽然不满足簇自杀的条件,但是CH的CL值在本簇内的排名不在前1/4的范围内,这表示当前的CH已经不再是最优CH了。这时要发生簇内的簇首切换,而进行簇首切换时必须先解散原来的簇。由于成员继任而进行的簇解散的簇死亡类型为簇校正(CD_Succession)。The second case is that the cluster in which the intra-cluster head switch occurs is disbanded. At this time, although the condition of cluster suicide is not met, the CL value of CH is not in the top 1/4 range in the current cluster, which means that the current CH is no longer the optimal CH. At this time, the cluster head switch in the cluster will occur, and the original cluster must be dissolved first when the cluster head switch is performed. The cluster death type of cluster dissolution due to member succession is cluster correction (CD_Succession).

第三种情况是发生簇融合时候的簇解散。当一个CH检测到另一个CH的存在时即两个CH变为一跳邻节点的时候就可能会发生簇融合。为了尽可能避免不必要的簇融合,所以即使当两个CH节点互为邻节点也未必发生簇融合。而只有当两个CH满足互为稳定邻节点中的方向和距离两个条件的时候才会发生簇融合。这时候两个簇会融合变成一个簇,这时至少会解散一个簇所以会发生簇解散,由于簇融合而解散簇的簇死亡类型为簇重组(CD_Recombination)。The third case is cluster dissolution when cluster fusion occurs. Cluster fusion may occur when one CH detects the existence of another CH, that is, when the two CHs become one-hop neighbors. In order to avoid unnecessary cluster fusion as much as possible, cluster fusion does not necessarily occur even when two CH nodes are adjacent to each other. Cluster fusion occurs only when two CHs satisfy the two conditions of direction and distance in mutually stable neighbor nodes. At this time, the two clusters will merge into one cluster, and at least one cluster will be dissolved at this time, so cluster dissolution will occur. The cluster death type of the dissolved cluster due to cluster fusion is CD_Recombination.

S106、若所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点。S106. If the first node is a cluster member node, and according to the cluster head cost of the first node, it is determined that the first node and the cluster head node in the cluster where the first node is located do not satisfy each other as stable neighbors When the condition of the distance or angle of the nodes is satisfied, the first node changes the cluster head node corresponding to the first node.

本实施例中,所述第一节点变更所述第一节点对应的簇首节点的过程与所述第一节点申请加入一个新簇的过程类似。In this embodiment, the process for the first node to change the cluster head node corresponding to the first node is similar to the process for the first node to apply for joining a new cluster.

具体地,所述第一节点变更所述第一节点对应的簇首节点,即第一节节点离开所述第一节点所在簇。其中,节点离开簇的情况通常是指CM节点离开簇,这时可以分为主动离开及被动离开两种情况。Specifically, the first node changes the cluster head node corresponding to the first node, that is, the first node node leaves the cluster where the first node is located. Among them, the situation that the node leaves the cluster usually means that the CM node leaves the cluster. At this time, it can be divided into two situations: active leaving and passive leaving.

主动离开簇通常针对的是CM节点,指的是CM节点接收到自己CH的HELLO消息时,检测到CH与自身已不满足互为稳定邻节点中的方向或者距离阈值条件。这时,CM节点会将自己的状态变为UN,主动向CH节点发送一个LEAVE消息告知自己的CH。CH在接收到本簇CM节点的LEAVE消息后会将此CM节点从簇成员集合ClusterMemberSet中删除该节点,同时更新本簇当前的簇规模。Actively leaving the cluster is usually aimed at the CM node, which means that when the CM node receives the HELLO message of its own CH, it detects that the CH and itself do not meet the direction or distance threshold conditions in the mutually stable neighbor nodes. At this time, the CM node will change its status to UN, and actively send a LEAVE message to the CH node to inform its CH. After the CH receives the LEAVE message from the CM node of the cluster, it will delete the CM node from the cluster member set ClusterMemberSet, and at the same time update the current cluster size of the cluster.

CM节点被动离开簇分为两种情况:一种是在删除失效的邻居表实体时发现已经连续三个HELLO周期间隔没有收到CH节点的任何消息,这表明CH到CM之间的链路已经失效。在这种情况下CM节点会认为已经与CH断开了联系,此时CM节点仍然会发送一个LEAVE消息告知自己的CH(因为CM节点虽然没有收到CH的消息,但是CH可能依然能收到CM的消息)。另一种可能出现的情况是CM节点接收到来自CH的消息但是此时自己的CH节点已经不再是CH状态。比如CM节点接收到了自己CH的JOIN消息。此时CM节点不会发送LEAVE消息,它会直接变更到UN状态,进入到UN节点初始化加入簇的过程。There are two cases when the CM node leaves the cluster passively: one is when it deletes the invalid neighbor table entity and finds that it has not received any messages from the CH node for three consecutive HELLO period intervals, which indicates that the link between the CH and the CM has invalid. In this case, the CM node will think that it has disconnected from the CH, and the CM node will still send a LEAVE message to inform its CH (because the CM node has not received the CH message, but the CH may still receive it. CM's message). Another possible situation is that the CM node receives the message from the CH but its own CH node is no longer in the CH state. For example, the CM node receives the JOIN message of its own CH. At this time, the CM node will not send a LEAVE message, it will directly change to the UN state, and enter the process of the UN node initializing and joining the cluster.

如果CH接收到CM的消息发现自身与CM成员已不满足互为稳定邻节点中的方向或者距离阈值条件。或者是在删除失效的邻居表条目时发现已经连续三个HELLO周期间隔没有收到CM节点的任何消息时,在这两种情况下CH都会认为CM已经离开了本簇。此时CH节点会将CM节点从ClusterMemberSet中删除该节点,同时更新本簇当前的簇规模。If the CH receives the message from the CM and finds that it and the CM members have not satisfied the direction or distance threshold condition in the mutually stable neighbor nodes. Or when deleting the invalid neighbor table entry, it is found that it has not received any message from the CM node for three consecutive HELLO period intervals. In both cases, the CH will consider that the CM has left the cluster. At this time, the CH node will delete the CM node from the ClusterMemberSet and update the current cluster size of the cluster.

S107、若所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点,则所述第一节点发送申请加入请求,用以申请加入所述目标簇首节点所在簇;S107. If the first node is an unclustered node, and it is determined that a target cluster head node exists in the neighbor table of the first node, the first node sends an application for joining request to apply for joining the target cluster The cluster where the first node is located;

S108、若所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点,则根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,若所述第一节点符合所述新簇成立的预设条件,则将所述第一节点作为新簇的簇首节点。S108. If the first node is an unclustered node, and it is confirmed that the target cluster head node does not exist in the neighbor table of the first node, determine whether the first node is not based on the neighbor table of the first node The preset conditions for the establishment of the new cluster are met, and if the first node meets the preset conditions for the establishment of the new cluster, the first node is used as the cluster head node of the new cluster.

其中,在所述根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件之后,还包括:Wherein, after determining, according to the neighbor table of the first node, whether the first node satisfies the preset condition for establishing a new cluster, the method further includes:

若所述第一节点不满足所述新簇成立的预设条件,则所述第一节点广播信标,等待加入与所述第一节点互为稳定邻节点的一个邻节点所在簇;其中,所述新簇成立的预设条件为:所述第一节点在距离阈值范围内不存在任一簇首节点、所述更新后的第一节点的邻居表中第一节点的所有稳定邻节点中未分簇节点的的数目大于预设成簇阈值、且所述第一节点在所述所有稳定邻节点中未分簇节点中具有最小的簇首代价。If the first node does not meet the preset conditions for the establishment of the new cluster, the first node broadcasts a beacon and waits to join the cluster where a neighboring node that is a stable neighbor to the first node is located; wherein, The preset conditions for the establishment of the new cluster are: the first node does not have any cluster head node within the distance threshold range, and all stable neighbor nodes of the first node in the updated neighbor table of the first node are included. The number of unclustered nodes is greater than the preset clustering threshold, and the first node has the smallest cluster head cost among the unclustered nodes among all the stable neighbor nodes.

在实际应用中,初始簇的形成过程为:网络建立初期时候,所有的节点都为UN状态(这里UN状态的节点即为所述第一节点为未分簇节点),节点的CL值均为1,并且所有节点都会以100ms为间隔周期性地广播HELLO消息。HELLO消息中包含节点当前的位置,速度,方向,CL值,状态等信息。节点在广播自己HELLO消息的同时也会接收到其他节点的HELLO消息。In practical applications, the initial cluster formation process is as follows: at the initial stage of network establishment, all nodes are in the UN state (here, the node in the UN state is the first node that is an unclustered node), and the CL value of the node is 1, and all nodes will periodically broadcast HELLO messages at 100ms intervals. The HELLO message contains the current position, speed, direction, CL value, state and other information of the node. When a node broadcasts its own HELLO message, it also receives HELLO messages from other nodes.

其中,每个节点(即所述第一节点,其中,所述第一节点可以是所述第二节点,所述第二节点也可以是所述第一节点)都会建立并维护一个邻居表NeighborTable,根据接收到的数据包中的信息存储并更新周围邻节点的相关信息。每个邻居表条目会包括节点的Id,网络地址(IP地址),当前位置(坐标形式),当前速度(坐标形式),当前方向,当前节点状态,节点的簇首Id,节点目标Id,CH标志(是否为CH),当前的CL值,当前的簇规模,最后一次接收到该节点的时间戳等信息。由此每个节点都可以通过周期的HELLO消息不断地更新周围邻节点的信息。Wherein, each node (that is, the first node, where the first node may be the second node, and the second node may also be the first node) will establish and maintain a neighbor table NeighborTable , and store and update the relevant information of the surrounding neighbor nodes according to the information in the received data packets. Each neighbor table entry will include the node's Id, network address (IP address), current position (in coordinate form), current speed (in coordinate form), current direction, current node state, node's cluster head Id, node target Id, CH The flag (whether it is CH), the current CL value, the current cluster size, the timestamp of the last time the node was received, and other information. Therefore, each node can continuously update the information of surrounding neighbor nodes through periodic HELLO messages.

节点经过一段时间交换彼此信息之后,就可以根据接收到的周围邻节点的数据包计算自己的CL值。节点会先建立一个稳定邻节点集合StableNeighborSet,然后遍历邻居表中的所有条目。对于每个邻居表条目对应的节点,节点会判断它是否是自己的稳定邻节点,如果是的话将其加入到StableNeighborSet中。遍历完所有的邻居表条目之后如果集合为空,则说明不存在稳定邻节点,那么节点将自己的CL值修改为1。如果不为空节点则会根据上面提到的CL值计算公式计算自己的CL值。在发送新的HELLO消息之前,节点会将更新过的位置,速度,状态,CL值等信息填写到数据包相应的字段中,然后将最新的信息广播给周围的节点。After the nodes exchange information with each other for a period of time, they can calculate their own CL values according to the received data packets of the neighboring nodes. The node will first establish a stable neighbor node set StableNeighborSet, and then traverse all the entries in the neighbor table. For the node corresponding to each neighbor table entry, the node will determine whether it is its own stable neighbor node, and if so, add it to the StableNeighborSet. After traversing all neighbor table entries, if the set is empty, it means that there is no stable neighbor node, then the node modifies its CL value to 1. If it is not an empty node, it will calculate its own CL value according to the CL value calculation formula mentioned above. Before sending a new HELLO message, the node will fill in the updated position, speed, state, CL value and other information into the corresponding fields of the data packet, and then broadcast the latest information to the surrounding nodes.

此外,UN节点还会根据邻居表中的信息,判断自己的周围是否存在可加入的CH节点。如果UN节点周围不存在可加入的CH节点,并且邻居表中与自己互为稳定邻节点的UN节点数量大于ClusterSizeThreshold,且自己在这些UN节点中具有最小的CL值,则该UN节点会将自己的状态改为CH,发送一个CH_ANNOUNCE消息宣布成立一个新簇。In addition, according to the information in the neighbor table, the UN node will determine whether there are CH nodes around it that can be added. If there is no joinable CH node around the UN node, and the number of UN nodes that are stable neighbors with itself in the neighbor table is greater than ClusterSizeThreshold, and it has the smallest CL value among these UN nodes, the UN node will The status is changed to CH, and a CH_ANNOUNCE message is sent to announce the establishment of a new cluster.

另外,节点加入簇的具体过程为:UN节点会首先尝试从邻居表中寻找可加入的CH节点,如果存在则申请加入该簇,如果不存在则会判断自己是否可以宣布成立一个新簇。这里可加入节点指的是该CH节点与自己互为稳定邻节点并且当前的簇规模小于簇规模上限。为此UN节点会建立一个可加入的CH集合AvailableCHSet,然后遍历自己的邻居表,查看是否有可加入的CH。如果对应邻居表条目的节点是一个CH,当前的簇规模小于能容纳的上限,且与自己互为稳定邻节点,则将此CH加入到AvailableCHSet中。遍历完所有的条目之后,节点先判断这个集合是否为空。如果集合为空且自己不满足宣布成为CH的条件则会继续在邻居表中寻找一个合适的目标CH,尝试加入到网络中去。如果UN节点满足宣布成为CH的条件,则会将自己的状态改为CH,发送一个CH_ANNOUNCE消息宣布成立一个新簇。如果集合中只存在一个可加入的CH,那么节点会将自己的簇首Id设置为这个CH的Id。如果存在多个这样的CH,UN节点会计算与可加入CH的稳定连接时间,并对二者的稳定连接时间进行比较,选出一个与自己稳定连接时间最长的CH作为自己的目标CH,并将自己的簇首Id设置为的目标CH的Id。In addition, the specific process for a node to join a cluster is as follows: the UN node will first try to find a joinable CH node from the neighbor table. If it exists, it will apply to join the cluster. If it does not exist, it will judge whether it can announce the establishment of a new cluster. Here, a joinable node means that the CH node and itself are stable neighbors to each other and the current cluster size is smaller than the upper limit of the cluster size. To this end, the UN node will establish a joinable CH set AvailableCHSet, and then traverse its neighbor table to check whether there is any joinable CH. If the node corresponding to the neighbor table entry is a CH, the current cluster size is smaller than the upper limit that can be accommodated, and the node is a stable neighbor with itself, this CH is added to the AvailableCHSet. After traversing all the entries, the node first determines whether the set is empty. If the set is empty and it does not meet the conditions of being declared as CH, it will continue to search for a suitable target CH in the neighbor table and try to join the network. If the UN node meets the conditions for declaring to be CH, it will change its state to CH and send a CH_ANNOUNCE message to announce the establishment of a new cluster. If there is only one joinable CH in the set, the node will set its own cluster head Id as the Id of this CH. If there are multiple such CHs, the UN node will calculate the stable connection time with the CHs that can be added, compare the stable connection time of the two, and select a CH with the longest stable connection time as its own target CH. and set its own cluster head Id to the Id of the target CH.

确定了目标CH之后,UN节点会发送一个JOIN消息请求加入到这个簇中,并开启一个定时器。如果在有效期内成功收到来自目标节点的JOIN_ACK消息则表示该UN节点成功地加入到了网络中。此时UN节点会将自己的状态改为CM状态,将簇首Id更改为目标CH的Id。如果有效期内没有收到JOIN_ACK消息或者在有效期内收到了JOIN_NACK消息则表示该UN节点没有成功加入到网络中,则节点会继续在邻居表中寻找一个合适的目标CH,尝试加入到网络中去。After determining the target CH, the UN node will send a JOIN message to request to join the cluster and start a timer. If the JOIN_ACK message from the target node is successfully received within the validity period, it means that the UN node has successfully joined the network. At this time, the UN node will change its state to the CM state, and change the cluster head Id to the Id of the target CH. If the JOIN_ACK message is not received within the validity period or the JOIN_NACK message is received within the validity period, it means that the UN node has not successfully joined the network, and the node will continue to search for a suitable target CH in the neighbor table and try to join the network.

本实施例提供的适合高动态大规模车联网的分簇方法,首先第一节点接收第二节点发送的通信消息,所述第一节点将所述通信消息更新到所述第一节点的邻居表中;所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;若所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值,则所述第一节点对所述第一节点所在簇的所有簇员发送解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;若所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;若所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点,则所述第一节点发送申请加入请求,用以申请加入所述目标簇首节点所在簇;若所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点,则根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,若所述第一节点符合所述新簇成立的预设条件,则将所述第一节点作为新簇的簇首节点,进而提高分簇结构的连通性和稳定性,同时由于稳定性的提高,避免切换时间和次数,进而节约时间和资源,解决了簇结构稳定性差,簇分布不均匀,分簇开销大,节点之间通信可靠性不高的问题。In the clustering method suitable for the highly dynamic large-scale Internet of Vehicles provided by this embodiment, firstly the first node receives the communication message sent by the second node, and the first node updates the communication message to the neighbor table of the first node in; the first node determines all stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node are the updated Nodes that are stable neighbors with the first node in the neighbor table of the first node afterward; the first node calculates the cluster of the first node according to the node information of all stable neighbor nodes of the first node head cost; if the first node is a cluster head node, and according to the cluster head cost of the first node, it is determined that the first node complies with the preset conditions for intra-cluster head switching or the pre-condition for inter-cluster head switching When a condition is set, the first node determines a cluster head node to be determined, and the first node dissolves the cluster where the first node is located, wherein the cluster head node to be determined meets the preset conditions for the establishment of a new cluster. When a new cluster is created, and the intra-cluster head is switched or the cluster head is switched between clusters, the cluster head of the new cluster is the node with the smallest cluster head generation value within the distance threshold; if the first node is the cluster head node , and the sum of the number of cluster members of the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node is less than the preset cluster disbanding scale threshold, then the first node Send a message of disbanding the cluster to all cluster members in the cluster where the first node is located, and the target unclustered node is an unclustered node that is a stable neighbor to the first node; if the first node is A cluster member node, and according to the cluster head cost of the first node, when it is determined that the first node and the cluster head node in the cluster where the first node is located do not satisfy the condition of being a distance or angle of stable neighbor nodes to each other, The first node changes the cluster head node corresponding to the first node; if the first node is an unclustered node, and it is determined that the target cluster head node exists in the neighbor table of the first node, the first node A node sends an application join request to apply for joining the cluster where the target cluster head node is located; if the first node is an unclustered node and confirms that the target cluster head node does not exist in the neighbor table of the first node, Then, according to the neighbor table of the first node, it is determined whether the first node satisfies the preset conditions for the establishment of a new cluster, and if the first node meets the preset conditions for the establishment of the new cluster, the first node satisfies the preset conditions for the establishment of the new cluster. The node acts as the cluster head node of the new cluster, thereby improving the connectivity and stability of the cluster structure. At the same time, due to the improvement of stability, switching time and times are avoided, thereby saving time and resources, and solving the problem of poor cluster structure stability and poor cluster distribution. Evenly, the clustering overhead is large, and the communication reliability between nodes is not high.

为了确定与所述第一节点互为稳定节点的第一稳定节点,图2为本申请再一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图,本实施例在上述实施例的基础上,例如,在图1所述实施例的基础上,本实施例对S102的具体过程进行了详细说明。所述节点信息包括节点的位置坐标和速度坐标;所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,包括:In order to determine the first stable node that is mutually stable with the first node, FIG. 2 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale IoV provided by yet another embodiment of the present application. This embodiment is implemented in the above-mentioned implementation. On the basis of the example, for example, on the basis of the embodiment shown in FIG. 1 , the specific process of S102 is described in detail in this embodiment. The node information includes the position coordinates and velocity coordinates of the node; the first node determines all stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, including:

S201、针对所述更新后的第一节点的邻居表中所有邻节点的每个邻节点,根据所述邻节点的速度坐标,确定所述第一节点与所述邻节点相对移动方向;S201, for each adjacent node of all adjacent nodes in the updated neighbor table of the first node, determine the relative movement direction of the first node and the adjacent node according to the speed coordinates of the adjacent node;

S202、根据所述邻节点的位置坐标,确定所述第一节点与所述邻节点的距离;S202. Determine the distance between the first node and the adjacent node according to the position coordinates of the adjacent node;

S203、若所述第一节点与所述邻节点相对移动方向小于或等于预设夹角,且所述邻节点的距离小于或等于预设距离,则根据所述邻节点的位置坐标和速度坐标,通过预设第一不等式计算,得到所述第一节点与所述邻节点之间的稳定连接时间;S203. If the relative movement direction of the first node and the adjacent node is less than or equal to a preset angle, and the distance of the adjacent node is less than or equal to the preset distance, then according to the position coordinate and velocity coordinate of the adjacent node , obtain the stable connection time between the first node and the adjacent node by calculating the preset first inequality;

S204、若所述稳定连接时间大于或等于预设连接时间,则确定所述邻节点为所述第一节点的稳定邻节点。S204. If the stable connection time is greater than or equal to a preset connection time, determine that the neighbor node is a stable neighbor node of the first node.

本实施例中,确定与所述第一节点互为稳定节点的第一稳定节点的过程为:将所述第一节点记作节点i,所述第一节点的邻居表中的任一邻节点记作节点j,遍历第一节点的邻居表中的所有邻节点,具体为:所述节点i和节点j之间的稳定连接时间SLTi,j定义为从当前时刻到两个节点之间的距离大于Dth的时间,SLTi,j的值可通过两个节点当前的速度和位置来计算。假设节点的速度和方向在短时间内保持不变,节点i的位置坐标为(Pi.x,Pi.y),速度坐标为(Vi.x,Vi.y);节点j的位置坐标为(Pj.x,Pj.y),速度坐标为(Vj.x,Vj.y)。如果节点i和节点j之间的距离小于或等于Dth,则有:In this embodiment, the process of determining the first stable node that is mutually stable with the first node is: denoting the first node as node i, any neighbor node in the neighbor table of the first node Denoted as node j, traverse all adjacent nodes in the neighbor table of the first node, specifically: the stable connection time SLT i,j between the node i and node j is defined as the time from the current moment to the time between the two nodes. When the distance is greater than D th , the value of SLT i,j can be calculated from the current velocity and position of the two nodes. Assuming that the speed and direction of the node remain unchanged in a short time, the position coordinates of node i are (P i .x, P i .y), and the velocity coordinates are (V i .x, V i .y); The position coordinates are (P j .x, P j .y), and the velocity coordinates are (V j .x, V j .y). If the distance between node i and node j is less than or equal to D th , then:

[(Pi.x+Vi.x*t)-(Pj.x+Vj.x*t)]2+[(Pi.y+Vi.y*t)-(Pj.y+Vj.y*t)]2≤Dth 2 [(P i .x+V i .x*t)-(P j .x+V j .x*t)] 2 +[(P i .y+V i .y*t)-(P j . y+V j .y*t)] 2 ≤D th 2

[(Pi.x-Pj.x)+(Vi.x*t-Vj.x*t)]2+[(Pi.y-Pj.y)+(Vi.y*t-Vj.y*t)]2≤Dth 2 [(P i .xP j .x)+(V i .x*tV j .x*t)] 2 +[(P i .yP j .y)+(V i .y*tV j .y*t )] 2 ≤D th 2

做以下变量替换:Do the following variable substitution:

a=Vi.x-Vj.xa=V i .xV j .x

b=Pi.x-Pj.xb=P i .xP j .x

c=Vi.y-Vj.yc=V i .yV j .y

d=Pi.y-Pj.yd=P i .yP j .y

则有:Then there are:

[b+at]2+[d+ct]2≤Dth 2 [b+at] 2 +[d+ct] 2 ≤D th 2

由定义可知SLTI,j=tmax,此时满足如下公式:It can be known from the definition that SLT I,j = t max , and the following formula is satisfied at this time:

[b+a*SLTI,j]2+[d+c*SLTI,j]2=Dth 2 [b+a*SLT I,j ] 2 +[d+c*SLT I,j ] 2 =D th 2

做以下变量替换:Do the following variable substitution:

e=a2+c2 e=a 2 +c 2

解方程可得节点i和j之间的稳定连接时间为:Solving the equation, the stable connection time between nodes i and j can be obtained as:

Figure BDA0002215034060000181
Figure BDA0002215034060000181

为了计算所述第一节点的簇首代价,图3为本申请另一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图,本实施例在上述实施例的基础上,例如,在图1所述实施例的基础上,本实施例对S103的具体过程进行了详细说明。所述第一节点根据所有第一稳定邻节点的节点信息,计算所述第一节点的簇首代价,包括:In order to calculate the cluster head cost of the first node, FIG. 3 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale Internet of Vehicles provided by another embodiment of the present application. On the basis of the above-mentioned embodiments, for example , on the basis of the embodiment shown in FIG. 1 , this embodiment describes the specific process of S103 in detail. The first node calculates the cluster head cost of the first node according to the node information of all the first stable neighbor nodes, including:

S301、所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的所有稳定邻节点的平均速度和所述第一节点距离所述第一节点的所有稳定邻节点的平均距离;S301. The first node calculates, according to the node information of all stable neighbor nodes of the first node, the average speed of all stable neighbor nodes of the first node and the distance between the first node and the first node. Average distance of stable neighbors;

S302、所述第一节点获取第一节点的所有稳定邻节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数;S302. The first node acquires the number of all stable neighbor nodes of the first node, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the current position behind the first node The number of stable neighbors of the first node of ;

S303、根据所述平均速度、平均距离、所有第一稳定节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数,基于预设簇首代价公式,得到所述第一节点的簇首代价。S303. According to the average speed, average distance, the number of all first stable nodes, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the current position behind the first node The number of stable neighbor nodes of the first node, and the cluster head cost of the first node is obtained based on the preset cluster head cost formula.

本实施例中,将所述第一节点记作节点i,其中,节点i的簇首代价Ci计算公式如下所示:In this embodiment, the first node is denoted as node i, wherein the calculation formula of the cluster head cost C i of node i is as follows:

Figure BDA0002215034060000182
Figure BDA0002215034060000182

其中,α、β、γ可设置为不同的值,但需满足α+β+γ=1,这里Vi表示节点i的速度;

Figure BDA0002215034060000183
表示节点i的所有稳定邻节点的平均速度;Vmax表示预定义的最大速度,设置为50m/s;
Figure BDA0002215034060000184
表示节点i与其所有稳定邻节点的平均距离,Nall表示节点i所有稳定邻节点的个数,Nfront表示当前位置在节点i前方的稳定邻节点的个数,Nbehind表示当前位置在节点i后方的稳定邻节点的个数,且有Nall=Nfront+Nbehind,Nfront-Nbehind=2*Nfront-Nall。Among them, α, β, γ can be set to different values, but need to satisfy α+β+γ=1, where V i represents the speed of node i;
Figure BDA0002215034060000183
Represents the average velocity of all stable neighbors of node i; Vmax represents the predefined maximum velocity, which is set to 50m/s;
Figure BDA0002215034060000184
Represents the average distance between node i and all its stable neighbors, N all represents the number of all stable neighbors of node i, N front represents the number of stable neighbors whose current position is in front of node i, and N behind represents the current position of node i The number of stable neighbors behind, and there are N all =N front +N behind , N front -N behind =2*N front -N all .

由以上公式可知:当Nall不为0时,CLi的值域将归一化到(0,1)。而当Nall为0时,上式出现分母为零的情况,所以此时我们规定当Nall为0时,CLi的值为1。如果节点i与自己的稳定邻节点相对速度越小,距离越近,节点的稳定邻节点数量越多且节点前后方的稳定邻节点分布更均匀,那么节点的CL值越小。It can be known from the above formula: when N all is not 0, the value range of CL i will be normalized to (0, 1). When N all is 0, the denominator of the above formula is zero, so at this time we stipulate that when N all is 0, the value of CL i is 1. If the relative speed between node i and its stable neighbors is smaller, the distance is closer, the number of stable neighbors of the node is more and the distribution of stable neighbors before and after the node is more uniform, then the CL value of the node is smaller.

为了实现自适应信标机制,图4为本申请又一实施例提供的适合高动态大规模车联网的分簇方法的流程示意图,本实施例在上述实施例的基础上,例如,在图1-3任一所述实施例的基础上,本实施例对所述适合高动态大规模车联网的分簇方法的具体过程进行了详细说明。所述方法还包括:In order to realize the adaptive beacon mechanism, FIG. 4 is a schematic flowchart of a clustering method suitable for high-dynamic large-scale Internet of Vehicles provided by another embodiment of the present application. This embodiment is based on the above-mentioned embodiment, for example, in FIG. 1 -3 On the basis of any of the above embodiments, this embodiment describes in detail the specific process of the clustering method suitable for the high-dynamic large-scale Internet of Vehicles. The method also includes:

S401、所述第一节点在未分簇状态时,所述第一节点以第一预设时间间隔为周期广播信标;S401. When the first node is in an unclustered state, the first node broadcasts a beacon periodically at a first preset time interval;

S402、在所述第一节点加入一个簇后,所述第一节点获取所述第一节点所在簇的簇首节点的速度;S402. After the first node joins a cluster, the first node obtains the speed of the cluster head node of the cluster where the first node is located;

S403、所述第一节点根据所述第一节点所在簇的簇首节点的速度以及预设信标周期阈值表,确定所述第一节点发送所述信标的信标周期;S403, the first node determines the beacon period for the first node to send the beacon according to the speed of the cluster head node of the cluster where the first node is located and a preset beacon period threshold table;

S404、所述第一节点根据所述信标周期广播信标。S404. The first node broadcasts a beacon according to the beacon period.

本实施例中,网络在初始化时所有节点都设置为UN状态,所以节点都会以100ms为间隔周期性地广播HELLO消息。但是在节点加入簇变为CM节点之后,它的信标周期则由CH的速度范围来确定,CH速度越大信标周期越短。在本发明中将40m/s、30m/s、20m/s、10m/s作为划分信标周期的阈值,设置了5种信标周期。当CH的速度大于40m/s时,整个簇内的节点都以100ms为周期发送信标;当CH的速度小于或等于40m/s且大于30m/s时,整个簇内的节点都以200ms为周期发送信标;当CH的速度小于或等于30m/s且大于20m/s时,整个簇内的节点都以400ms为周期发送信标;当CH的速度小于或等于20m/s且大于10m/s时,整个簇内的节点都以800ms为周期发送信标;当CH的速度小于或等于10m/s时,整个簇内的节点都以1000ms为周期发送信标。In this embodiment, when the network is initialized, all nodes are set to the UN state, so the nodes periodically broadcast HELLO messages at intervals of 100ms. But after the node joins the cluster and becomes a CM node, its beacon period is determined by the speed range of the CH. The greater the CH speed, the shorter the beacon period. In the present invention, 40m/s, 30m/s, 20m/s, and 10m/s are used as thresholds for dividing the beacon period, and five types of beacon periods are set. When the CH speed is greater than 40m/s, the nodes in the entire cluster send beacons at a cycle of 100ms; when the CH speed is less than or equal to 40m/s and greater than 30m/s, the nodes in the entire cluster send beacons at 200ms Periodically send beacons; when the CH speed is less than or equal to 30m/s and greater than 20m/s, the nodes in the entire cluster send beacons at a cycle of 400ms; when the CH speed is less than or equal to 20m/s and greater than 10m/ s, the nodes in the entire cluster send beacons with a cycle of 800ms; when the CH speed is less than or equal to 10m/s, the nodes in the entire cluster send beacons with a cycle of 1000ms.

在实际应用中,一个节点发送给另一个节点的通信消息可以为下述任一项:HELLO消息、JOIN消息、JOIN_(N)ACK消息、CH_ANNOUNCE消息、CH_HANDOVER消息、CH_DISSOLUTION消息、LEAVE消息。In practical applications, the communication message sent by one node to another node can be any of the following: HELLO message, JOIN message, JOIN_(N)ACK message, CH_ANNOUNCE message, CH_HANDOVER message, CH_DISSOLUTION message, LEAVE message.

在整个分簇过程中每个节点都需要及时维护、更新自身的状态信息。这个工作主要通过BEAT自消息完成的。节点会设置一个周期定时器,每隔固定的间隔就会遍历自己的邻居表,删除其中失效的邻居表条目,然后根据邻居表中存在且有效的信息计算自己的CL值,设置信标消息发送间隔。如果节点是CH的话还会判断是否要进行簇自杀,是否要发生簇首切换。如果节点是CM的话会判断是否要更改自己的簇首。如果节点是UN的话则会尝试加入一个簇或者成立新簇。In the whole clustering process, each node needs to maintain and update its own state information in time. This work is mainly done through BEAT self-messages. The node will set a periodic timer, traverse its neighbor table at regular intervals, delete the invalid neighbor table entry, and then calculate its own CL value according to the existing and valid information in the neighbor table, and set the beacon message to send interval. If the node is CH, it will also judge whether to perform cluster suicide and whether to switch the cluster head. If the node is a CM, it will judge whether to change its own cluster head. If the node is UN, it will try to join a cluster or create a new cluster.

其中,网络节点(可以为第一节点也可以为第二节点)对各种消息的处理过程为:(以下所说的节点可以为第一节点)Among them, the process of processing various messages by a network node (which may be the first node or the second node) is: (the node mentioned below may be the first node)

1、节点接收HELLO消息的处理1. The node receives the processing of the HELLO message

无论是哪种消息的类型以及消息的源节点和目的节点是谁,在本实施例中,只要接收到了某个节点的消息,就会在邻居表中记录消息发送方的信息。其中接收HELLO消息主要分为以下几种情况:Regardless of the type of the message and who the source node and destination node of the message are, in this embodiment, as long as a message from a certain node is received, the information of the message sender will be recorded in the neighbor table. The receiving HELLO message is mainly divided into the following situations:

1)在邻居表中更新与发送节点相关的条目内容。1) Update the content of the entry related to the sending node in the neighbor table.

2、节点接收JOIN消息的处理2. The node receives the processing of the JOIN message

接收JOIN消息主要分为以下几种情况:Receiving JOIN messages is mainly divided into the following situations:

1)如果一个CH节点接收到了一个UN节点的JOIN消息,则需要判断自身与该UN节点是否互为稳定邻节点以及自身是否可以容纳这个UN节点,如果满足条件则发送JOIN_ACK消息,同时更改自己的簇规模。如果不满足加入条件则发送JOIN_NACK消息拒绝该节点的加入;1) If a CH node receives a JOIN message from a UN node, it needs to determine whether it and the UN node are mutually stable neighbors and whether it can accommodate the UN node. If the conditions are met, it will send a JOIN_ACK message and change its own cluster size. If the joining conditions are not met, send a JOIN_NACK message to reject the joining of the node;

2)如果一个CH节点接收到了本簇CM的JOIN消息,且该消息的目的节点不是自己。这时CH会从ClusterMemberSet中删除这个CM,更新自己的簇规模;2) If a CH node receives the JOIN message of the CM of this cluster, and the destination node of the message is not itself. At this time, CH will delete the CM from the ClusterMemberSet and update its own cluster size;

3)如果一个CM或UN节点接收到了CH或目标CH的JOIN消息,则CM会变为UN状态进入UN节点的初始化加入簇的过程,UN节点则继续保持UN状态,重新选择目标CH;3) If a CM or UN node receives the JOIN message of the CH or the target CH, the CM will change to the UN state and enter the process of initializing the UN node to join the cluster, and the UN node will continue to maintain the UN state and reselect the target CH;

4)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。4) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

3、节点接收JOIN_(N)ACK消息的处理3. The node receives the processing of the JOIN_(N)ACK message

接收JOIN_(N)ACK消息主要分为以下几种情况:Receiving a JOIN_(N)ACK message is mainly divided into the following situations:

1)如果一个UN节点在定时器有效期内没有接收到目标CH节点的JOIN_ACK消息或者在有效期内收到目标CH的JOIN_NACK消息,则UN节点会继续保持UN状态,进入UN节点初始加入簇的流程;1) If a UN node does not receive the JOIN_ACK message of the target CH node within the validity period of the timer or receives the JOIN_NACK message of the target CH node within the validity period, the UN node will continue to maintain the UN state and enter the process of the UN node initially joining the cluster;

2)如果一个UN节点在定时器有效期内接收到目标CH节点的JOIN_ACK消息,则该UN节点会从UN状态切换到CM状态,将簇首Id置为目标CH的Id。2) If a UN node receives the JOIN_ACK message of the target CH node within the validity period of the timer, the UN node will switch from the UN state to the CM state, and set the cluster head Id as the Id of the target CH.

3)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。3) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

4、节点接收CH_ANNOUNCE消息的处理4. The node receives the processing of the CH_ANNOUNCE message

接收CH_ANNOUNCE消息主要分为以下几种情况:Receiving CH_ANNOUNCE messages is mainly divided into the following situations:

1)如果一个CH节点收到了本簇内CM节点的CH_ANNOUNCE消息,则会在ClusterMemberSet中删除给CM节点,更新自身的簇规模;1) If a CH node receives the CH_ANNOUNCE message of the CM node in the cluster, it will delete it to the CM node in the ClusterMemberSet and update its own cluster size;

2)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。2) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

5、节点接收CH_HANDOVER消息的处理5. The node receives the processing of the CH_HANDOVER message

接收CH_HANDOVER消息主要分为以下几种情况:Receiving CH_HANDOVER messages is mainly divided into the following situations:

1)如果一个CM节点收到了目的节点为自身的CH_HANDOVER消息,那么该节点会切换到CH状态,宣布成为CH;1) If a CM node receives a CH_HANDOVER message whose destination node is itself, then the node will switch to the CH state and announce that it has become a CH;

2)如果消息的目的节点不是自身,但是消息的源节点是自己的CH或者目标CH,则节点会切换或继续保持到UN状态,进入UN节点的初始化加入簇流程,重新选择合适的CH;2) If the destination node of the message is not itself, but the source node of the message is its own CH or target CH, the node will switch or continue to remain in the UN state, enter the UN node initialization and join the cluster process, and re-select the appropriate CH;

3)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。3) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

6、节点接收CH_DISSOLUTION消息的处理6. The node receives the processing of the CH_DISSOLUTION message

接收CH_DISSOLUTION消息主要分为以下几种情况:Receiving the CH_DISSOLUTION message is mainly divided into the following situations:

1)如果一个CM节点收到了CH的CH_DISSOLUTION消息,那么该节点会切换到UN状态,进入UN节点的初始化加入簇流程,重新选择合适的CH;1) If a CM node receives the CH_DISSOLUTION message of the CH, then the node will switch to the UN state, enter the initialization process of the UN node to join the cluster, and re-select the appropriate CH;

2)如果一个UN节点收到了目标CH的CH_DISSOLUTION消息,那么该节点会继续保持UN状态,进入UN节点的初始化加入簇流程,重新选择合适的CH;2) If a UN node receives the CH_DISSOLUTION message of the target CH, then the node will continue to maintain the UN state, enter the UN node initialization and join the cluster process, and re-select the appropriate CH;

3)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。3) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

7、节点接收LEAVE消息的处理7. The node receives the processing of the LEAVE message

接收LEAVE消息主要分为以下几种情况:Receiving LEAVE messages is mainly divided into the following situations:

1)如果一个CH节点接收到了本簇内CM节点的LEAVE消息,则会从ClusterMemberSet中删除该节点,并更新当前的簇规模;1) If a CH node receives the LEAVE message of the CM node in the cluster, it will delete the node from the ClusterMemberSet and update the current cluster size;

2)如果是其他情况,则不做多余的处理,只单纯地在邻居表中更新与发送节点相关的条目内容。2) In other cases, no redundant processing is performed, and the content of the entry related to the sending node is simply updated in the neighbor table.

在实际仿真过程中,在OMNeT++中对本分簇算法进行仿真时的流程如下所述:首先在网络初始化函数中对仿真模块和参数进行初始化,设置自消息事件。在仿真时间内,如果节点接收到了上层发送来的消息,则会对该消息封装成网络层数据包并向MAC层发送该封装后的数据包;如果收到了下层发送来的数据包则要根据消息的类型进行不同的处理;如果接收到了自消息(主要实现定时的功能,如HELLO消息发送以及周期的BEAT消息发送)则会根据自消息的类型进行相应的处理。在仿真时间结束时,会收集收据并统计相关的结果。In the actual simulation process, the process of simulating this clustering algorithm in OMNeT++ is as follows: First, the simulation module and parameters are initialized in the network initialization function, and the self-message event is set. During the simulation time, if the node receives a message from the upper layer, it will encapsulate the message into a network layer data packet and send the encapsulated data packet to the MAC layer; if it receives a data packet from the lower layer, it will be based on The type of the message is processed differently; if a self-message is received (mainly implementing timing functions, such as HELLO message sending and periodic BEAT message sending), it will be processed according to the type of self-message. At the end of the simulation time, the receipts are collected and the relevant results are counted.

为了实现所述适合高动态大规模车联网的分簇方法,本实施例提供了一种适合高动态大规模车联网的分簇装置。参见图5,图5为本申请实施例提供的适合高动态大规模车联网的分簇装置的结构示意图;所述适合高动态大规模车联网的分簇装置50,包括:邻居表更新模块501,用于接收第二节点发送的通信消息,将所述通信消息更新到第一节点的邻居表中;稳定邻节点确定模块502,用于根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;簇首代价计算模块503,用于根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;簇首切换模块504,用于在所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;簇解散模块505,用于在所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值时,对所述第一节点广播解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;簇首变更模块506,用于在所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;加入簇申请模块507,用于在所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点时,发送申请加入请求,用以申请加入所述目标簇首节点所在簇;新簇成立模块508,用于在所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点时,根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,在所述第一节点符合所述新簇成立的预设条件时,将所述第一节点作为新簇的簇首节点。In order to realize the clustering method suitable for high-dynamic large-scale vehicle networking, this embodiment provides a clustering device suitable for high-dynamic large-scale vehicle networking. Referring to FIG. 5, FIG. 5 is a schematic structural diagram of a clustering device suitable for high-dynamic large-scale Internet of Vehicles provided by an embodiment of the application; the clustering device 50 suitable for high-dynamic large-scale Internet of Vehicles includes: a neighbor table update module 501 , for receiving the communication message sent by the second node, and updating the communication message to the neighbor table of the first node; the stable neighbor node determination module 502 is used for all neighbor nodes in the updated neighbor table of the first node according to the updated The node information of the first node is determined, and all the stable neighbor nodes of the first node are determined, and the stable neighbor nodes of the first node are the nodes in the updated neighbor table of the first node that are stable neighbors with the first node. ; the cluster head cost calculation module 503 is used to calculate the cluster head cost of the first node according to the node information of all stable neighbor nodes of the first node; the cluster head switching module 504 is used to calculate the cluster head cost of the first node is a cluster head node, and according to the cluster head cost of the first node, when it is determined that the first node complies with the preset conditions for intra-cluster switch head switching or the preset conditions for inter-cluster cluster head switching, then determine a to-be-determined The cluster head node, and the first node dissolves the cluster where the first node is located, wherein a new cluster is established when it is determined that the cluster head node satisfies the preset conditions for the establishment of a new cluster, and the intra-cluster cluster head switches or the inter-cluster cluster When the head is switched, the cluster head of a new cluster is the node with the smallest cluster head generation value within the distance threshold range; the cluster dissolution module 505 is used for the first node to be the cluster head node, and the first node When the sum of the number of cluster members of the cluster and the number of target unclustered nodes contained in the updated neighbor table of the first node is less than the preset cluster dissolution scale threshold, broadcast a message of cluster dissolution to the first node, The target unclustered node is an unclustered node that is a stable neighbor to the first node; the cluster head changing module 506 is used for the first node to be a cluster member node, and according to the first node The cluster head cost of the node, when it is determined that the first node and the cluster head node in the cluster where the first node is located do not satisfy the condition of being a distance or angle of stable neighbors to each other, the first node changes the first node. The cluster head node corresponding to the node; the joining cluster application module 507 is used to send an application joining request when the first node is an unclustered node and it is determined that the target cluster head node exists in the neighbor table of the first node, In order to apply for joining the cluster where the target cluster head node is located; the new cluster establishment module 508 is used to confirm that the first node is an unclustered node and confirm that the target cluster head node does not exist in the neighbor table of the first node When the first node meets the preset condition for the establishment of the new cluster, determine whether the first node meets the preset condition for the establishment of the new cluster according to the neighbor table of the first node, and the first node meets the preset condition for the establishment of the new cluster. A node acts as the cluster head node of the new cluster.

本实施例提供的装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。The apparatus provided in this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again in this embodiment.

在一种可能的设计中,所述装置还包括:数目获取模块;所述数目获取模块,用于在计算所述第一节点的簇首代价之后,且在所述第一节点为簇首节点时,获取所述第一节点所在簇的簇成员数目以及所述更新后的第一节点的邻居表中含有目标未分簇节点的数目。In a possible design, the apparatus further includes: a number acquisition module; the number acquisition module is configured to, after calculating the cluster head cost of the first node, when the first node is a cluster head node At the time, the number of cluster members of the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node are obtained.

在一种可能的设计中,所述装置还包括:广播模块;所述广播模块,用于在根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件之后,且在所述第一节点不满足所述新簇成立的预设条件时,广播信标,等待加入与所述第一节点互为邻节点的一个邻节点所在簇;其中,所述新簇成立的预设条件为:所述第一节点在距离阈值范围内不存在任一簇首节点、所述更新后的第一节点的邻居表中第一节点的所有稳定邻节点中未分簇节点的的数目大于预设成簇阈值、且所述第一节点在所述所有稳定邻节点中未分簇节点中具有最小的簇首代价。In a possible design, the apparatus further includes: a broadcasting module; the broadcasting module is configured to determine whether the first node satisfies a preset condition for establishing a new cluster according to a neighbor table of the first node Afterwards, and when the first node does not meet the preset conditions for the establishment of the new cluster, broadcast a beacon, waiting to join the cluster where a neighboring node that is a neighboring node to the first node is located; wherein, the new The preset conditions for cluster establishment are: the first node does not have any cluster head node within the distance threshold range, and all stable neighbor nodes of the first node in the updated neighbor table of the first node are not clustered. The number of nodes is greater than the preset clustering threshold, and the first node has the smallest cluster head cost among the unclustered nodes among all the stable neighbor nodes.

在一种可能的设计中,所述节点信息包括节点的位置坐标和速度坐标;稳定邻节点确定模块,具体用于:In a possible design, the node information includes the position coordinates and velocity coordinates of the node; the stable neighbor node determination module is specifically used for:

针对所述更新后的第一节点的邻居表中所有邻节点的每个邻节点,根据所述邻节点的速度坐标,确定所述第一节点与所述邻节点相对移动方向;根据所述邻节点的位置坐标,确定所述第一节点与所述邻节点的距离;若所述第一节点与所述邻节点相对移动方向小于或等于预设夹角,且所述邻节点的距离小于或等于预设距离,则根据所述邻节点的位置坐标和速度坐标,通过预设第一不等式计算,得到所述第一节点与所述邻节点之间的稳定连接时间;若所述稳定连接时间大于或等于预设连接时间,则确定所述邻节点为所述第一节点的稳定邻节点。For each neighbor node of all neighbor nodes in the updated neighbor table of the first node, determine the relative movement direction of the first node and the neighbor node according to the speed coordinates of the neighbor node; The position coordinates of the node to determine the distance between the first node and the adjacent node; if the relative movement direction of the first node and the adjacent node is less than or equal to the preset angle, and the distance between the adjacent nodes is less than or equal to is equal to the preset distance, then according to the position coordinates and velocity coordinates of the adjacent nodes, the stable connection time between the first node and the adjacent node is obtained by calculating the preset first inequality; if the stable connection time If it is greater than or equal to the preset connection time, it is determined that the neighbor node is a stable neighbor node of the first node.

在一种可能的设计中,所述簇首代价计算模块403,具体用于:In a possible design, the cluster head cost calculation module 403 is specifically used for:

根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的所有稳定邻节点的平均速度和所述第一节点距离所述第一节点的所有稳定邻节点的平均距离;获取第一节点的所有稳定邻节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数;根据所述平均速度、平均距离、所有第一稳定节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数,基于预设簇首代价公式,得到所述第一节点的簇首代价。According to the node information of all stable neighbor nodes of the first node, calculate the average speed of all stable neighbor nodes of the first node and the average distance between the first node and all stable neighbor nodes of the first node; Obtain the number of all stable neighbor nodes of the first node, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the stable neighbor nodes of the first node whose current position is behind the first node. The number of nodes; according to the average speed, average distance, the number of all first stable nodes, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the current position in the first node The number of stable neighbor nodes of the first node behind a node is based on a preset cluster head cost formula, and the cluster head cost of the first node is obtained.

在一种可能的设计中,所述装置还包括:信标周期更新模块;所述信标周期更新模块,用于:在未分簇状态时,所述第一节点以第一预设时间间隔为周期广播信标;在加入一个簇后,所述第一节点获取所述第一节点所在簇的簇首节点的速度;根据所述第一节点所在簇的簇首节点的速度以及预设信标周期阈值表,确定所述第一节点发送所述信标的信标周期;根据所述信标周期广播信标。In a possible design, the apparatus further includes: a beacon period update module; the beacon period update module is configured to: in a non-clustered state, the first node at a first preset time interval is a periodic broadcast beacon; after joining a cluster, the first node obtains the speed of the cluster head node of the cluster where the first node is located; according to the speed of the cluster head node of the cluster where the first node is located and the preset signal A beacon period threshold table is used to determine a beacon period during which the first node sends the beacon; the beacon is broadcast according to the beacon period.

为了实现所述适合高动态大规模车联网的分簇方法,本实施例提供了一种适合高动态大规模车联网的分簇设备。图6为本申请实施例提供的适合高动态大规模车联网的分簇的结构示意图。如图6所示,本实施例的适合高动态大规模车联网的分簇设备60包括:处理器601以及存储器602;其中,存储器602,用于存储计算机执行指令;处理器601,用于执行存储器存储的计算机执行指令,以实现上述实施例中所执行的各个步骤。具体可以参见前述方法实施例中的相关描述。In order to realize the clustering method suitable for high-dynamic large-scale vehicle networking, this embodiment provides a clustering device suitable for high-dynamic large-scale vehicle networking. FIG. 6 is a schematic structural diagram of a clustering suitable for a high-dynamic large-scale Internet of Vehicles provided by an embodiment of the present application. As shown in FIG. 6 , the clustering device 60 suitable for the high-dynamic large-scale Internet of Vehicles in this embodiment includes: a processor 601 and a memory 602; wherein, the memory 602 is used to store computer execution instructions; the processor 601 is used to execute The computer stored in the memory executes the instructions to implement the various steps performed in the above-described embodiments. For details, refer to the relevant descriptions in the foregoing method embodiments.

最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application. scope.

Claims (8)

1.一种适合高动态大规模车联网的分簇方法,其特征在于,包括:1. a kind of clustering method suitable for high dynamic large-scale car networking, is characterized in that, comprises: 第一节点接收第二节点发送的通信消息,所述第一节点将所述通信消息更新到所述第一节点的邻居表中;The first node receives the communication message sent by the second node, and the first node updates the communication message to the neighbor table of the first node; 所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;The first node determines all stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node are the updated stable neighbor nodes. Nodes that are mutually stable neighbors with the first node in the neighbor table of the first node; 所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;The first node calculates the cluster head cost of the first node according to the node information of all stable neighbor nodes of the first node; 若所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则所述第一节点确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;If the first node is the cluster head node, and according to the cluster head cost of the first node, it is determined that the first node meets the preset conditions for intra-cluster head switching or the preset conditions for inter-cluster head switching , then the first node determines a cluster head node to be determined, and the first node dissolves the cluster where the first node is located, wherein a new cluster is established when the cluster head node to be determined satisfies the preset conditions for the establishment of a new cluster , and when the intra-cluster head switches or the inter-cluster head switches, the cluster head that establishes a new cluster is the node with the smallest cluster head generation value within the distance threshold range; 若所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值,则所述第一节点对所述第一节点所在簇的所有簇员发送解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;If the first node is the cluster head node, and the sum of the number of cluster members in the cluster where the first node is located and the number of target unclustered nodes in the updated neighbor table of the first node is less than the preset cluster Dissolution scale threshold, the first node sends a message of disbanding the cluster to all cluster members in the cluster where the first node is located, and the target unclustered node is an undistributed node that is a stable neighbor to the first node. cluster node; 若所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;If the first node is a cluster member node, and according to the cluster head cost of the first node, it is determined that the first node and the cluster head nodes in the cluster where the first node is located do not satisfy the requirement that they are mutually stable neighbors. When the condition of distance or angle is satisfied, the first node changes the cluster head node corresponding to the first node; 若所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点,则所述第一节点发送申请加入请求,用以申请加入所述目标簇首节点所在簇;If the first node is an unclustered node, and it is determined that the target cluster head node exists in the neighbor table of the first node, the first node sends an application join request to apply for joining the target cluster head node the cluster; 若所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点,则根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,若所述第一节点符合所述新簇成立的预设条件,则将所述第一节点作为新簇的簇首节点;If the first node is an unclustered node, and it is confirmed that the target cluster head node does not exist in the neighbor table of the first node, it is determined whether the first node satisfies the new requirements according to the neighbor table of the first node. The preset condition for the establishment of the cluster, if the first node meets the preset condition for the establishment of the new cluster, the first node is used as the cluster head node of the new cluster; 其中,当所述第一节点和所述第二节点互为邻节点时,所述第一节点将所述通信消息更新到所述第一节点的邻居表中,包括:Wherein, when the first node and the second node are adjacent nodes to each other, the first node updates the communication message to the neighbor table of the first node, including: 将所述第二节点的节点信息更新至所述第一节点的邻居表中;updating the node information of the second node to the neighbor table of the first node; 所述节点信息包括节点的位置坐标和速度坐标;相应的,所述第一节点根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,包括:The node information includes the position coordinates and velocity coordinates of the node; correspondingly, the first node determines all stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node ,include: 针对所述更新后的第一节点的邻居表中所有邻节点的每个邻节点,根据所述邻节点的速度坐标,确定所述第一节点与所述邻节点相对移动方向;For each neighbor node of all neighbor nodes in the updated neighbor table of the first node, determine the relative movement direction of the first node and the neighbor node according to the speed coordinates of the neighbor node; 根据所述邻节点的位置坐标,确定所述第一节点与所述邻节点的距离;Determine the distance between the first node and the adjacent node according to the position coordinates of the adjacent node; 若所述第一节点与所述邻节点相对移动方向小于或等于预设夹角,且所述邻节点的距离小于或等于预设距离,则根据所述邻节点的位置坐标和速度坐标,通过预设第一不等式计算,得到所述第一节点与所述邻节点之间的稳定连接时间;If the relative movement direction of the first node and the adjacent node is less than or equal to the preset angle, and the distance of the adjacent node is less than or equal to the preset distance, then according to the position coordinate and velocity coordinate of the adjacent node, pass Presetting the first inequality calculation to obtain the stable connection time between the first node and the adjacent node; 若所述稳定连接时间大于或等于预设连接时间,则确定所述邻节点为所述第一节点的稳定邻节点;If the stable connection time is greater than or equal to the preset connection time, determining that the neighbor node is a stable neighbor node of the first node; 所述计算所述第一节点的簇首代价,包括:The calculating the cluster head cost of the first node includes: 所述第一节点根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的所有稳定邻节点的平均速度和所述第一节点距离所述第一节点的所有稳定邻节点的平均距离;The first node calculates the average speed of all stable neighbors of the first node and the distance from the first node to all stable neighbors of the first node according to the node information of all stable neighbors of the first node. the average distance of nodes; 所述第一节点获取第一节点的所有稳定邻节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数;The first node obtains the number of all stable neighbor nodes of the first node, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the number of the first node whose current position is behind the first node. The number of stable neighbors of a node; 根据所述平均速度、平均距离、所有第一稳定节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数,基于预设簇首代价公式,得到所述第一节点的簇首代价;According to the average speed, average distance, the number of all first stable nodes, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the number of the first node whose current position is behind the first node The number of stable neighbor nodes of a node is based on a preset cluster head cost formula to obtain the cluster head cost of the first node; 其中,所述预设簇首代价公式为:Wherein, the preset cluster head cost formula is:
Figure FDA0002646984810000031
Figure FDA0002646984810000031
其中,i为所述第一节点,CLi为所述第一节点的簇首代价,α、β、γ可设置为不同的值,但需满足α+β+γ=1,这里Vi表示节点i的速度;
Figure FDA0002646984810000032
表示节点i的所有稳定邻节点的平均速度;Vmax表示预定义的最大速度,设置为50m/s;
Figure FDA0002646984810000033
表示节点i与其所有稳定邻节点的平均距离,Nall表示节点i所有稳定邻节点的个数,Nfront表示当前位置在节点i前方的稳定邻节点的个数,Nbehind表示当前位置在节点i后方的稳定邻节点的个数。
Among them, i is the first node, CL i is the cluster head cost of the first node, α, β, γ can be set to different values, but need to satisfy α+β+γ=1, where V i represents the speed of node i;
Figure FDA0002646984810000032
Represents the average speed of all stable neighbors of node i; Vmax represents the predefined maximum speed, which is set to 50m/s;
Figure FDA0002646984810000033
Represents the average distance between node i and all its stable neighbors, N all represents the number of all stable neighbors of node i, N front represents the number of stable neighbors whose current position is in front of node i, and N behind represents the current position of node i The number of stable neighbors behind.
2.根据权利要求1所述的方法,其特征在于,在所述计算所述第一节点的簇首代价之后,还包括:2. The method according to claim 1, wherein after the calculating the cluster head cost of the first node, the method further comprises: 若所述第一节点为簇首节点,则所述第一节点获取所述第一节点所在簇的簇成员数目以及所述更新后的第一节点的邻居表中含有目标未分簇节点的数目。If the first node is the cluster head node, the first node obtains the number of cluster members of the cluster where the first node is located and the number of target unclustered nodes contained in the updated neighbor table of the first node . 3.根据权利要求1所述的方法,其特征在于,在所述根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件之后,还包括:3. The method according to claim 1, wherein after determining whether the first node satisfies a preset condition for establishing a new cluster according to the neighbor table of the first node, the method further comprises: 若所述第一节点不满足所述新簇成立的预设条件,则所述第一节点广播信标,等待加入与所述第一节点互为稳定邻节点的一个邻节点所在簇;If the first node does not meet the preset conditions for the establishment of the new cluster, the first node broadcasts a beacon and waits to join the cluster where a neighboring node that is a stable neighboring node to the first node is located; 其中,所述新簇成立的预设条件为:所述第一节点在距离阈值范围内不存在任一簇首节点、所述更新后的第一节点的邻居表中第一节点的所有稳定邻节点中未分簇节点的的数目大于预设成簇阈值、且所述第一节点在所述所有稳定邻节点中未分簇节点中具有最小的簇首代价。The preset conditions for the establishment of the new cluster are: the first node does not have any cluster head node within the distance threshold range, and all stable neighbors of the first node in the updated neighbor table of the first node The number of unclustered nodes in the node is greater than a preset clustering threshold, and the first node has the smallest cluster head cost among the unclustered nodes among all the stable neighbor nodes. 4.根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:4. The method according to any one of claims 1-3, wherein the method further comprises: 所述第一节点在未分簇状态时,所述第一节点以第一预设时间间隔为周期广播信标;When the first node is in an unclustered state, the first node broadcasts a beacon periodically at a first preset time interval; 在所述第一节点加入一个簇后,所述第一节点获取所述第一节点所在簇的簇首节点的速度;After the first node joins a cluster, the first node obtains the speed of the cluster head node of the cluster where the first node is located; 所述第一节点根据所述第一节点所在簇的簇首节点的速度以及预设信标周期阈值表,确定所述第一节点发送所述信标的信标周期;The first node determines the beacon period during which the first node sends the beacon according to the speed of the cluster head node of the cluster where the first node is located and a preset beacon period threshold table; 所述第一节点根据所述信标周期广播信标。The first node broadcasts a beacon according to the beacon period. 5.一种适合高动态大规模车联网的分簇装置,其特征在于,包括:5. A clustering device suitable for high dynamic large-scale Internet of Vehicles, is characterized in that, comprising: 邻居表更新模块,用于接收第二节点发送的通信消息,将所述通信消息更新到第一节点的邻居表中;a neighbor table update module, configured to receive a communication message sent by the second node, and update the communication message to the neighbor table of the first node; 稳定邻节点确定模块,用于根据更新后的第一节点的邻居表中所有邻节点的节点信息,确定所述第一节点的所有稳定邻节点,所述第一节点的稳定邻节点为所述更新后的第一节点的邻居表中与所述第一节点互为稳定邻居的节点;The stable neighbor node determination module is configured to determine all the stable neighbor nodes of the first node according to the node information of all neighbor nodes in the updated neighbor table of the first node, and the stable neighbor nodes of the first node are the Nodes that are mutually stable neighbors with the first node in the updated neighbor table of the first node; 簇首代价计算模块,用于根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的簇首代价;a cluster head cost calculation module, configured to calculate the cluster head cost of the first node according to the node information of all stable neighbor nodes of the first node; 簇首切换模块,用于在所述第一节点为簇首节点,且根据所述第一节点的簇首代价,确定所述第一节点符合簇内簇首切换的预设条件或簇间簇首切换的预设条件时,则确定一个待确定簇首节点,且所述第一节点解散所述第一节点所在簇,其中,待确定簇首节点满足新簇成立的预设条件时成立新的簇,且簇内簇首切换或簇间簇首切换时,成立新的簇的簇首是在距离阈值范围内具有最小簇首代价值的节点;A cluster head switching module, configured to determine that the first node complies with the preset conditions for intra-cluster switching or inter-cluster switching according to the cluster head cost of the first node when the first node is the cluster head When the preset condition of the first switch is used, a cluster head node to be determined is determined, and the first node dissolves the cluster where the first node is located, wherein a new cluster is established when the cluster head node to be determined satisfies the preset conditions for the establishment of a new cluster When the cluster head is switched within the cluster or the cluster head is switched between the clusters, the cluster head of the new cluster is the node with the smallest cluster head generation value within the distance threshold range; 簇解散模块,用于在所述第一节点为簇首节点,且所述第一节点所在簇的簇成员数目与所述更新后的第一节点的邻居表中含有目标未分簇节点的数目之和小于预设簇解散规模阈值时,对所述第一节点广播解散簇的消息,所述目标未分簇节点为与所述第一节点互为稳定邻节点的未分簇节点;A cluster disbanding module, configured to include the number of target unclustered nodes in the updated neighbor table of the first node when the first node is a cluster head node, and the number of cluster members of the cluster where the first node is located and the updated neighbor table of the first node When the sum is smaller than the preset cluster disbanding scale threshold, broadcast a message of disbanding the cluster to the first node, and the target unclustered node is an unclustered node that is a stable neighbor to the first node; 簇首变更模块,用于在所述第一节点为簇成员节点,且根据所述第一节点的簇首代价,确定所述第一节点与所述第一节点所在簇内的簇首节点不满足互为稳定邻节点的距离或者角度的条件时,所述第一节点变更所述第一节点对应的簇首节点;The cluster head change module is used to determine whether the first node is different from the cluster head node in the cluster where the first node is located according to the cluster head cost of the first node when the first node is a cluster member node. The first node changes the cluster head node corresponding to the first node when the condition of being a distance or an angle of mutually stable adjacent nodes is satisfied; 加入簇申请模块,用于在所述第一节点为未分簇节点,且确定所述第一节点的邻居表中存在目标簇首节点时,发送申请加入请求,用以申请加入所述目标簇首节点所在簇;A cluster joining application module is used to send an application joining request to apply for joining the target cluster when the first node is an unclustered node and it is determined that the target cluster head node exists in the neighbor table of the first node The cluster where the first node is located; 新簇成立模块,用于在所述第一节点为未分簇节点,且确认所述第一节点的邻居表中不存在目标簇首节点时,根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件,在所述第一节点符合所述新簇成立的预设条件时,将所述第一节点作为新簇的簇首节点;The new cluster establishment module is used to determine the first node according to the neighbor table of the first node when the first node is an unclustered node and it is confirmed that the target cluster head node does not exist in the neighbor table of the first node. Whether the first node satisfies the preset condition for the establishment of the new cluster, and when the first node meets the preset condition for the establishment of the new cluster, the first node is used as the cluster head node of the new cluster; 其中,当所述第一节点和所述第二节点互为邻节点时,所述邻居表更新模块具体用于:Wherein, when the first node and the second node are adjacent nodes to each other, the neighbor table updating module is specifically used for: 将所述第二节点的节点信息更新至所述第一节点的邻居表中;updating the node information of the second node to the neighbor table of the first node; 所述节点信息包括节点的位置坐标和速度坐标;相应的,所述稳定邻节点确定模块,具体用于:The node information includes the position coordinates and velocity coordinates of the node; correspondingly, the stable neighbor node determination module is specifically used for: 针对所述更新后的第一节点的邻居表中所有邻节点的每个邻节点,根据所述邻节点的速度坐标,确定所述第一节点与所述邻节点相对移动方向;For each neighbor node of all neighbor nodes in the updated neighbor table of the first node, determine the relative movement direction of the first node and the neighbor node according to the speed coordinates of the neighbor node; 根据所述邻节点的位置坐标,确定所述第一节点与所述邻节点的距离;Determine the distance between the first node and the adjacent node according to the position coordinates of the adjacent node; 若所述第一节点与所述邻节点相对移动方向小于或等于预设夹角,且所述邻节点的距离小于或等于预设距离,则根据所述邻节点的位置坐标和速度坐标,通过预设第一不等式计算,得到所述第一节点与所述邻节点之间的稳定连接时间;If the relative movement direction of the first node and the adjacent node is less than or equal to the preset angle, and the distance of the adjacent node is less than or equal to the preset distance, then according to the position coordinate and velocity coordinate of the adjacent node, pass Presetting the first inequality calculation to obtain the stable connection time between the first node and the adjacent node; 若所述稳定连接时间大于或等于预设连接时间,则确定所述邻节点为所述第一节点的稳定邻节点;If the stable connection time is greater than or equal to the preset connection time, determining that the neighbor node is a stable neighbor node of the first node; 所述簇首代价计算模块具体用于:根据所述第一节点的所有稳定邻节点的节点信息,计算所述第一节点的所有稳定邻节点的平均速度和所述第一节点距离所述第一节点的所有稳定邻节点的平均距离;The cluster head cost calculation module is specifically configured to: according to the node information of all stable neighbor nodes of the first node, calculate the average speed of all stable neighbor nodes of the first node and the distance from the first node to the first node. The average distance of all stable neighbors of a node; 所述第一节点获取第一节点的所有稳定邻节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数;The first node obtains the number of all stable neighbor nodes of the first node, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the number of the first node whose current position is behind the first node. The number of stable neighbors of a node; 根据所述平均速度、平均距离、所有第一稳定节点的个数、当前位置在所述第一节点前方的第一节点的稳定邻节点的个数以及当前位置在所述第一节点后方的第一节点的稳定邻节点的个数,基于预设簇首代价公式,得到所述第一节点的簇首代价;According to the average speed, average distance, the number of all first stable nodes, the number of stable neighbor nodes of the first node whose current position is in front of the first node, and the number of the first node whose current position is behind the first node The number of stable neighbor nodes of a node is based on a preset cluster head cost formula to obtain the cluster head cost of the first node; 其中,所述预设簇首代价公式为:Wherein, the preset cluster head cost formula is:
Figure FDA0002646984810000051
Figure FDA0002646984810000051
其中,i为所述第一节点,CLi为所述第一节点的簇首代价,α、β、γ可设置为不同的值,但需满足α+β+γ=1,这里Vi表示节点i的速度;
Figure FDA0002646984810000061
表示节点i的所有稳定邻节点的平均速度;Vmax表示预定义的最大速度,设置为50m/s;
Figure FDA0002646984810000062
表示节点i与其所有稳定邻节点的平均距离,Nall表示节点i所有稳定邻节点的个数,Nfront表示当前位置在节点i前方的稳定邻节点的个数,Nbehind表示当前位置在节点i后方的稳定邻节点的个数。
Among them, i is the first node, CL i is the cluster head cost of the first node, α, β, γ can be set to different values, but need to satisfy α+β+γ=1, where V i represents the speed of node i;
Figure FDA0002646984810000061
Represents the average velocity of all stable neighbors of node i; Vmax represents the predefined maximum velocity, which is set to 50m/s;
Figure FDA0002646984810000062
Represents the average distance between node i and all its stable neighbors, N all represents the number of all stable neighbors of node i, N front represents the number of stable neighbors whose current position is in front of node i, and N behind represents the current position of node i The number of stable neighbors behind.
6.根据权利要求5所述的装置,其特征在于,所述装置还包括:数目获取模块;6. The device according to claim 5, wherein the device further comprises: a number acquisition module; 所述数目获取模块,用于在计算所述第一节点的簇首代价之后,且在所述第一节点为簇首节点时,获取所述第一节点所在簇的簇成员数目以及所述更新后的第一节点的邻居表中含有目标未分簇节点的数目。The number acquisition module is configured to acquire the number of cluster members of the cluster where the first node is located and the update when the first node is a cluster head node after calculating the cluster head cost of the first node The neighbor table of the next first node contains the number of target unclustered nodes. 7.根据权利要求5所述的装置,其特征在于,所述装置还包括:广播模块;7. The apparatus according to claim 5, wherein the apparatus further comprises: a broadcasting module; 所述广播模块,用于在根据所述第一节点的邻居表,确定所述第一节点是否满足新簇成立的预设条件之后,且在所述第一节点不满足所述新簇成立的预设条件时,广播信标,等待加入与所述第一节点互为邻节点的一个邻节点所在簇;The broadcast module is configured to determine whether the first node satisfies the preset condition for the establishment of a new cluster according to the neighbor table of the first node, and after the first node does not meet the condition for the establishment of the new cluster. When the preset condition is set, a beacon is broadcast, waiting to join the cluster where a neighbor node is mutually adjacent to the first node; 其中,所述新簇成立的预设条件为:所述第一节点在距离阈值范围内不存在任一簇首节点、所述更新后的第一节点的邻居表中第一节点的所有稳定邻节点中未分簇节点的的数目大于预设成簇阈值、且所述第一节点在所述所有稳定邻节点中未分簇节点中具有最小的簇首代价。The preset conditions for the establishment of the new cluster are: the first node does not have any cluster head node within the distance threshold range, and all stable neighbors of the first node in the updated neighbor table of the first node The number of unclustered nodes in the node is greater than a preset clustering threshold, and the first node has the smallest cluster head cost among the unclustered nodes among all the stable neighbor nodes. 8.一种适合高动态大规模车联网的分簇设备,其特征在于,包括:至少一个处理器和存储器;8. A clustering device suitable for high dynamic large-scale Internet of Vehicles, characterized in that, comprising: at least one processor and a memory; 所述存储器存储计算机执行指令;the memory stores computer-executable instructions; 所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求1至4任一项所述的适合高动态大规模车联网的分簇方法。The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the clustering method suitable for a high-dynamic large-scale Internet of Vehicles according to any one of claims 1 to 4.
CN201910912214.9A 2019-09-25 2019-09-25 Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles Active CN110662182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910912214.9A CN110662182B (en) 2019-09-25 2019-09-25 Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910912214.9A CN110662182B (en) 2019-09-25 2019-09-25 Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles

Publications (2)

Publication Number Publication Date
CN110662182A CN110662182A (en) 2020-01-07
CN110662182B true CN110662182B (en) 2020-10-13

Family

ID=69039129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910912214.9A Active CN110662182B (en) 2019-09-25 2019-09-25 Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles

Country Status (1)

Country Link
CN (1) CN110662182B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207572A (en) * 2007-12-14 2008-06-25 北京科技大学 A clustering method for vehicle-mounted Ad hoc networks based on signal strength
CN102307373A (en) * 2011-08-23 2012-01-04 哈尔滨工业大学 VANET clustering method taking regard of vehicle traffic characteristic
CN103781148A (en) * 2014-02-25 2014-05-07 重庆邮电大学 Stable clustering routing method based on link perception in vehicle-mounted self-organizing network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110121200B (en) * 2019-05-09 2020-08-11 江南大学 An Energy Efficient Networking Method in Heterogeneous Sensor Networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207572A (en) * 2007-12-14 2008-06-25 北京科技大学 A clustering method for vehicle-mounted Ad hoc networks based on signal strength
CN102307373A (en) * 2011-08-23 2012-01-04 哈尔滨工业大学 VANET clustering method taking regard of vehicle traffic characteristic
CN103781148A (en) * 2014-02-25 2014-05-07 重庆邮电大学 Stable clustering routing method based on link perception in vehicle-mounted self-organizing network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Dynamic Clustering and Cooperative Scheduling for Vehicle-to-Vehicle Communication in Bidirectional Road Scenarios;Junhua Wang等;《IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS》;20180630;第19卷(第6期);第1913-1923页 *

Also Published As

Publication number Publication date
CN110662182A (en) 2020-01-07

Similar Documents

Publication Publication Date Title
Ren et al. A mobility-based scheme for dynamic clustering in vehicular ad-hoc networks (VANETs)
Ren et al. A unified framework of clustering approach in vehicular ad hoc networks
Ucar et al. Multihop-cluster-based IEEE 802.11 p and LTE hybrid architecture for VANET safety message dissemination
EP1677473B1 (en) Ad hoc communication system and method for routing speech packets therein
CN100442786C (en) Routing Method Based on Tree Structure
CN107343024B (en) Centralized vehicle networking MAC layer merging collision prediction and avoidance method
CN104125620A (en) Relay selection routing method and relay selection routing device based on terminal device-to-device communication
CN107071843A (en) Mobile self-organizing network cluster dividing method
Narayanan et al. Vehicle-to-vehicle (v2v) communication using routing protocols: a review
CN102883403A (en) Construction method for mobile ad hoc network
Turcanu et al. An integrated vanet-based data dissemination and collection protocol for complex urban scenarios
Chiti et al. Context aware clustering in VANETs: A game theoretic perspective
Jemaa et al. Extended mobility management and routing protocols for internet-to-VANET multicasting
CN106658635A (en) Hierarchical routing method based on service quality in wireless multi-hop network
Huang et al. A new distributed mobility-based multi-hop clustering algorithm for vehicular ad hoc networks in highway scenarios
CN110662182B (en) Clustering method, device and equipment suitable for high-dynamic large-scale Internet of vehicles
CN109803342A (en) A kind of unmanned plane method for self-organizing network routing towards balancing energy highly-reliable transmission
Francis et al. Performance analysis of clustering protocols in mobile ad hoc networks
KR101371651B1 (en) A method for constructing a tree in mobile ad hoc network
Tan et al. Clustering algorithm in vehicular ad-hoc networks: A brief summary
Zheng et al. Cooperative data delivery in sparse cellular-VANET networks
Chen et al. Dynamic local peer group organizations for vehicle communications
Lu et al. An adaptive routing algorithm for two-tier traffic information system
Dixit et al. Location information based destination converging routing method (LIBDCR)
Li et al. Improved MAODV link repair technique for group team communication in MANET

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant