WO2018023971A1 - Method and apparatus for determining cooperating node - Google Patents

Method and apparatus for determining cooperating node Download PDF

Info

Publication number
WO2018023971A1
WO2018023971A1 PCT/CN2017/075360 CN2017075360W WO2018023971A1 WO 2018023971 A1 WO2018023971 A1 WO 2018023971A1 CN 2017075360 W CN2017075360 W CN 2017075360W WO 2018023971 A1 WO2018023971 A1 WO 2018023971A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
information
encoding
coded
bit
Prior art date
Application number
PCT/CN2017/075360
Other languages
French (fr)
Chinese (zh)
Inventor
杨坤
吴昊
刘松洁
任婧
Original Assignee
中兴通讯股份有限公司
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
Priority claimed from CN201610977531.5A external-priority patent/CN107689883B/en
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP17836156.4A priority Critical patent/EP3496367B1/en
Priority to US16/321,993 priority patent/US10764373B2/en
Publication of WO2018023971A1 publication Critical patent/WO2018023971A1/en
Priority to US17/004,750 priority patent/US20200396293A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Abstract

The present invention provides a method and apparatus for determining a cooperating node. The method comprises: when it needs to allocate a cooperating node to a target node, obtaining first location information of the target node; and selecting a coordinating node meeting a preset location requirement for the target node from multiple nodes on the basis of the first location information, the multiple nodes and the target node being located in the same network, and the preset location requirement being that the target node and the cooperating node do not have a common parent node, or have a lowest-level common parent node closest to the root node. The present invention solves the technical problem in the related art that data backup and data recovery cannot be conducted when the node fails.

Description

协同节点的确定方法和装置Method and device for determining cooperative node 技术领域Technical field
本申请涉及通信领域,具体而言,涉及一种协同节点的确定方法和装置。The present application relates to the field of communications, and in particular, to a method and apparatus for determining a coordinated node.
背景技术Background technique
随着物联网技术应用范围的逐渐扩大,出现了越来越多地域跨度较大的“泛在/物联网络”。为了覆盖这些跨度较大的泛在网络,通常需要同时使用多个网关进行数据的采集和传输。这些网关可利用运营商网络或其它专用网络进行互联。由于泛在/物联网络环境复杂,终端设备通常无人值守,故存在通信不稳定的情况,为了提高信息传输的可靠性,满足物联网应用的需求,通常需要选择协同节点实现数据的冗余备份和恢复,从而促进网络高效数据传输,实现网络安全性及通信可靠性,满足特定应用需求的核心内容。With the gradual expansion of the application scope of the Internet of Things technology, there has been a growing number of “ubiquitous/intermediary networks” with a large geographical span. In order to cover these ubiquitous networks with large spans, it is usually necessary to use multiple gateways simultaneously for data collection and transmission. These gateways can be interconnected using a carrier network or other private network. Due to the complexity of the ubiquitous/intermediary network environment, terminal equipment is usually unattended, so there is a situation of unstable communication. In order to improve the reliability of information transmission and meet the needs of IoT applications, it is usually necessary to select cooperative nodes to achieve data redundancy. Backup and recovery, which promotes efficient network data transmission, achieves network security and communication reliability, and meets the core content of specific application requirements.
例如,经济的高速发展和城市的快速扩张使得能源紧张的问题日益严峻,作为重大的能源技术改革,智能电网已成为目前各国的重要研究热点,智能电网通过监测用电负荷,制订供电计划和价格调节方案,确保电力用电的安全性、可靠性和经济性。因此,电网系统的安全运行是智能电网需要解决的首要问题。当电网中某些电力设备因为负荷过重跳闸,或因为自然或人为因素遭到破坏时,智能电网需要及时判断出现故障的原因,但由于目前智能电网采用中心式结构,采集的数据定时上报管理中心,当某个电力设备出现问题时,需要等待一段时间才能发现此问题。且由于采集数据丢失,将无法判断是何种原因导致的问题。因此需要协同节点之间相互备份数据,并且在发现协同节点无法连接时,代替协同节点主动上报管理中心出现故障,并将之前备份的采集数据上报。For example, the rapid development of the economy and the rapid expansion of the city have made the problem of energy shortage increasingly serious. As a major energy technology reform, the smart grid has become an important research hotspot in the current country. The smart grid develops power supply plans and prices by monitoring the power load. The adjustment scheme ensures the safety, reliability and economy of electricity use. Therefore, the safe operation of the grid system is the primary problem that the smart grid needs to solve. When some power equipment in the power grid trips due to excessive load, or is damaged due to natural or human factors, the smart grid needs to judge the cause of the fault in time, but because the current smart grid adopts a central structure, the collected data is regularly reported and managed. Center, when there is a problem with a power device, it takes a while to discover the problem. And because the collected data is lost, it will be impossible to determine the cause of the problem. Therefore, the collaborative nodes need to back up data with each other, and when the collaborative node is found to be unable to connect, the collaborative node is reported to the management center to report the fault and the previously collected data is reported.
在传统协同节点的选择中,主要考虑协同节点之间的跳数或者物理距离等,但没有考虑到同一失效场景可能对多个协同节点产生影响,导致两个协同节点均与主网络隔离,进而无法保证通信的完成,不能进行数据的 备份和恢复。In the choice of traditional cooperative nodes, the hop count or physical distance between the cooperative nodes is mainly considered, but the same failure scenario may be considered to affect multiple cooperative nodes, so that the two cooperative nodes are isolated from the primary network. Unable to guarantee the completion of communication, can not carry out data Backup and recovery.
针对相关技术中节点发生故障时无法进行数据备份和数据恢复的技术问题,目前尚未提出有效的解决方案。In view of the technical problems that data backup and data recovery cannot be performed when a node fails in the related art, an effective solution has not been proposed yet.
发明内容Summary of the invention
本申请提供了一种协同节点的确定方法和装置,以至少解决相关技术中节点发生故障时无法进行数据备份和数据恢复的技术问题。The present application provides a method and apparatus for determining a cooperative node to at least solve the technical problem that data backup and data recovery cannot be performed when a node fails in the related art.
根据本申请的一个方面,提供了一种协同节点的确定方法,该方法包括:在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。According to an aspect of the present application, a method for determining a coordinated node is provided, the method comprising: acquiring first location information of a target node when a coordinated node needs to be allocated to a target node; and from a plurality of nodes based on the first location information Selecting a collaborative node that meets the preset location requirement for the target node, where multiple nodes and target nodes are located in the same network, and the preset location requirement means that the target node and the coordinated node do not have a common parent node or have a lowest level The common parent node is closest to the root node.
可选地,基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点包括:获取多个节点的多个第二位置信息,其中,多个节点中的每个节点具有一个第二位置信息;根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点。Optionally, selecting, according to the first location information, the coordinated node that meets the preset location requirement for the target node from the multiple nodes includes: acquiring a plurality of second location information of the multiple nodes, where each of the multiple nodes Having a second location information; selecting, from the plurality of nodes, the node that meets the preset location requirement according to the plurality of second location information and the first location information is a coordinated node.
可选地,根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点包括:获取用于表示第一位置信息的第一编码信息和用于表示多个第二位置信息的多个第二编码信息;从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息;将与目标编码信息对应的节点作为协同节点。Optionally, selecting, as the coordinated node, the node that meets the preset location requirement from the multiple nodes according to the multiple second location information and the first location information includes: acquiring first coding information for indicating the first location information, and for using a plurality of second encoding information indicating a plurality of second location information; comparing each of the first encoding information and the plurality of second encoding information from a high bit, searching for a plurality of second encoding information from a high bit and a first encoding The information does not continuously overlap the target coding information with the largest number of coded bits; the node corresponding to the target coding information is used as the coordination node.
可选地,从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息包括:确定第一编码信息的编码位数M;判断第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;在判断出多个第二编码信息中存在编码位数为M的第二编码信息的情 况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息;在判断出多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息失败时,获取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与第一编码信息的高(M-2)位编码不同的目标编码信息;在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与第一编码信息的高(M-N-1)位编码不同的目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与第一编码信息的高(M-N-2)位编码不同的目标编码信息,其中,N为大于0且小于(M-1)的正整数。Optionally, comparing the first coding information and each of the plurality of second coding information from a high bit, searching for a target code that has the largest number of consecutive coding bits from the upper bits and the first coding information from the upper bits. The information includes: determining a coded bit number M of the first coded information; determining whether the second coded information having the coded bit number M exists in the plurality of second coded information of the second position information; and determining the plurality of second coded information There is a second encoded information with a coded bit number M In the case where the high (M-1) bit code of the one or more second coded information having the coded number of bits is obtained, the target coded information different from the high (M-1) bit code in the first coded information is obtained; In the case where the second coded information having the coded bit number M does not exist in the second coded information, or in the execution step, the high (M-1) bit code and the first one or more pieces of the second coded information having the coded bit number M are obtained. When the high (M-1) bits of the coded information fail to encode different target coded information, the high (M-2) bit code and the first code of the one or more second coded information having the coded bit number (M-1) are obtained. The high (M-2) bits of the information encode different target encoding information; in the performing step, the high (MN-1) bit encoding and the first encoding information are obtained in one or more second encoding information having a coded bit number (MN) When the high (MN-1) bit fails to encode different target coding information, the high (MN-2) bit code and the first coded information in the one or more second coded information having the coded bit number (MN-1) are obtained. The (MN-2) bit encodes different target coding information, where N is a positive integer greater than 0 and less than (M-1).
可选地,在基于第一位置信息从多个节点中为目标节点选取协同节点之后,该方法还包括:在同一网络中新增节点时,获取同一网络中不存在最优协同节点的第一节点,其中,任一节点的最优协同节点是指编码位数与任一节点的编码位数相同且高(M-1)位编码与任一节点的高(M-1)位编码不同的节点,M为任一节点的编码位数。Optionally, after selecting a coordinated node for the target node from the multiple nodes based on the first location information, the method further includes: when adding a node in the same network, acquiring the first that the optimal cooperative node does not exist in the same network. Node, where the optimal cooperative node of any node means that the coded bits are the same as the coded bits of any node and the high (M-1) bit code is different from the high (M-1) bit code of any node. Node, M is the number of coded bits of any node.
可选地,在基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点之后,或,在重新为第一节点分配协同节点之后,同一网络中的每个节点至多具有两个协同节点。Optionally, after selecting a coordinated node that meets the preset location requirement for the target node from the multiple nodes based on the first location information, or after re-assigning the coordinated node to the first node, each node in the same network at most Has two collaborative nodes.
可选地,在获取目标节点的第一位置信息之后,该方法还包括:为同一网络中的每个节点配置编码信息。Optionally, after acquiring the first location information of the target node, the method further includes: configuring coding information for each node in the same network.
可选地,为同一网络中的每个节点配置编码信息包括:获取对应于同一网络的树形网络,为树形网络中的第二级节点配置的编码信息为Ni,i为第二级节点的编码,i为正整数,第二级节点为树形网络中根节点的子节点;为树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。Optionally, configuring the coding information for each node in the same network includes: acquiring a tree network corresponding to the same network, where the coding information configured for the second level node in the tree network is Ni, and i is the second level node. Coding, i is a positive integer, the second-level node is a child node of the root node in the tree network; the coding information configured for the j-th node in the tree network is Nkp, where j is a positive integer greater than 2, k Is the encoding of the parent node of the jth node, p is a positive integer.
可选地,同一网络中的节点为终端或者网关。 Optionally, the nodes in the same network are terminals or gateways.
可选地,本申请的协同节点的确定方法应用于上述的同一网络中的任一节点。Optionally, the determining method of the cooperative node of the present application is applied to any node in the same network described above.
根据本申请的另一个方面,提供了一种协同节点的确定装置,该装置包括:第一获取单元,用于在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;选取单元,用于基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。According to another aspect of the present application, a determining apparatus for a cooperative node is provided, the apparatus comprising: a first acquiring unit, configured to acquire first location information of a target node when a coordinated node needs to be allocated to a target node; And selecting, according to the first location information, a coordinated node that meets a preset location requirement from the plurality of nodes, wherein the multiple nodes and the target node are located in the same network, and the preset location requirement refers to the target node and the coordinated node. A common parent node that does not have a common parent node or has the lowest level is closest to the root node.
可选地,选取单元包括:获取模块,用于获取多个节点的多个第二位置信息,其中,多个节点中的每个节点具有一个第二位置信息;选取模块,用于根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点。Optionally, the selecting unit includes: an acquiring module, configured to acquire multiple second location information of the multiple nodes, where each node of the multiple nodes has one second location information; and a selection module, configured to use multiple The second location information and the first location information select a node that meets the preset location requirement from the plurality of nodes as the collaboration node.
可选地,选取模块包括:第一获取子模块,用于获取用于表示第一位置信息的第一编码信息和用于表示多个第二位置信息的多个第二编码信息;查找子模块,用于从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息;操作子模块,用于将与目标编码信息对应的节点作为协同节点。Optionally, the selecting module includes: a first acquiring submodule, configured to acquire first encoding information for indicating first location information and multiple second encoding information for indicating multiple second location information; and searching submodule For comparing the first coding information and the multiple coding codes of the plurality of second coding information from the upper bits, searching for the target coding information that has the largest number of coding bits from the upper bits and the first coding information from the upper bits. An operation submodule for using a node corresponding to the target coding information as a coordination node.
可选地,查找子模块包括:确定子模块,用于确定第一编码信息的编码位数M;判断子模块,用于判断第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;第二获取子模块,用于在判断出多个第二编码信息中存在编码位数为M的第二编码信息的情况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息;第三获取子模块,用于在判断出多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息失败时,获 取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与第一编码信息的高(M-2)位编码不同的目标编码信息;第四获取子模块,用于在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与第一编码信息的高(M-N-1)位编码不同的目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与第一编码信息的高(M-N-2)位编码不同的目标编码信息,其中,N为大于0且小于(M-1)的正整数。Optionally, the determining submodule includes: a determining submodule, configured to determine a coded bit number M of the first coded information; and a determining submodule, configured to determine whether the number of coded bits exists in the plurality of second coded information of the second location information a second encoding information that is M; and a second obtaining sub-module, configured to: when it is determined that the second encoding information with the number of encoding bits is M in the plurality of second encoding information, obtain one or The high (M-1) bits of the plurality of second encoding information encode target encoding information different from the high (M-1) bit encoding in the first encoding information; and the third obtaining submodule is configured to determine the plurality of second encoding information In the case where the second coded information having the coded bit number M does not exist, or in the step of performing the step of obtaining the high (M-1) bit code and the first coded information in the one or more pieces of the second coded information having the coded bit number M (M-1) bit when encoding different target encoding information fails, Taking the high (M-2) bit encoding of the one or more second encoding information having the coded bit number (M-1) to be different from the high (M-2) bit encoding of the first encoding information; the fourth obtaining a submodule, configured to obtain, in the performing step, a target in which the high (MN-1) bit code is different from the high (MN-1) bit code of the first coded information in the one or more second coded information having the coded bit number (MN) When the coding information fails, obtaining a target code having a high (MN-2) bit code different from the high (MN-2) bit code of the first coded information in one or more second coded information having a coded bit number of (MN-1) Information, where N is a positive integer greater than 0 and less than (M-1).
可选地,该装置还包括:第二获取单元,用于在基于第一位置信息从多个节点中为目标节点选取协同节点之后,在同一网络中新增节点时,获取同一网络中不存在最优协同节点的第一节点,其中,任一节点的最优协同节点是指编码位数与任一节点的编码位数相同且高(M-1)位编码与任一节点的高(M-1)位编码不同的节点,M为任一节点的编码位数。Optionally, the device further includes: a second acquiring unit, configured to: when the node is added to the target node from the plurality of nodes based on the first location information, when the node is added in the same network, the acquiring does not exist in the same network The first node of the optimal cooperative node, wherein the optimal cooperative node of any node means that the coded number of bits is the same as the coded number of bits of any node and the high (M-1) bit code is high with any node (M -1) The bit encodes a different node, and M is the number of coded bits of any node.
可选地,同一网络中的每个节点至多具有两个协同节点。Optionally, each node in the same network has at most two cooperating nodes.
可选地,该装置还包括:配置单元,用于在获取目标节点的第一位置信息之后,为同一网络中的每个节点配置编码信息。Optionally, the device further includes: a configuration unit, configured to configure coding information for each node in the same network after acquiring the first location information of the target node.
可选地,配置单元包括:第一配置模块,用于获取对应于同一网络的树形网络,为树形网络中的第二级节点配置的编码信息为Ni,i为第二级节点的编码,i为正整数,第二级节点为树形网络中根节点的子节点;第二配置模块,用于为树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。Optionally, the configuration unit includes: a first configuration module, configured to acquire a tree network corresponding to the same network, where the coding information configured for the second level node in the tree network is Ni, and the code of the second level node is , i is a positive integer, the second level node is a child node of the root node in the tree network; the second configuration module is configured to encode the information of the jth level node in the tree network as Nkp, where j is greater than 2 Positive integer, k is the encoding of the parent node of the jth node, and p is a positive integer.
可选地,树形网络中的节点为终端或者网关。Optionally, the nodes in the tree network are terminals or gateways.
根据本申请的另一个实施例,提供了一种存储介质,存储介质可以被设置为存储用于执行以下步骤的程序代码:在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。 According to another embodiment of the present application, there is provided a storage medium configurable to store program code for performing the following steps: acquiring first location information of a target node when a coordinated node needs to be assigned to a target node And selecting, according to the first location information, a coordinated node that meets a preset location requirement for the target node from the plurality of nodes, where the multiple nodes and the target node are located in the same network, and the preset location requirement means that the target node and the coordinated node do not have The common parent node or the lowest parent of the lowest level is closest to the root node.
在本申请中,在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点,从而解决了相关技术中节点发生故障时无法进行数据备份和数据恢复的技术问题,降低了故障对数据备份和数据恢复的影响。In the present application, when it is required to allocate a coordinated node to the target node, the first location information of the target node is acquired; and the coordinated node that meets the preset location requirement is selected from the plurality of nodes for the target node based on the first location information, where The node and the target node are located in the same network. The preset location requirement means that the target node and the coordinated node do not have a common parent node or have the lowest level of the common parent node closest to the root node, thereby solving the node occurrence in the related art. The technical problems of data backup and data recovery cannot be performed in the event of a failure, which reduces the impact of failure on data backup and data recovery.
附图说明DRAWINGS
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1是根据本申请的一种终端设备的示意图;1 is a schematic diagram of a terminal device according to the present application;
图2是根据本申请的协同节点的确定方法的流程图;2 is a flowchart of a method for determining a collaboration node according to the present application;
图3是根据本申请的可选的协同节点的确定方法的流程图;3 is a flow chart of a method of determining an optional cooperative node in accordance with the present application;
图4是根据本申请的可选的树形网络结构的示意图;4 is a schematic diagram of an alternative tree network structure in accordance with the present application;
图5是根据本申请的可选的协同节点的确定方法的流程图;5 is a flow chart of a method of determining an optional cooperative node in accordance with the present application;
图6是根据本申请的可选的树形网络结构的示意图;6 is a schematic diagram of an alternative tree network structure in accordance with the present application;
图7是根据本申请的可选的协同节点的确定方法的流程图;7 is a flow chart of a method of determining an optional cooperative node in accordance with the present application;
图8是根据本申请的协同节点的确定装置的示意图。FIG. 8 is a schematic diagram of a determining device of a cooperative node according to the present application.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The present application will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。 It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or order.
实施例1Example 1
本申请实施例一所提供的方法实施例可以在终端设备、网关或者类似的运算装置中执行。以运行在终端设备上为例,如图1所示,终端设备可以包括一个或多个(图中仅示出一个)处理器101(处理器101可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器103、以及用于通信功能的传输装置105。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。The method embodiment provided in Embodiment 1 of the present application can be executed in a terminal device, a gateway, or the like. For example, running on a terminal device, as shown in FIG. 1, the terminal device may include one or more (only one shown) processor 101 (the processor 101 may include, but is not limited to, a microprocessor MCU or programmable A processing device such as a logic device FPGA, a memory 103 for storing data, and a transmission device 105 for communication functions. It will be understood by those skilled in the art that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
存储器103可用于存储应用软件的软件程序以及模块,如本申请中的设备的控制方法对应的程序指令/模块,处理器101通过运行存储在存储器103内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 103 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the control method of the device in the present application, and the processor 101 executes various functions by running software programs and modules stored in the memory 103. Application and data processing, that is, the above method is implemented. The memory can include high speed random access memory and can also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory can further include memory remotely located relative to the processor, the remote memory being connectable to the terminal device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置用于经由一个网络接收或者发送数据。上述的网络具体实例可包括终端设备的通信供应商提供的无线网络。在一个实例中,传输装置包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device is for receiving or transmitting data via a network. The above specific network example may include a wireless network provided by a communication provider of the terminal device. In one example, the transmission device includes a Network Interface Controller (NIC) that can be connected to other network devices through the base station to communicate with the Internet. In one example, the transmission device can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
相关技术中常选择两个物理距离最近或者较近的节点互为协同节点,例如,ZigBee协议规定两个节点在一跳范围之内可以直接进行通信的则互为协同节点;IPv6协议规定两个直接通过共享介质或点对点链路连接的两个节点互为协同节点;此外,还有6LoWPAN协议等等。In the related art, two nodes with the closest or closest physical distance are often selected as cooperative nodes. For example, the ZigBee protocol stipulates that two nodes can communicate directly within one hop range, and each other is a cooperative node; the IPv6 protocol specifies two direct The two nodes connected by the shared medium or the point-to-point link are mutually cooperative nodes; in addition, there are 6LoWPAN protocols and the like.
上述方案几乎都是使用跳数或物理距离作为选择邻居的标准,在这种 选择方式下获得的邻居(即协同节点)只能保证邻居间的信息传输较直接简单、延迟较低,由于在网络异常时两个互为邻居的节点同时受到波及的可能性较大,因此,在使用这种邻居选择方法时,若发生故障,会影响到数据备份和数据恢复。Almost all of the above schemes use hop count or physical distance as the criteria for selecting neighbors. The neighbors obtained in the selection mode (ie, the cooperative node) can only ensure that the information transmission between the neighbors is relatively simple and the delay is low. Therefore, when the network is abnormal, the two neighboring nodes are more likely to be affected at the same time. When using this neighbor selection method, if a failure occurs, it will affect data backup and data recovery.
为了解决上述问题,根据本申请,提供了一种协同节点的确定方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。In order to solve the above problems, according to the present application, a method embodiment of a method for determining a cooperative node is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings may be in a computer system such as a set of computer executable instructions. The execution is performed, and although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
图2是根据本申请的协同节点的确定方法的流程图,如图2所示,该方法包括如下步骤:2 is a flowchart of a method for determining a coordinated node according to the present application. As shown in FIG. 2, the method includes the following steps:
步骤S201,在需要为目标节点分配协同节点时,获取目标节点的第一位置信息。Step S201: When the coordinated node needs to be allocated to the target node, the first location information of the target node is obtained.
步骤S202,基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。Step S202: Select, according to the first location information, a coordinated node that meets the preset location requirement from the plurality of nodes, where the multiple nodes and the target node are located in the same network, and the preset location requirement means that the target node and the coordinated node do not have The common parent node or the lowest parent of the lowest level is closest to the root node.
通过上述实施例,在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点,这样,在任一节点发生故障时,其协同节点不易被波及,有利于故障数据的备份和恢复,从而解决了相关技术中节点发生故障时无法进行数据备份和数据恢复的技术问题,降低了故障对数据备份和数据恢复的影响。According to the foregoing embodiment, when the coordinated node is required to be allocated to the target node, the first location information of the target node is acquired; and the coordinated node that meets the preset location requirement is selected for the target node from the multiple nodes based on the first location information, where The node and the target node are located in the same network. The preset location requirement means that the target node and the coordinated node do not have a common parent node or have the lowest level of the common parent node closest to the root node, so that when any node fails The cooperative node is not easy to be affected, which is beneficial to the backup and recovery of the fault data, thereby solving the technical problem that the data backup and data recovery cannot be performed when the node fails in the related technology, and the impact of the fault on the data backup and the data recovery is reduced.
可选地,上述的节点可以为终端、网关等设备;上述步骤的执行主体可以为终端、网关等,但不限于此。根据业务能力的不同,终端设备可以 分为两种:终端和网关。终端为具有业务能力和网络通信功能的终端设备;而网关为使用业务能力实现终端外设和网络及应用的连接和交互的终端设备。在执行步骤S201和S202时,可以是直接对同一网络操作,也可以是操作对应于同一网络的树形网络。如果同一网络为任意结构的网络,则可以通过预处理将其处理为树形网络(即该树形网络的网络为逻辑生成树)。Optionally, the foregoing node may be a device such as a terminal or a gateway; the execution body of the foregoing step may be a terminal, a gateway, or the like, but is not limited thereto. According to different business capabilities, the terminal device can There are two types: terminals and gateways. The terminal is a terminal device having a service capability and a network communication function; and the gateway is a terminal device that uses the service capability to implement connection and interaction between the terminal peripheral and the network and the application. When performing steps S201 and S202, it may be directly operated on the same network, or may be a tree network corresponding to the same network. If the same network is an arbitrarily structured network, it can be processed into a tree network by preprocessing (that is, the network of the tree network is a logical spanning tree).
在本申请的实施例中,在由节点组成的树形网络中,每个节点需要且只能拥有1个或2个协同节点,协同节点的所有数据均备份在该节点上,该节点的所有数据也备份在协同节点上,在有节点损坏导致链路不通无法上传数据时,能够最大限度的从协同节点上恢复所需数据并上传。In the embodiment of the present application, in a tree network composed of nodes, each node needs and can only have one or two cooperation nodes, and all data of the cooperation node is backed up on the node, and all the nodes are The data is also backed up on the collaboration node. When there is a node that is damaged and the link is unreachable and cannot be uploaded, the required data can be restored and uploaded from the collaboration node to the maximum extent.
需要说明的是,在组建网络时,可先对所有节点进行节点编码,通过节点编码能确定节点间的亲疏关系,然后从任意节点开始进行邻居选择操作,直到所有节点均有至少1个节点作为邻居;在网络拓扑变更时,需要对新加入的节点进行节点编码,然后对拓扑变更后无邻居的节点以及所有协同节点均非最优的节点进行协同节点的重新选择操作。It should be noted that when constructing a network, all nodes may be first coded, and the node coding may determine the affinity relationship between the nodes, and then the neighbor selection operation is started from any node until all nodes have at least one node as Neighbors; when the network topology changes, the newly added nodes need to be node-coded, and then the nodes with no neighbors after the topology change and the nodes with non-optimal nodes are all re-selected.
在执行步骤S201的获取目标节点的第一位置信息之后,可以按照如下方式为同一网络中的每个节点配置编码信息:获取对应于同一网络的树形网络;为树形网络中的第二级节点配置的编码信息为Ni,i为第二级节点的编码,i为正整数,第二级节点为树形网络中根节点的子节点;为树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。After performing the acquiring the first location information of the target node in step S201, the coding information may be configured for each node in the same network as follows: acquiring a tree network corresponding to the same network; being a second level in the tree network The coding information of the node configuration is Ni, i is the coding of the second-level node, i is a positive integer, the second-level node is the child node of the root node in the tree network; the coding information configured for the j-th node in the tree network Is Nkp, where j is a positive integer greater than 2, k is the encoding of the parent node of the jth node, and p is a positive integer.
可选地,如图3(根节点为N)所示:Optionally, as shown in Figure 3 (the root node is N):
步骤S301,设置第二级节点为Ni,i为递增编号;Step S301, setting the second-level node to Ni, where i is an incremental number;
步骤S302,设置第三级节点为Nip,i为该节点直属上层编号,p为递增编号,i是相对于p的高位;Step S302, setting the third-level node to be Nip, i is the upper layer number directly under the node, p is an incremental number, and i is a high position relative to p;
步骤S303,设置第j级节点为Nkp,k为该节点直属上层编号,p为递增编号。重复执行此步骤直至所有节点均已设置。 Step S303, setting the jth level node to Nkp, k is the upper layer number directly under the node, and p is an increment number. Repeat this step until all nodes have been set up.
依照上述编码进行实施的具体例子如下:Specific examples of implementation in accordance with the above code are as follows:
步骤11,编码根节点下属的节点(第二级节点)为N1,N2,N3等;Step 11, the node (second-level node) subordinate to the root node is N1, N2, N3, etc.;
步骤12,编码第二级节点下属的节点(第三级节点),N1下属的节点为N11,N12,N13等,N2下属的节点为N21,N22,N23等,N3下属的节点为N31,N32,N33等;Step 12: Encoding a node subordinate to the second-level node (third-level node), the nodes subordinate to N1 are N11, N12, N13, etc., the nodes subordinate to N2 are N21, N22, N23, etc., and the nodes subordinate to N3 are N31, N32 , N33, etc.;
步骤13,编码第三级节点下属的节点(第四级节点),N11下属的节点为N111,N112,N113等,N12下属的节点为N121,N122,N123等,N13下属的节点为N131,N132,N133等,N21、N22、N23、N31、N32、N33也采用相同的方式编码;Step 13: Encoding a node subordinate to the third-level node (fourth-level node), the nodes of the N11 subordinate are N111, N112, N113, etc., the nodes of the N12 subordinate are N121, N122, N123, etc., and the nodes of the N13 subordinate are N131, N132 , N133, etc., N21, N22, N23, N31, N32, N33 are also encoded in the same way;
步骤14,依上述规则编码第五级、第六级等节点,直至所有节点均编码完成。In step 14, the fifth level, the sixth level, and the like are encoded according to the above rules until all the nodes are encoded.
依照本实施例编码完成的树形网络结构如图4(N为根节点)所示,根据失效场景对节点进行编号,通过节点编码能够确定节点间的亲疏关系,以便于邻居选择的实施,从而,在选定邻居后,协同节点即可通过通信进行数据的备份和恢复。The tree network structure completed according to the embodiment is shown in FIG. 4 (N is the root node), and the nodes are numbered according to the failure scenario, and the node coding can determine the affinity relationship between the nodes, so as to facilitate the implementation of the neighbor selection, thereby After the neighbor is selected, the collaborative node can back up and restore the data through communication.
可选地,当新组建一个树形网络时,首先根据如上的节点编码方法对网络中的所有节点进行编码,编码完成后,任意选择一个节点根据邻居选择方法对其进行操作,得到其协同节点。然后任意选择下一个无协同节点的节点进行邻居选择操作,直到所有节点都有至少一个协同节点。然后每个节点在开始像协同节点上备份数据并接受储存协同节点的备份数据。Optionally, when a tree network is newly formed, all the nodes in the network are first coded according to the node coding method as above. After the coding is completed, an arbitrary node is selected to operate according to the neighbor selection method, and the cooperative node is obtained. . Then, the next node without the cooperative node is arbitrarily selected to perform neighbor selection operation until all nodes have at least one coordinated node. Each node then backs up the data at the beginning of the collaboration node and accepts the backup data of the storage coordinator.
具体的逻辑协同节点的选择方式如步骤S202所描述的,基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点包括:获取多个节点的多个第二位置信息,其中,多个节点中的每个节点具有一个第二位置信息;根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点。Selecting a specific logical cooperation node as described in step S202, selecting a cooperative node that meets the preset location requirement for the target node from the plurality of nodes based on the first location information includes: acquiring a plurality of second location information of the multiple nodes Each of the plurality of nodes has a second location information; and the node that meets the preset location requirement is selected from the plurality of nodes as the coordinated node according to the plurality of second location information and the first location information.
上述的根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点包括:获取用于表示第一位置信息的第 一编码信息和用于表示多个第二位置信息的多个第二编码信息;从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息;将与目标编码信息对应的节点作为协同节点。The selecting, by the plurality of nodes, the node that meets the preset location requirement according to the plurality of second location information and the first location information to be the collaboration node includes: acquiring, by using the second location information, the first location information An encoding information and a plurality of second encoding information for indicating the plurality of second location information; comparing the bit encoding of the first encoding information and the plurality of second encoding information from a high bit, searching for a plurality of second encoding information The high bit starts to overlap with the first coded information without the target coded information having the largest number of coded bits; the node corresponding to the target coded information is used as the cooperative node.
可选地,从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息包括:确定第一编码信息的编码位数M;判断第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;在判断出多个第二编码信息中存在编码位数为M的第二编码信息的情况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息;在判断出多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息失败时,获取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与第一编码信息的高(M-2)位编码不同的目标编码信息;在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与第一编码信息的高(M-N-1)位编码不同的目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与第一编码信息的高(M-N-2)位编码不同的目标编码信息,其中,N为大于0且小于(M-1)的正整数。Optionally, comparing the first coding information and each of the plurality of second coding information from a high bit, searching for a target code that has the largest number of consecutive coding bits from the upper bits and the first coding information from the upper bits. The information includes: determining a coded bit number M of the first coded information; determining whether the second coded information having the coded bit number M exists in the plurality of second coded information of the second position information; and determining the plurality of second coded information In the case where there is the second coded information having the coded bit number M, the high (M-1) bit code in the one or more second coded information having the coded bit number M and the high (M-1) bit in the first coded information are obtained. Encoding different target encoding information; in the case where it is determined that there is no second encoding information of the encoding bit number M in the plurality of second encoding information, or in the executing step, acquiring one or more second encoding digits of M When the high (M-1) bit coded in the coded information fails the target coded information different from the high (M-1) bit code in the first coded information, one or more second coded information having the coded bit number (M-1) is obtained. Medium high (M-2) bit coding and first coding The high (M-2) bits of the information encode different target coding information; in the execution step, the high (MN-1) bit code and the first coded information in the one or more second coded information having the coded bit number (MN) are obtained. When the high (MN-1) bit fails to encode different target coding information, the high (MN-2) bit code and the first coded information in the one or more second coded information having the coded bit number (MN-1) are obtained. The (MN-2) bit encodes different target coding information, where N is a positive integer greater than 0 and less than (M-1).
下面结合图5详述本申请的实施例,如图5所示:An embodiment of the present application is described in detail below with reference to FIG. 5, as shown in FIG.
步骤S501,获取需要选择协同节点的节点n。Step S501, obtaining a node n that needs to select a coordinated node.
步骤S502,寻找一个节点编码中除最低位外的每一位均与节点n不同,且无协同节点的节点m1,若存在,则确定节点m1为节点n的协同节点,否则执行下一步骤。Step S502, searching for a node m1 that is different from the node n except for the lowest bit, and the node m1 having no cooperative node, if yes, determining that the node m1 is the coordinated node of the node n, otherwise performing the next step.
步骤S503,寻找一个节点编码中除最低位外的每一位均与节点n不同,且只有1个协同节点的节点m2,若存在,则确定节点m2为节点n的协同 节点,否则执行下一步骤。Step S503, finding that each bit except one of the node codes is different from the node n, and only one node m2 of the cooperative node, if yes, determining that the node m2 is the cooperation of the node n Node, otherwise perform the next step.
在步骤S502和S503中,寻找节点m(包括m1和m2)时存在一个全局约束条件,即节点m需要与节点n编码位数相同。In steps S502 and S503, there is a global constraint when looking for the node m (including m1 and m2), that is, the node m needs to be the same as the number of bits of the node n.
但是当步骤S502和S503将所有同层节点均遍历完成依然没有合适的协同节点时,对节点m的全局约束条件变为节点m的编码位数较节点n少1位,然后进行节点选择,具体如步骤S504和S505所描述。However, when steps S502 and S503 complete the traversal of all the same nodes and there is still no suitable cooperative node, the global constraint condition of the node m becomes that the coded number of the node m is one less than the node n, and then the node selection is performed. As described in steps S504 and S505.
步骤S504,寻找一个节点编码与节点n只有最左x位(即高x位)相同并且无协同节点的节点mp,若存在,则确定节点mp为节点n的协同节点,否则执行下一步骤。Step S504, searching for a node mp whose node code is the same as the leftmost x bit (ie, the high x bit) of the node n and has no cooperative node. If yes, the node mp is determined to be the cooperative node of the node n, otherwise the next step is performed.
步骤S505,寻找一个节点编码与节点n只有最左x位相同并且只有1个协同节点的节点mq,若存在,则确定节点mq为节点n的协同节点,否则,x=x+1,并重新执行步骤S504。Step S505, searching for a node mq whose node code is the same as the leftmost x bit of the node n and having only one coordinated node, and if so, determining that the node mq is the cooperative node of the node n, otherwise, x=x+1, and re Step S504 is performed.
若依然没有合适的协同节点,则对节点m的全局约束条件变为节点m的编码位数较节点n少2位,以此类推直至找到满足条件的节点m作为节点n的邻居。If there is still no suitable coordinating node, the global constraint condition for node m becomes that the number of coded bits of node m is 2 bits less than that of node n, and so on until a node m that satisfies the condition is found as the neighbor of node n.
找到协同节点m后,若节点m与节点n编码的编码位数相同且节点编码中除最低位外的每一位均不同,则节点m与节点n互为最优协同节点;若不满足上述要求,则节点m与节点n不互为最优协同节点。After finding the cooperative node m, if the number of coded bits encoded by the node m and the node n is the same and each bit except the lowest bit in the node code is different, the node m and the node n are mutually optimal cooperative nodes; if the above is not satisfied If required, node m and node n are not mutually optimal cooperative nodes.
可选地,在基于第一位置信息从多个节点中为目标节点选取协同节点之后,在树形网络中新增节点时,获取树形网络中不存在最优协同节点的第一节点,其中,任一节点的最优协同节点是指编码位数与任一节点的编码位数相同且高(M-1)位编码与任一节点的高(M-1)位编码不同的节点,M为任一节点的编码位数。当某节点的所有协同节点均不为其最优协同节点时,在下一次网络拓扑变更时为该节点重新选择协同节点。Optionally, after the node is selected from the plurality of nodes for the target node based on the first location information, when the node is added to the tree network, the first node that does not have the optimal collaboration node in the tree network is obtained, where The optimal cooperative node of any node refers to a node whose coded number is the same as the coded number of bits of any node and the high (M-1) bit code is different from the high (M-1) bit code of any node, M The number of coded bits for any node. When all the cooperative nodes of a node are not the optimal cooperative nodes, the cooperative node is reselected for the next network topology change.
需要说明的是,在基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点之后,或,在重新为第一节点分配协同节点之后,树形网络中的每个节点至多具有两个协同节点。 It should be noted that, after selecting a coordinated node that meets the preset location requirement for the target node from the plurality of nodes based on the first location information, or after re-assigning the coordinated node to the first node, each of the tree networks A node has at most two coordination nodes.
假设树形网络结构如图6(N为根节点)所示,则对所有节点进行邻居选择操作后,邻居对(即互为协同节点的节点)如下:Assuming that the tree network structure is as shown in Figure 6 (N is the root node), after performing neighbor selection operations on all nodes, the neighbor pairs (that is, the nodes that are mutually cooperative nodes) are as follows:
N1和N2,N2和N3,N11和N21,N12和N22,N13和N31,N111和N221,N111和N133,N112和N311,N131和N221,N132和N311。N1 and N2, N2 and N3, N11 and N21, N12 and N22, N13 and N31, N111 and N221, N111 and N133, N112 and N311, N131 and N221, N132 and N311.
其中,N133的协同节点均不为其最优协同节点。Among them, the cooperative nodes of N133 are not the optimal cooperative nodes.
可选地,当每个节点的储存空间只支持备份一个其他节点的数据时,每个节点只能有一个协同节点,在这种情况下,选择协同节点的方法如图7所示:Optionally, when the storage space of each node only supports backing up data of one other node, each node can only have one cooperative node. In this case, the method for selecting the coordinated node is as shown in FIG. 7:
步骤S701,获取需要选择协同节点的节点n。Step S701, obtaining a node n that needs to select a coordinated node.
步骤S702,寻找一个节点编码中除最低位外的每一位均与节点n不同,且无协同节点的节点m1,若存在,则确定节点m1为节点n的协同节点,否则执行下一步骤。Step S702, searching for a node m1 in which a bit other than the lowest bit is different from the node n, and the node m1 having no cooperating node, if yes, determining that the node m1 is the coordinating node of the node n, otherwise performing the next step.
步骤S703,寻找一个节点编码与节点n只有最左x位相同并且无协同节点的节点mp,若存在,则确定节点mp为节点n的协同节点,否则,x=x+1,并重新执行步骤S703。Step S703, searching for a node mp whose node code is the same as the leftmost x bit of the node n and having no cooperative node. If yes, it is determined that the node mp is the cooperative node of the node n, otherwise, x=x+1, and the steps are re-executed. S703.
假设树形网络结构如图6,则对所有节点进行邻居选择操作后,邻居对(根据遍历的方式不同,获得的结果可能有差异)如下:Assuming that the tree network structure is shown in Figure 6, after neighbor selection operations are performed on all nodes, the neighbor pairs (according to the traversal manner, the obtained results may be different) as follows:
N1和N2,N11和N22,N12和N31,N13和N21,N111和N221,N112和N132,N131和N133,其中,N3无协同节点,N112,N132,N131,N133的协同节点均不为其最优协同节点。N1 and N2, N11 and N22, N12 and N31, N13 and N21, N111 and N221, N112 and N132, N131 and N133, wherein N3 has no cooperative nodes, and the cooperative nodes of N112, N132, N131 and N133 are not the most Excellent coordination node.
在上述实施例中,通过节点编码能梳理整个树形网络的亲疏关系,能通过编码判断节点间关系,极大的降低了邻居选择的效率;在进行邻居选择时,能找到任意节点当前网络中可用的最适用邻居,最适用的邻居区别于最优邻居,最适用的邻居可能是最优邻居也可能不是,但最适用邻居一定是当前网络的节点中与该节点最疏远的节点,即网络异常时同时波及几率最小的节点。匹配的协同节点在网络中某一节点或链路出现异常时,能 以更低的几率同时波及到两个互为邻居的节点,即明显的提高了备份的有效性。In the above embodiment, the node coding can comb the affinity relationship of the entire tree network, and the relationship between nodes can be judged by coding, which greatly reduces the efficiency of neighbor selection; when performing neighbor selection, any node can be found in the current network. The most suitable neighbor is available. The most suitable neighbor is different from the optimal neighbor. The most suitable neighbor may or may not be the best neighbor. However, the most suitable neighbor must be the node that is the most distant from the node in the current network, that is, the network. An exception occurs at the same time as the node with the least probability. The matching cooperative node can be abnormal when a node or link in the network is abnormal. At a lower probability, it affects two nodes that are neighbors at the same time, which obviously improves the validity of the backup.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例中上述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a plurality of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the above-described methods in various embodiments of the present application.
实施例2Example 2
本申请中还提供了一种协同节点的确定装置。该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。A determining device for a cooperative node is also provided in the present application. The device is used to implement the above embodiments and preferred embodiments, and the description thereof has been omitted. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图8是根据本申请的协同节点的确定装置的示意图。如图8所示,该装置可以包括:第一获取单元81和选取单元82。FIG. 8 is a schematic diagram of a determining device of a cooperative node according to the present application. As shown in FIG. 8, the apparatus may include: a first obtaining unit 81 and a selecting unit 82.
第一获取单元81,用于在需要为目标节点分配协同节点时,获取目标节点的第一位置信息。The first obtaining unit 81 is configured to acquire first location information of the target node when the collaboration node needs to be allocated to the target node.
选取单元82,用于基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。The selecting unit 82 is configured to select, according to the first location information, a coordinated node that meets the preset location requirement for the target node from the multiple nodes, where the multiple nodes and the target node are located in the same network, and the preset location requirement refers to the target node. The co-node does not have a common parent node or has a lowest-level common parent node closest to the root node.
通过上述实施例,第一获取单元在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;选取单元基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节 点位于同一网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点,从而解决了相关技术中节点发生故障时无法进行数据备份和数据恢复的技术问题,降低了故障对数据备份和数据恢复的影响。According to the foregoing embodiment, the first acquiring unit acquires first location information of the target node when the collaboration node needs to be allocated to the target node; the selection unit selects, from the plurality of nodes, the target node to meet the preset location requirement based on the first location information. Collaborative node, where multiple nodes and target sections The point is located in the same network, and the preset location requirement means that the target node and the coordinated node do not have a common parent node or the lowest level of the common parent node is closest to the root node, thereby solving the problem that the node cannot be performed when the node fails in the related art. Technical issues with data backup and data recovery reduce the impact of failures on data backup and data recovery.
在本申请的实施例中,在由节点组成的树形网络中,每个节点需要且只能拥有1个或2个协同节点,协同节点的所有数据均备份在该节点上,该节点的所有数据也备份在协同节点上,在有节点损坏导致链路不通无法上传数据时,能够最大限度的从协同节点上恢复所需数据并上传。In the embodiment of the present application, in a tree network composed of nodes, each node needs and can only have one or two cooperation nodes, and all data of the cooperation node is backed up on the node, and all the nodes are The data is also backed up on the collaboration node. When there is a node that is damaged and the link is unreachable and cannot be uploaded, the required data can be restored and uploaded from the collaboration node to the maximum extent.
需要说明的是,在组建网络时,可先对所有节点进行节点编码,通过节点编码能确定节点间的亲疏关系,然后从任意节点开始进行邻居选择操作,直到所有节点均有至少1个节点作为邻居;在网络拓扑变更时,需要对新加入的节点进行节点编码,然后对拓扑变更后无邻居的节点以及所有协同节点均非最优的节点进行协同节点的重新选择操作。It should be noted that when constructing a network, all nodes may be first coded, and the node coding may determine the affinity relationship between the nodes, and then the neighbor selection operation is started from any node until all nodes have at least one node as Neighbors; when the network topology changes, the newly added nodes need to be node-coded, and then the nodes with no neighbors after the topology change and the nodes with non-optimal nodes are all re-selected.
可选地,本申请的装置还包括:配置单元,用于在获取目标节点的第一位置信息之后,为同一网络中的每个节点配置编码信息。Optionally, the apparatus of the present application further includes: a configuration unit, configured to configure coding information for each node in the same network after acquiring the first location information of the target node.
可选地,配置单元包括:第一配置模块,用于获取对应于同一网络的树形网络,为树形网络中的第二级节点配置的编码信息为Ni,i为第二级节点的编码,i为正整数,第二级节点为树形网络中根节点的子节点;第二配置模块,用于为树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。Optionally, the configuration unit includes: a first configuration module, configured to acquire a tree network corresponding to the same network, where the coding information configured for the second level node in the tree network is Ni, and the code of the second level node is , i is a positive integer, the second level node is a child node of the root node in the tree network; the second configuration module is configured to encode the information of the jth level node in the tree network as Nkp, where j is greater than 2 Positive integer, k is the encoding of the parent node of the jth node, and p is a positive integer.
可选地,树形网络中的每个节点至多具有两个协同节点。Optionally, each node in the tree network has at most two coordination nodes.
在上述实施例中,选取单元包括:获取模块,用于获取多个节点的多个第二位置信息,其中,多个节点中的每个节点具有一个第二位置信息;选取模块,用于根据多个第二位置信息和第一位置信息从多个节点中选取满足预设位置要求的节点为协同节点。获取模块,用于获取多个节点的多个第二位置信息,其中,多个节点中的每个节点具有一个第二位置信息;选取模块,用于根据多个第二位置信息和第一位置信息从多个节点中选取 与目标节点位置关联度最低的节点为协同节点。In the above embodiment, the selecting unit includes: an obtaining module, configured to acquire a plurality of second location information of the plurality of nodes, wherein each of the plurality of nodes has a second location information; and the selecting module is configured to The plurality of second location information and the first location information select a node that meets the preset location requirement from the plurality of nodes as the collaboration node. An acquiring module, configured to acquire multiple second location information of multiple nodes, where each node of the multiple nodes has a second location information; and a selection module, configured to use, according to the multiple second location information and the first location Information is selected from multiple nodes The node with the lowest degree of association with the target node location is a coordinated node.
可选地,选取模块包括:第一获取子模块,用于获取用于表示第一位置信息的第一编码信息和用于表示多个第二位置信息的多个第二编码信息;查找子模块,用于从高位开始对比第一编码信息和多个第二编码信息中的各位编码,查找多个第二编码信息中从高位开始与第一编码信息连续不重合编码位数最多的目标编码信息;操作子模块,用于将与目标编码信息对应的节点作为协同节点。Optionally, the selecting module includes: a first acquiring submodule, configured to acquire first encoding information for indicating first location information and multiple second encoding information for indicating multiple second location information; and searching submodule For comparing the first coding information and the multiple coding codes of the plurality of second coding information from the upper bits, searching for the target coding information that has the largest number of coding bits from the upper bits and the first coding information from the upper bits. An operation submodule for using a node corresponding to the target coding information as a coordination node.
可选地,查找子模块包括:确定子模块,用于确定第一编码信息的编码位数M;判断子模块,用于判断第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;第二获取子模块,用于在判断出多个第二编码信息中存在编码位数为M的第二编码信息的情况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息;第三获取子模块,用于在判断出多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与第一编码信息中高(M-1)位编码不同的目标编码信息失败时,获取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与第一编码信息的高(M-2)位编码不同的目标编码信息;第四获取子模块,用于在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与第一编码信息的高(M-N-1)位编码不同的目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与第一编码信息的高(M-N-2)位编码不同的目标编码信息,其中,N为大于0且小于(M-1)的正整数。Optionally, the determining submodule includes: a determining submodule, configured to determine a coded bit number M of the first coded information; and a determining submodule, configured to determine whether the number of coded bits exists in the plurality of second coded information of the second location information a second encoding information that is M; and a second obtaining sub-module, configured to: when it is determined that the second encoding information with the number of encoding bits is M in the plurality of second encoding information, obtain one or The high (M-1) bits of the plurality of second encoding information encode target encoding information different from the high (M-1) bit encoding in the first encoding information; and the third obtaining submodule is configured to determine the plurality of second encoding information In the case where the second coded information having the coded bit number M does not exist, or in the step of performing the step of obtaining the high (M-1) bit code and the first coded information in the one or more pieces of the second coded information having the coded bit number M When the (M-1) bit coded different target coded information fails, the high (M-2) bit code of the one or more second coded information having the coded bit number (M-1) is obtained and the first coded information is high ( M-2) bit coding different target coding information; fourth acquisition submodule for Performing the step of obtaining, when one or more second coded information having a coded number of bits is (MN), the high (MN-1) bit code is different from the high (MN-1) bit code of the first coded information, and the target code information is acquired. The high (MN-2) bit code of the one or more second coded information having the coded bit number (MN-1) is different from the high (MN-2) bit code of the first coded information, where N is A positive integer greater than 0 and less than (M-1).
在一个可选的实施例中,本申请的装置还包括:第二获取单元,用于在基于第一位置信息从多个节点中为目标节点选取协同节点之后,在树形网络中新增节点时,获取树形网络中不存在最优协同节点的第一节点,其中,任一节点的最优协同节点是指编码位数与任一节点的编码位数相同且高(M-1)位编码与任一节点的高(M-1)位编码不同的节点,M为任一节 点的编码位数。In an optional embodiment, the apparatus of the present application further includes: a second acquiring unit, configured to add a node in the tree network after selecting the coordinated node for the target node from the plurality of nodes based on the first location information At the time, the first node of the optimal cooperative node does not exist in the tree network, wherein the optimal coordinated node of any node refers to the coded number of bits is the same as the coded number of any node and is high (M-1) Encode a node different from the high (M-1) bit encoding of any node, M is any section The number of coded bits.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are in any combination. The forms are located in different processors.
实施例3Example 3
本申请的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present application also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;S1. Acquire first location information of the target node when the collaboration node needs to be allocated to the target node.
S2,基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一树形网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。S2. Select, according to the first location information, a coordinated node that meets a preset location requirement from the plurality of nodes, wherein the multiple nodes and the target node are located in the same tree network, and the preset location requirement refers to the target node and the collaboration. A node does not have a common parent node or has a lowest level of a common parent node closest to the root node.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行:在需要为目标节点分配协同节点时,获取目标节点的第一位置信息;基于第一位置信息从多个节点中为目标节点选取满足预设位置要求的协同节点,其中,多个节点和目标节点位于同一树形网络中,预设位置要求是指目标节点和协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。Optionally, in this embodiment, the processor performs, according to the stored program code in the storage medium, acquiring first location information of the target node when the collaboration node needs to be allocated to the target node; The node selects a cooperative node that meets the preset location requirement for the target node, where multiple nodes and target nodes are located in the same tree network, and the preset location requirement means that the target node and the coordinated node do not have a common parent node or have The lowest level of the common parent node is closest to the root node.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者 分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, which can be concentrated on a single computing device, or Distributed over a network of computing devices, optionally, they may be implemented in program code executable by the computing device, such that they may be stored in the storage device for execution by the computing device, and in some cases The steps shown or described may be performed in a different order than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Thus, the application is not limited to any particular combination of hardware and software.
以上仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 The above is only a preferred embodiment of the present application, and is not intended to limit the present application, and various changes and modifications may be made to the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application are intended to be included within the scope of the present application.

Claims (21)

  1. 一种协同节点的确定方法,包括:A method for determining a coordinated node includes:
    在需要为目标节点分配协同节点时,获取所述目标节点的第一位置信息;Obtaining first location information of the target node when a coordinated node needs to be allocated to the target node;
    基于所述第一位置信息从多个节点中为所述目标节点选取满足预设位置要求的协同节点,其中,所述多个节点和所述目标节点位于同一网络中,所述预设位置要求是指所述目标节点和所述协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。And selecting, according to the first location information, a collaboration node that meets a preset location requirement for the target node from the multiple nodes, where the multiple nodes and the target node are located in the same network, and the preset location requirements It is meant that the target node and the coordinated node do not have a common parent node or have a lowest level of a common parent node closest to the root node.
  2. 根据权利要求1所述的方法,其中,基于所述第一位置信息从多个节点中为所述目标节点选取满足预设位置要求的协同节点包括:The method according to claim 1, wherein the selecting a coordinated node that satisfies the preset location requirement for the target node from the plurality of nodes based on the first location information comprises:
    获取所述多个节点的多个第二位置信息,其中,所述多个节点中的每个节点具有一个第二位置信息;Obtaining a plurality of second location information of the plurality of nodes, wherein each of the plurality of nodes has a second location information;
    根据所述多个第二位置信息和所述第一位置信息从所述多个节点中选取满足所述预设位置要求的节点为所述协同节点。And selecting, according to the plurality of second location information and the first location information, a node that meets the preset location requirement from the multiple nodes as the collaboration node.
  3. 根据权利要求2所述的方法,其中,根据所述多个第二位置信息和所述第一位置信息从所述多个节点中选取满足所述预设位置要求的节点为所述协同节点包括:The method according to claim 2, wherein the node that satisfies the preset location requirement is selected from the plurality of nodes according to the plurality of second location information and the first location information is the coordinated node includes :
    获取用于表示所述第一位置信息的第一编码信息和用于表示所述多个第二位置信息的多个第二编码信息;Obtaining first encoding information for indicating the first location information and a plurality of second encoding information for indicating the plurality of second location information;
    从高位开始对比所述第一编码信息和所述多个第二编码信息中的各位编码,查找所述多个第二编码信息中从高位开始与所述第一编码信息连续不重合编码位数最多的目标编码信息;Comparing the bit codes of the first coding information and the plurality of second coding information from a high bit, searching for the number of consecutive coding bits that are consecutively non-coincident with the first coding information from a high bit in the plurality of second coding information Maximum target encoding information;
    将与所述目标编码信息对应的节点作为所述协同节点。A node corresponding to the target encoding information is used as the cooperative node.
  4. 根据权利要求3所述的方法,其中,从高位开始对比所述第一编码信息和所述多个第二编码信息中的各位编码,查找所述多个第 二编码信息中从高位开始与所述第一编码信息连续不重合编码位数最多的目标编码信息包括:The method according to claim 3, wherein comparing the bit codes of the first encoding information and the plurality of second encoding information from a high bit, searching for the plurality of The target coding information of the second coding information that is the largest non-coincident coding number from the upper bits and the first coding information includes:
    确定所述第一编码信息的编码位数M;Determining a coded number of bits M of the first encoded information;
    判断所述第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;Determining, by the plurality of second encoding information of the second location information, whether the second encoding information having the number of encoding bits is M;
    在判断出所述多个第二编码信息中存在编码位数为M的第二编码信息的情况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与所述第一编码信息中高(M-1)位编码不同的目标编码信息;Obtaining a high (M-1) bit encoding in one or more second encoding information with a coded bit number M in a case where it is determined that the second encoding information having a coded bit number M exists in the plurality of second encoding information Different target encoding information than the high (M-1) bit encoding in the first encoded information;
    在判断出所述多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与所述第一编码信息中高(M-1)位编码不同的所述目标编码信息失败时,获取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与所述第一编码信息的高(M-2)位编码不同的所述目标编码信息;In a case where it is determined that the second encoding information having the number of encoding bits is M does not exist in the plurality of second encoding information, or in the step of acquiring one or more second encoding information having the number of encoding bits M (M) -1) when the target encoding information different from the high (M-1) bit encoding in the first encoding information fails, obtaining one or more second encoding information having a coded number of bits (M-1) (M-2) bit encoding the target encoding information different from the high (M-2) bit encoding of the first encoding information;
    在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与所述第一编码信息的高(M-N-1)位编码不同的所述目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与所述第一编码信息的高(M-N-2)位编码不同的所述目标编码信息,其中,N为大于0且小于(M-1)的正整数。Performing the step of obtaining the target code of the high (MN-1) bit code different from the high (MN-1) bit code of the first coded information in the one or more second coded information having the coded bit number (MN) When the information fails, the high (MN-2) bit code of the one or more second coded information having the coded bit number (MN-1) is different from the high (MN-2) bit code of the first coded information. The target encoding information, wherein N is a positive integer greater than 0 and less than (M-1).
  5. 根据权利要求1所述的方法,其中,在基于所述第一位置信息从多个节点中为所述目标节点选取协同节点之后,所述方法还包括:The method of claim 1, wherein after the collaborative node is selected from the plurality of nodes for the target node based on the first location information, the method further comprises:
    在所述同一网络中新增节点时,获取所述同一网络中不存在最优协同节点的第一节点;When a node is added to the same network, acquiring a first node that does not have an optimal coordination node in the same network;
    重新为所述第一节点分配所述协同节点。Reassigning the coordinating node to the first node.
  6. 根据权利要求5所述的方法,其中,任一节点的最优协同节 点是指编码位数与所述任一节点的编码位数相同且高(M-1)位编码与所述任一节点的高(M-1)位编码不同的节点,M为所述任一节点的编码位数。The method of claim 5 wherein the optimal coordination section of any of the nodes A point is a node whose coded number of bits is the same as the coded number of bits of any of the nodes and the high (M-1) bit code is different from the high (M-1) bit code of any of the nodes, and M is the said The number of coded bits for a node.
  7. 根据权利要求5所述的方法,其中,在基于所述第一位置信息从多个节点中为所述目标节点选取满足预设位置要求的协同节点之后,或,在重新为所述第一节点分配所述协同节点之后,所述同一网络中的每个节点至多具有两个所述协同节点。The method according to claim 5, wherein after selecting a cooperative node that satisfies a preset location requirement for the target node from the plurality of nodes based on the first location information, or re-being the first node After allocating the cooperating node, each node in the same network has at most two of the cooperating nodes.
  8. 根据权利要求1所述的方法,其中,在获取所述目标节点的第一位置信息之后,所述方法还包括:The method of claim 1, wherein after acquiring the first location information of the target node, the method further comprises:
    为所述同一网络中的每个节点配置编码信息。Encoding information is configured for each node in the same network.
  9. 根据权利要求8所述的方法,其中,为所述同一网络中的每个节点配置编码信息包括:The method of claim 8 wherein configuring the encoding information for each of the nodes in the same network comprises:
    获取对应于所述同一网络的树形网络,为所述树形网络中的第二级节点配置的编码信息为Ni,其中,i为所述第二级节点的编码,i为正整数,所述第二级节点为所述树形网络中根节点的子节点;Acquiring a tree network corresponding to the same network, where the coding information configured for the second level node in the tree network is Ni, where i is the code of the second level node, and i is a positive integer. The second level node is a child node of the root node in the tree network;
    为所述树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。The coding information configured for the jth node in the tree network is Nkp, where j is a positive integer greater than 2, k is the encoding of the parent node of the jth node, and p is a positive integer.
  10. 根据权利要求1所述的方法,其中,所述同一网络中的节点为终端或者网关。The method of claim 1 wherein the nodes in the same network are terminals or gateways.
  11. 根据权利要求1至10中任意一项所述的方法,其中,所述协同节点的确定方法应用于所述同一网络中的任一节点。The method according to any one of claims 1 to 10, wherein the determining method of the cooperative node is applied to any of the nodes in the same network.
  12. 一种协同节点的确定装置,包括:A determining device for a cooperative node, comprising:
    第一获取单元,设置为在需要为目标节点分配协同节点时,获取所述目标节点的第一位置信息;a first acquiring unit, configured to acquire first location information of the target node when a coordinated node needs to be allocated to the target node;
    选取单元,设置为基于所述第一位置信息从多个节点中为所述目 标节点选取满足预设位置要求的协同节点,其中,所述多个节点和所述目标节点位于同一网络中,所述预设位置要求是指所述目标节点和所述协同节点不具有共同的父节点或者具有的最低一级的共同父节点最靠近根节点。Selecting a unit, configured to use the first location information from the plurality of nodes as the destination The target node selects a collaboration node that meets the preset location requirement, where the multiple nodes and the target node are located in the same network, and the preset location requirement means that the target node and the collaboration node do not have a common The parent node or the lowest parent of the lowest level is closest to the root node.
  13. 根据权利要求12所述的装置,其中,所述选取单元包括:The apparatus of claim 12, wherein the selecting unit comprises:
    获取模块,设置为获取所述多个节点的多个第二位置信息,其中,所述多个节点中的每个节点具有一个第二位置信息;An acquiring module, configured to acquire a plurality of second location information of the multiple nodes, where each of the multiple nodes has a second location information;
    选取模块,设置为根据所述多个第二位置信息和所述第一位置信息从所述多个节点中选取满足所述预设位置要求的节点为所述协同节点。And the selecting module is configured to select, according to the plurality of second location information and the first location information, a node that meets the preset location requirement from the multiple nodes as the collaboration node.
  14. 根据权利要求13所述的装置,其中,所述选取模块包括:The apparatus of claim 13 wherein said selecting module comprises:
    第一获取子模块,设置为获取用于表示所述第一位置信息的第一编码信息和用于表示所述多个第二位置信息的多个第二编码信息;a first acquiring submodule, configured to acquire first encoding information for indicating the first location information and a plurality of second encoding information for indicating the plurality of second location information;
    查找子模块,设置为从高位开始对比所述第一编码信息和所述多个第二编码信息中的各位编码,查找所述多个第二编码信息中从高位开始与所述第一编码信息连续不重合编码位数最多的目标编码信息;a search submodule, configured to compare a bit code of the first coded information and the plurality of second coded information from a high bit, and search for the first coded information from the upper bit and the first coded information in the plurality of second coded information Continuously do not coincide with the target coded information with the largest number of coded bits;
    操作子模块,设置为将与所述目标编码信息对应的节点作为所述协同节点。The operation submodule is configured to use a node corresponding to the target coding information as the coordination node.
  15. 根据权利要求14所述的装置,其中,所述查找子模块包括:The apparatus of claim 14, wherein the lookup sub-module comprises:
    确定子模块,设置为确定所述第一编码信息的编码位数M;Determining a submodule, configured to determine a coded number of bits M of the first encoded information;
    判断子模块,设置为判断所述第二位置信息的多个第二编码信息中是否存在编码位数为M的第二编码信息;a determining submodule, configured to determine whether there is second encoding information having a coded bit number M among the plurality of second encoding information of the second location information;
    第二获取子模块,设置为在判断出所述多个第二编码信息中存在编码位数为M的第二编码信息的情况下,获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与所述第一编码信息中高(M-1) 位编码不同的目标编码信息;a second acquiring submodule, configured to obtain one or more second encoding information with a coded bit number M in a case where it is determined that the second encoding information having the coded bit number M exists in the plurality of second encoding information Medium high (M-1) bit coding and high (M-1) in the first coded information Bit coding different target coding information;
    第三获取子模块,设置为在判断出所述多个第二编码信息中不存在编码位数为M的第二编码信息的情况下,或在执行步骤获取编码位数为M的一个或多个第二编码信息中高(M-1)位编码与所述第一编码信息中高(M-1)位编码不同的所述目标编码信息失败时,获取编码位数为(M-1)的一个或多个第二编码信息中高(M-2)位编码与所述第一编码信息的高(M-2)位编码不同的所述目标编码信息;a third obtaining submodule, configured to: when it is determined that the second encoding information having the number of encoding bits is not present in the plurality of second encoding information, or in the performing step, obtaining one or more encoding digits of M When the high (M-1)-bit encoding of the second encoding information fails the target encoding information different from the high (M-1)-bit encoding in the first encoding information, obtaining one of the coded bits (M-1) Or the high (M-2) bits of the plurality of second encoded information encode the target encoded information different from the high (M-2) bit encoding of the first encoded information;
    第四获取子模块,设置为在执行步骤获取编码位数为(M-N)的一个或多个第二编码信息中高(M-N-1)位编码与所述第一编码信息的高(M-N-1)位编码不同的所述目标编码信息失败时,获取编码位数为(M-N-1)的一个或多个第二编码信息中高(M-N-2)位编码与所述第一编码信息的高(M-N-2)位编码不同的所述目标编码信息,其中,N为大于0且小于(M-1)的正整数。a fourth obtaining submodule, configured to obtain a high (MN-1) bit encoding and a high (MN-1) of the first encoding information in one or more second encoding information with a coded bit number (MN) in an execution step When the bit coding different target encoding information fails, obtaining the high (MN-2) bit coding of the one or more second coding information having the coded bit number (MN-1) and the first coding information is high (MN - 2) Bit encoding different target encoding information, where N is a positive integer greater than 0 and less than (M-1).
  16. 根据权利要求12所述的装置,其中,所述装置还包括:The device of claim 12, wherein the device further comprises:
    第二获取单元,设置为在基于所述第一位置信息从多个节点中为所述目标节点选取协同节点之后,在所述同一网络中新增节点时,获取所述同一网络中不存在最优协同节点的第一节点;a second acquiring unit, configured to: after selecting a coordinated node for the target node from the plurality of nodes based on the first location information, when a node is added to the same network, acquiring the same network does not exist most The first node of the optimal cooperative node;
    分配单元,设置为重新为所述第一节点分配协同节点。An allocating unit, configured to re-allocate the cooperating node for the first node.
  17. 根据权利要求16所述的装置,其中,任一节点的最优协同节点是指编码位数与所述任一节点的编码位数相同且高(M-1)位编码与所述任一节点的高(M-1)位编码不同的节点,M为所述任一节点的编码位数。The apparatus according to claim 16, wherein the optimal cooperative node of any of the nodes refers to the coded number of bits being the same as the coded number of bits of the any node and the high (M-1) bit coded with any of the nodes The high (M-1) bits encode different nodes, and M is the number of coded bits of any of the nodes.
  18. 根据权利要求16所述的装置,其中,所述同一网络中的每个节点至多具有两个所述协同节点。The apparatus of claim 16 wherein each node in the same network has at most two of the coordinated nodes.
  19. 根据权利要求12所述的装置,其中,所述装置还包括: The device of claim 12, wherein the device further comprises:
    配置单元,设置为在获取所述目标节点的第一位置信息之后,为所述同一网络中的每个节点配置编码信息。And a configuration unit, configured to configure encoding information for each node in the same network after acquiring the first location information of the target node.
  20. 根据权利要求19所述的装置,其中,所述配置单元包括:The apparatus of claim 19, wherein the configuration unit comprises:
    第一配置模块,设置为获取对应于所述同一网络的树形网络,为所述树形网络中的第二级节点配置的编码信息为Ni,i为所述第二级节点的编码,i为正整数,所述第二级节点为所述树形网络中根节点的子节点;a first configuration module, configured to acquire a tree network corresponding to the same network, where the coding information configured for the second level node in the tree network is Ni, and i is the code of the second level node, i a positive integer, the second level node is a child node of the root node in the tree network;
    第二配置模块,设置为为所述树形网络中的第j级节点配置的编码信息为Nkp,其中,j为大于2的正整数,k为第j级节点的父节点的编码,p为正整数。a second configuration module, configured to configure the coding information for the jth node in the tree network to be Nkp, where j is a positive integer greater than 2, k is a code of a parent node of the jth node, and p is A positive integer.
  21. 根据权利要求12所述的装置,其中,所述同一网络中的节点为终端或者网关。 The apparatus of claim 12, wherein the nodes in the same network are terminals or gateways.
PCT/CN2017/075360 2016-08-04 2017-03-01 Method and apparatus for determining cooperating node WO2018023971A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP17836156.4A EP3496367B1 (en) 2016-08-04 2017-03-01 Method and apparatus for determining cooperating node
US16/321,993 US10764373B2 (en) 2016-08-04 2017-03-01 Method and apparatus for determining cooperation node
US17/004,750 US20200396293A1 (en) 2016-08-04 2020-08-27 Method and apparatus for determining cooperation node

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201610635638.1 2016-08-04
CN201610635638 2016-08-04
CN201610977531.5A CN107689883B (en) 2016-08-04 2016-11-04 Method and device for determining cooperative node
CN201610977531.5 2016-11-04

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US16/321,993 A-371-Of-International US10764373B2 (en) 2016-08-04 2017-03-01 Method and apparatus for determining cooperation node
US17/004,750 Continuation US20200396293A1 (en) 2016-08-04 2020-08-27 Method and apparatus for determining cooperation node

Publications (1)

Publication Number Publication Date
WO2018023971A1 true WO2018023971A1 (en) 2018-02-08

Family

ID=61072537

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075360 WO2018023971A1 (en) 2016-08-04 2017-03-01 Method and apparatus for determining cooperating node

Country Status (1)

Country Link
WO (1) WO2018023971A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404647A (en) * 2019-01-02 2020-07-10 中兴通讯股份有限公司 Control method of node cooperative relationship and related equipment
CN112911624A (en) * 2021-01-18 2021-06-04 珠海格力电器股份有限公司 Network connection method and device of electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060479A (en) * 2007-05-28 2007-10-24 广州杰赛科技股份有限公司 Wireless self-organized network distribution authentication multi-layer tree route method
CN101557630A (en) * 2009-03-25 2009-10-14 山东大学 Method for selecting cooperative nodes in wireless communication network
CN101873661A (en) * 2009-04-27 2010-10-27 大唐移动通信设备有限公司 Method, system and terminal for determining coordinate district in CoMP system
US20160004759A1 (en) * 2014-07-03 2016-01-07 Adarsh Ramakrishnan Platform for Managing and Visualizing Data on a Computer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060479A (en) * 2007-05-28 2007-10-24 广州杰赛科技股份有限公司 Wireless self-organized network distribution authentication multi-layer tree route method
CN101557630A (en) * 2009-03-25 2009-10-14 山东大学 Method for selecting cooperative nodes in wireless communication network
CN101873661A (en) * 2009-04-27 2010-10-27 大唐移动通信设备有限公司 Method, system and terminal for determining coordinate district in CoMP system
US20160004759A1 (en) * 2014-07-03 2016-01-07 Adarsh Ramakrishnan Platform for Managing and Visualizing Data on a Computer

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404647A (en) * 2019-01-02 2020-07-10 中兴通讯股份有限公司 Control method of node cooperative relationship and related equipment
CN111404647B (en) * 2019-01-02 2023-11-28 中兴通讯股份有限公司 Control method of node cooperative relationship and related equipment
CN112911624A (en) * 2021-01-18 2021-06-04 珠海格力电器股份有限公司 Network connection method and device of electronic equipment

Similar Documents

Publication Publication Date Title
Wang et al. Data collection from WSNs to the cloud based on mobile Fog elements
US8780763B2 (en) Communication and message route optimization and messaging in a mesh network
JP5683755B2 (en) How to avoid broken links in smart meter networks for loop-free routing of packets
CN106327847B (en) Power information collection copies method and system
WO2018103579A1 (en) Meter reading method, apparatus and system, and communication gateway
US9135208B1 (en) Method and system for group management
CN110324303A (en) The data slot of internet of things equipment recombinates
CN102111912B (en) Centralized construction method for Zigbee homogeneous tree-type wireless sensor network
US10652090B2 (en) Method for self-constructing a multi-hop structured wireless communication network
US9794122B2 (en) Method for propagating network management data for energy-efficient IoT network management and energy-efficient IoT node apparatus
US11038956B2 (en) Method and apparatus for determining network central node, and node equipment
WO2020026820A1 (en) Method and apparatus for managing network
US20200396293A1 (en) Method and apparatus for determining cooperation node
WO2018023971A1 (en) Method and apparatus for determining cooperating node
Gu et al. DR-MDS: An energy-efficient coding scheme in D2D distributed storage network for the internet of things
KR101663994B1 (en) METHOD FOR PROVIDING AN LIGHT-WEIGHT ROUTING PROTOCOL IN A IoT CAPABLE INFRA-LESS WIRELESS NETWORKS, RECORDING MEDIUM AND DEVICE FOR PERFORMING THE METHOD
Chaturvedi et al. Energy efficient cluster head selection for cross layer design over wireless sensor network
US10506510B2 (en) Method for increasing lifetime of network devices in a multi-hop structured wireless communication system
WO2018149134A1 (en) Method and device for selecting cooperative node
Zhang et al. An efficient connected dominating set algorithm in WSNs based on the induced tree of the crossed cube
Zhang et al. Harmonic quorum systems: Data management in 2D/3D wireless sensor networks with holes
KR101454991B1 (en) A method for network association in wireless networks
Chen et al. Energy-efficient and fault-tolerant mobile cloud storage
Chen et al. A fault-tolerant data acquisition scheme with mds and dynamic clustering in energy internet
Sardar et al. Design of energy aware collection tree protocol in wireless sensor network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17836156

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017836156

Country of ref document: EP

Effective date: 20190304