[go: up one dir, main page]

CN110933166B - A Consensus Platform, Terminal, Node and Path Selection Method - Google Patents

A Consensus Platform, Terminal, Node and Path Selection Method Download PDF

Info

Publication number
CN110933166B
CN110933166B CN201911183707.XA CN201911183707A CN110933166B CN 110933166 B CN110933166 B CN 110933166B CN 201911183707 A CN201911183707 A CN 201911183707A CN 110933166 B CN110933166 B CN 110933166B
Authority
CN
China
Prior art keywords
node
terminal
nodes
distance
address
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
CN201911183707.XA
Other languages
Chinese (zh)
Other versions
CN110933166A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201911183707.XA priority Critical patent/CN110933166B/en
Publication of CN110933166A publication Critical patent/CN110933166A/en
Application granted granted Critical
Publication of CN110933166B publication Critical patent/CN110933166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1021Server selection for load balancing based on client or server locations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5683Storage of data provided by user terminals, i.e. reverse caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了一种共识平台、终端、节点和路径选择方法,涉及区块链技术领域,用于进行高效率的数据上报。该共识平台包括:收发模块,用于从终端接收终端的位置,从多个节点接收多个节点的位置和工作状态;处理模块,用于根据终端的位置、多个节点的位置和工作状态,确定至少一个第一节点和至少一个第二节点,其中,第一节点与终端的距离小于第二节点与终端的距离;收发模块,还用于向终端发送至少一个第一节点的IP地址;处理模块,还用于根据至少一个第一节点的位置、至少一个第二节点的位置,确定每个第二节点对应的第三节点;收发模块,还用于向第三节点发送对应的第二节点的IP地址。本申请实施例应用于路径的选择。

Figure 201911183707

The present application discloses a consensus platform, a terminal, a node and a path selection method, which relate to the technical field of blockchain and are used for efficient data reporting. The consensus platform includes: a transceiver module for receiving the position of the terminal from the terminal, and receiving the position and working status of multiple nodes from multiple nodes; determining at least one first node and at least one second node, wherein the distance between the first node and the terminal is smaller than the distance between the second node and the terminal; the transceiver module is further configured to send the IP address of the at least one first node to the terminal; processing The module is further configured to determine the third node corresponding to each second node according to the position of at least one first node and the position of at least one second node; the transceiver module is further configured to send the corresponding second node to the third node IP address. The embodiments of the present application are applied to path selection.

Figure 201911183707

Description

一种共识平台、终端、节点和路径选择方法A Consensus Platform, Terminal, Node and Path Selection Method

技术领域technical field

本申请涉及区块链技术领域,尤其涉及一种共识平台、终端、节点和路径选择方法。The present application relates to the field of blockchain technology, and in particular, to a consensus platform, terminal, node and path selection method.

背景技术Background technique

区块链是一种去中心化的存储和计算技术,其通过将加密数据块按照时间顺序叠加而生成的持久的不可修改的记录,并且将记录存储在区块链的各个区块链节点设备中,使得以去中心化的方式进行分布式数据存储。Blockchain is a decentralized storage and computing technology that generates persistent and unmodifiable records by superimposing encrypted data blocks in chronological order, and stores the records in each blockchain node device of the blockchain. , which enables distributed data storage in a decentralized manner.

目前,区块链数据上报大多采用固定的路径选择,终端根据该路径将区块链数据上报至区块链网络中的部分节点,再由这部分节点传送至其他节点,以将数据发送至网络中的所有节点。但在实际实施时,进行数据上报的终端的位置可能是变化的,其与节点的距离也是变化的,在终端位置发生变化后仍然按照固定的路径选择进行数据上报,会造成数据上报的效率降低。At present, most of the blockchain data reporting adopts a fixed path selection, and the terminal reports the blockchain data to some nodes in the blockchain network according to the path, and then transmits the data to other nodes from this part of the nodes to send the data to the network. all nodes in . However, in actual implementation, the location of the terminal that performs data reporting may change, and the distance from the node to the node also changes. After the location of the terminal changes, data reporting is still performed according to a fixed path selection, which will reduce the efficiency of data reporting. .

发明内容SUMMARY OF THE INVENTION

本申请的实施例提供一种共识平台、终端、节点和路径选择方法,用于解决现有技术中区块链数据上报大多采用固定的路径选择,数据上报的效率较低的问题,进行高效率的数据上报。The embodiments of the present application provide a consensus platform, a terminal, a node, and a path selection method, which are used to solve the problem that in the prior art, block chain data reporting mostly adopts fixed path selection, and the efficiency of data reporting is low. data report.

为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above object, the embodiments of the present application adopt the following technical solutions:

第一方面,本申请的实施例提供了一种共识平台,包括:In the first aspect, the embodiments of the present application provide a consensus platform, including:

收发模块,用于从终端接收所述终端的位置,从多个节点接收所述多个节点的位置和工作状态;a transceiver module, configured to receive the location of the terminal from the terminal, and receive the location and working status of the multiple nodes from multiple nodes;

处理模块,用于根据所述终端的位置、所述多个节点的位置和工作状态,确定至少一个第一节点和至少一个第二节点,其中,所述第一节点与所述终端的距离小于所述第二节点与所述终端的距离;a processing module, configured to determine at least one first node and at least one second node according to the position of the terminal, the positions and working states of the plurality of nodes, wherein the distance between the first node and the terminal is less than the distance between the second node and the terminal;

所述收发模块,还用于向所述终端发送所述至少一个第一节点的IP地址,其中,所述至少一个第一节点的IP地址用于指示所述终端向所述至少一个第一节点发送区块链数据;The transceiver module is further configured to send the IP address of the at least one first node to the terminal, wherein the IP address of the at least one first node is used to instruct the terminal to send the at least one first node to the terminal send blockchain data;

所述处理模块,还用于根据所述至少一个第一节点的位置、所述至少一个第二节点的位置,确定每个所述第二节点对应的第三节点,其中,所述第三节点为与所述至少一个第二节点中的一个节点距离最近的第一节点;The processing module is further configured to determine a third node corresponding to each of the second nodes according to the position of the at least one first node and the position of the at least one second node, wherein the third node is the closest first node to one of the at least one second node;

所述收发模块,还用于向所述第三节点发送对应的所述第二节点的IP地址,其中,所述第二节点的IP地址用于指示所述第三节点向对应的所述第二节点发送所述区块链数据。The transceiver module is further configured to send the corresponding IP address of the second node to the third node, wherein the IP address of the second node is used to instruct the third node to send the corresponding IP address to the third node. The second node sends the blockchain data.

第二方面,本申请的实施例提供了一种终端,包括:In a second aspect, an embodiment of the present application provides a terminal, including:

采集模块,用于获取终端的信号强度;The acquisition module is used to obtain the signal strength of the terminal;

所述采集模块,还用于在所述信号强度小于或等于预设值时,在预设时间后重新获取所述信号强度;The acquisition module is further configured to re-acquire the signal strength after a preset time when the signal strength is less than or equal to a preset value;

所述采集模块,还用于在所述信号强度大于所述预设值时,获取所述终端的位置;The acquisition module is further configured to acquire the location of the terminal when the signal strength is greater than the preset value;

收发模块,用于向共识平台发送所述终端的位置;a transceiver module for sending the location of the terminal to the consensus platform;

所述收发模块,还用于从所述共识平台接收至少一个第一节点的IP地址;The transceiver module is further configured to receive the IP address of at least one first node from the consensus platform;

所述收发模块,还用于向所述至少一个第一节点发送区块链数据。The transceiver module is further configured to send blockchain data to the at least one first node.

第三方面,本申请的实施例提供了一种节点,包括:In a third aspect, an embodiment of the present application provides a node, including:

处理模块,用于获取节点的位置和工作状态;The processing module is used to obtain the position and working status of the node;

收发模块,用于向共识平台发送所述节点的位置和工作状态。The transceiver module is used to send the location and working status of the node to the consensus platform.

所述收发模块,还用于从所述共识平台接收对应的第二节点的IP地址;The transceiver module is further configured to receive the IP address of the corresponding second node from the consensus platform;

所述收发模块,还用于从终端接收区块链数据;The transceiver module is also used to receive blockchain data from the terminal;

所述收发模块,还用于向所述第二节点发送所述区块链数据。The transceiver module is further configured to send the blockchain data to the second node.

第四方面,本申请的实施例提供了一种路径选择方法,包括:In a fourth aspect, embodiments of the present application provide a path selection method, including:

共识平台从终端接收所述终端的位置,从多个节点接收所述多个节点的位置和工作状态;The consensus platform receives the location of the terminal from the terminal, and receives the location and working status of the multiple nodes from multiple nodes;

所述共识平台根据所述终端的位置、所述多个节点的位置和工作状态,确定至少一个第一节点和至少一个第二节点,其中,所述第一节点与所述终端的距离小于所述第二节点与所述终端的距离;The consensus platform determines at least one first node and at least one second node according to the position of the terminal, the positions and working states of the plurality of nodes, wherein the distance between the first node and the terminal is smaller than the distance between the first node and the terminal. the distance between the second node and the terminal;

所述共识平台向所述终端发送所述至少一个第一节点的IP地址,其中,所述至少一个第一节点的IP地址用于指示所述终端向所述至少一个第一节点发送区块链数据;The consensus platform sends the IP address of the at least one first node to the terminal, wherein the IP address of the at least one first node is used to instruct the terminal to send the blockchain to the at least one first node data;

所述共识平台根据所述至少一个第一节点的位置、所述至少一个第二节点的位置,确定每个所述第二节点对应的第三节点,其中,所述第三节点为与所述至少一个第二节点中的一个节点距离最近的第一节点;The consensus platform determines a third node corresponding to each of the second nodes according to the position of the at least one first node and the position of the at least one second node, wherein the third node is the same as the second node. One of the at least one second node is the closest first node;

所述共识平台向所述第三节点发送对应的所述第二节点的IP地址,其中,所述第二节点的IP地址用于指示所述第三节点向对应的所述第二节点发送所述区块链数据。The consensus platform sends the corresponding IP address of the second node to the third node, wherein the IP address of the second node is used to instruct the third node to send the corresponding second node to the second node. the blockchain data.

第五方面,本申请的实施例提供了一种路径选择方法,包括:In a fifth aspect, the embodiments of the present application provide a path selection method, including:

终端获取所述终端的信号强度;The terminal obtains the signal strength of the terminal;

在所述信号强度小于或等于预设值时,所述终端在预设时间后重新获取所述信号强度;When the signal strength is less than or equal to a preset value, the terminal re-acquires the signal strength after a preset time;

在所述信号强度大于所述预设值时,所述终端获取所述终端的位置;When the signal strength is greater than the preset value, the terminal acquires the location of the terminal;

所述终端向共识平台发送所述终端的位置;The terminal sends the location of the terminal to the consensus platform;

所述终端从所述共识平台接收至少一个第一节点的IP地址;The terminal receives the IP address of at least one first node from the consensus platform;

所述终端向所述至少一个第一节点发送区块链数据。The terminal sends blockchain data to the at least one first node.

第六方面,本申请的实施例提供了一种路径选择方法,包括:In a sixth aspect, the embodiments of the present application provide a path selection method, including:

节点获取所述节点的位置和工作状态;The node obtains the location and working status of the node;

所述节点向共识平台发送所述节点的位置和工作状态;The node sends the location and working status of the node to the consensus platform;

所述节点从所述共识平台接收对应的第二节点的IP地址;the node receives the IP address of the corresponding second node from the consensus platform;

所述节点从所述终端接收区块链数据;the node receives blockchain data from the terminal;

所述节点向对应的所述第二节点发送所述区块链数据。The node sends the blockchain data to the corresponding second node.

第七方面,提供了一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被计算机执行时使所述计算机执行如第四方面、第五方面或第六方面所述的路径选择方法。In a seventh aspect, there is provided a computer-readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a computer, cause the computer to execute the method described in the fourth aspect, The path selection method described in the fifth aspect or the sixth aspect.

第八方面,提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得计算机执行如第四方面、第五方面或第六方面所述的路径选择方法。In an eighth aspect, there is provided a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the path selection method of the fourth, fifth or sixth aspect.

第九方面,提供一种路径选择装置,包括:处理器和存储器,存储器用于存储程序,处理器调用存储器存储的程序,以执行上述第四方面、第五方面或第六方面所述的路径选择方法。A ninth aspect provides a path selection device, comprising: a processor and a memory, the memory is used to store a program, and the processor invokes the program stored in the memory to execute the path described in the fourth aspect, the fifth aspect or the sixth aspect Method of choosing.

本申请的实施例提供的共识平台、终端、节点和路径选择方法,通过获取终端的信号强度,判断终端只在通信环境状态较好的情况下进行区块链数据上报;共识平台通过获取节点的工作状态,使终端只向正常工作的节点发送区块链数据;通过终端的位置和节点的位置确定终端与各个节点的距离,并根据终端与各个节点距离确定第一节点和第二节点,使终端在进行数据上报时只需上传到距离较近的第一节点;共识平台根据第一节点的位置与第二节点的位置计算第一节点与第二节点的距离,确定第二节点对应的第一节点中的第三节点,使第三节点只需要将接收到的区块链数据发送到距离较近的多个第二节点中,即可将终端上报的区块链数据发送至所有节点中。使终端在进行区块链数据上报时,可以根据终端与节点的距离,节点与节点间的距离,来进行路径的选择。解决了现有技术中区块链数据上报大多采用固定的路径选择,数据上报的效率较低的问题,进行高效率的数据上报。The consensus platform, terminal, node and path selection method provided by the embodiments of the present application, by obtaining the signal strength of the terminal, it is judged that the terminal only reports the blockchain data when the communication environment is in a good state; Working state, so that the terminal only sends blockchain data to the nodes that are working normally; the distance between the terminal and each node is determined by the position of the terminal and the position of the node, and the first node and the second node are determined according to the distance between the terminal and each node, so that When reporting data, the terminal only needs to upload to the first node with a closer distance; the consensus platform calculates the distance between the first node and the second node according to the position of the first node and the position of the second node, and determines the first node corresponding to the second node. The third node in a node, so that the third node only needs to send the received blockchain data to multiple second nodes that are close to each other, and then the blockchain data reported by the terminal can be sent to all nodes. . When the terminal reports blockchain data, it can choose the path according to the distance between the terminal and the node, and the distance between the node and the node. It solves the problem of low efficiency of data reporting in the prior art that block chain data reporting mostly adopts fixed path selection, and performs high-efficiency data reporting.

附图说明Description of drawings

图1为本申请的实施例提供的一种区块链网络的结构示意图;FIG. 1 is a schematic structural diagram of a blockchain network provided by an embodiment of the present application;

图2为本申请的实施例提供的一种终端的硬件结构示意图;FIG. 2 is a schematic diagram of a hardware structure of a terminal according to an embodiment of the present application;

图3为本申请的实施例提供的一种服务器的硬件结构示意图;3 is a schematic diagram of a hardware structure of a server according to an embodiment of the present application;

图4为本申请的实施例提供的一种终端的结构示意图;FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present application;

图5为本申请的实施例提供的一种共识平台的结构示意图;FIG. 5 is a schematic structural diagram of a consensus platform provided by an embodiment of the present application;

图6为本申请的实施例提供的一种节点的结构示意图;FIG. 6 is a schematic structural diagram of a node according to an embodiment of the present application;

图7为本申请的实施例提供的一种路径选择方法的流程示意图。FIG. 7 is a schematic flowchart of a path selection method provided by an embodiment of the present application.

具体实施方式Detailed ways

下面结合附图对本申请的具体实施方式做进一步的详细说明。The specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

如图1所示,本申请的实施例提供的一种区块链网络的结构示意图,包括终端10和区块链20。其中,终端10可以是手机、笔记本电脑、个人数字助理、可穿戴移动电子设备等设备,区块链20由共识平台30和多个节点40组成,共识平台和节点40可以是计算机、服务器等设备。As shown in FIG. 1 , a schematic structural diagram of a blockchain network provided by an embodiment of the present application includes a terminal 10 and a blockchain 20 . Among them, the terminal 10 can be a mobile phone, a laptop computer, a personal digital assistant, a wearable mobile electronic device, etc., and the blockchain 20 is composed of a consensus platform 30 and a plurality of nodes 40, and the consensus platform and nodes 40 can be computers, servers, etc. equipment .

终端10与区块链20中的共识平台30、节点40可以通过无线进行通信,共识平台30和各个节点40间也可以通过有线或无线进行通信。终端10可以获取终端10当前的信号强度、位置等信息,用于执行下述实施例中路径选择方法的对应动作。节点40可以获取节点40当前的位置、工作状态等信息,并在当前位置、工作状态等发生变化时向共识平台30发送变化后的位置、工作状态等信息。共识平台可以从终端10、多个节点40获取对应的信息,以执行下述实施例中路径选择方法的对应动作。The terminal 10 and the consensus platform 30 and the nodes 40 in the blockchain 20 can communicate wirelessly, and the consensus platform 30 and each node 40 can also communicate through wired or wireless communication. The terminal 10 may acquire information such as the current signal strength and location of the terminal 10, which is used to execute the corresponding action of the path selection method in the following embodiments. The node 40 can obtain information such as the current position and working status of the node 40, and send the changed position, working status and other information to the consensus platform 30 when the current position, working status, etc. change. The consensus platform can obtain corresponding information from the terminal 10 and multiple nodes 40 to perform corresponding actions of the path selection method in the following embodiments.

示例性的,如图2所示,以终端10为手机为例,对终端10的结构进行说明。Exemplarily, as shown in FIG. 2 , the structure of the terminal 10 is described by taking the terminal 10 as a mobile phone as an example.

终端10可以包括:射频(radio frequency,RF)电路110、存储器120、输入模块130、显示模块140、传感器150、音频电路160、Wi-Fi模块170、处理器180、蓝牙模块181、摄像模块182以及电源190等部件。The terminal 10 may include: a radio frequency (RF) circuit 110 , a memory 120 , an input module 130 , a display module 140 , a sensor 150 , an audio circuit 160 , a Wi-Fi module 170 , a processor 180 , a Bluetooth module 181 , and a camera module 182 And components such as power supply 190 .

其中,RF电路110可用于在收发信息或通话过程中信号的接收和发送,可以接收基站的下行数据后交给处理器180处理;可以将上行数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等器件。Wherein, the RF circuit 110 can be used for receiving and sending signals during sending and receiving information or during a call, can receive downlink data from the base station and then hand it over to the processor 180 for processing; and can send uplink data to the base station. Typically, RF circuits include, but are not limited to, antennas, at least one amplifier, transceivers, couplers, low noise amplifiers, duplexers, and the like.

存储器120可用于存储软件程序及数据。处理器180通过运行存储在存储器120的软件程序或数据,从而执行终端10的各种功能以及数据处理。存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。存储器120存储有使得终端10能运行的操作系统,例如苹果公司所开发的

Figure BDA0002291909160000051
操作系统,谷歌公司所开发的
Figure BDA0002291909160000052
开源操作系统,微软公司所开发的
Figure BDA0002291909160000061
操作系统等。本申请中存储器120可以存储操作系统及各种应用程序,还可以存储执行本申请实施例方法的代码。The memory 120 may be used to store software programs and data. The processor 180 executes various functions of the terminal 10 and data processing by running software programs or data stored in the memory 120 . Memory 120 may include high speed random access memory, and may also include nonvolatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The memory 120 stores an operating system that enables the terminal 10 to run, such as an operating system developed by Apple Inc.
Figure BDA0002291909160000051
operating system, developed by Google
Figure BDA0002291909160000052
Open source operating system, developed by Microsoft
Figure BDA0002291909160000061
operating system, etc. In the present application, the memory 120 may store an operating system and various application programs, and may also store codes for executing the methods of the embodiments of the present application.

输入模块130(例如触摸屏)可用于接收输入的数字或字符信息,产生与终端10的用户设置以及功能控制有关的信号输入。具体地,输入模块130可以包括设置在终端10正面的触控屏131,可收集用户在其上或附近的触摸操作。The input module 130 (eg, a touch screen) may be used to receive input numerical or character information, and generate signal input related to user settings and function control of the terminal 10 . Specifically, the input module 130 may include a touch screen 131 disposed on the front of the terminal 10, and may collect the user's touch operations on or near it.

显示模块140(即显示屏)可用于显示由用户输入的信息或提供给用户的信息以及终端10的各种菜单的图形用户界面(graphical user interface,GUI)。显示模块140可包括设置在终端10正面的显示屏141。其中,显示屏141可以采用液晶显示器、有机发光二极管(organic light-emitting diode,OLED)显示器等形式来配置。显示模块140可以用于显示本申请中所述的各种图形用户界面。触控屏131可以覆盖在显示屏141之上,也可以将触控屏131与显示屏141集成而实现终端10的输入和输出功能,集成后可以简称触摸显示屏。The display module 140 (ie, a display screen) may be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal 10 . The display module 140 may include a display screen 141 disposed on the front of the terminal 10 . The display screen 141 may be configured in the form of a liquid crystal display, an organic light-emitting diode (organic light-emitting diode, OLED) display, or the like. The display module 140 may be used to display various graphical user interfaces described in this application. The touch screen 131 may cover the display screen 141 , or the touch screen 131 may be integrated with the display screen 141 to realize the input and output functions of the terminal 10 , which may be referred to as a touch screen after integration.

终端10还可以包括至少一种传感器150,比如光传感器、运动传感器。终端10还可配置有陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器。The terminal 10 may also include at least one sensor 150, such as a light sensor, a motion sensor. The terminal 10 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.

音频电路160、扬声器161、麦克风162可提供用户与终端10之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,麦克风162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出至RF电路110以发送给比如另一终端,或者将音频数据输出至存储器120以便进一步处理。The audio circuit 160 , the speaker 161 , and the microphone 162 may provide an audio interface between the user and the terminal 10 . The audio circuit 160 can transmit the received audio data converted electrical signal to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 160 After reception, it is converted into audio data, and the audio data is output to the RF circuit 110 for transmission to, for example, another terminal, or the audio data is output to the memory 120 for further processing.

Wi-Fi属于短距离无线传输技术,终端10可以通过Wi-Fi模块170帮助用户收发电子邮件、浏览网页和访问流媒体等,它为用户提供了无线的宽带互联网访问。Wi-Fi is a short-distance wireless transmission technology, and the terminal 10 can help users to send and receive emails, browse web pages, access streaming media, etc. through the Wi-Fi module 170, which provides users with wireless broadband Internet access.

处理器180是终端10的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器120内的软件程序,以及调用存储在存储器120内的数据,执行终端10的各种功能和处理数据。本申请中处理器180可以指一个或多个处理器,并且处理器180可包括一个或多个处理单元;处理器180还可以集成应用处理器和基带处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,基带处理器主要处理无线通信。可以理解的是,上述基带处理器也可以不集成到处理器180中。本申请中处理器180可以运行操作系统、应用程序、用户界面显示及触控响应,以及本申请实施例所述的方法。The processor 180 is the control center of the terminal 10, uses various interfaces and lines to connect various parts of the entire terminal, and executes the functions of the terminal 10 by running or executing the software programs stored in the memory 120 and calling the data stored in the memory 120. Various functions and processing data. In this application, the processor 180 may refer to one or more processors, and the processor 180 may include one or more processing units; the processor 180 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes operations System, user interface and application programs, etc., the baseband processor mainly handles wireless communication. It can be understood that, the above-mentioned baseband processor may not be integrated into the processor 180 . In this application, the processor 180 may run an operating system, an application program, user interface display and touch response, and the methods described in the embodiments of this application.

蓝牙模块181,用于通过蓝牙协议来与其他具有蓝牙模块的蓝牙设备进行信息交互。例如,终端10可以通过蓝牙模块181与同样具备蓝牙模块的可穿戴电子设备(例如智能手表)建立蓝牙连接,从而进行数据交互。The bluetooth module 181 is used to exchange information with other bluetooth devices having bluetooth modules through the bluetooth protocol. For example, the terminal 10 may establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 181, so as to perform data interaction.

摄像模块182(即摄像头)用于采集图像信息。The camera module 182 (ie the camera) is used to collect image information.

终端10还包括给各个部件供电的电源190(比如电池)。电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。Terminal 10 also includes a power source 190 (eg, a battery) for powering the various components. The power supply can be logically connected to the processor 180 through a power management system, so that functions such as managing charging, discharging, and power consumption are implemented through the power management system.

如图3所示,本申请的实施例提供了一种服务器的硬件结构示意图,该服务器可以是共识平台30或节点40。As shown in FIG. 3 , an embodiment of the present application provides a schematic diagram of a hardware structure of a server, and the server may be a consensus platform 30 or a node 40 .

该服务器包括一个或多个处理器301、存储器302、通信接口303以及通信总线304。其中,处理器301用于执行存储器302中存储的计算机执行指令,从而实现本申请下述实施例中路径选择方法的步骤或动作。存储器302用于存储执行本申请方案的计算机执行指令,并由处理器301来控制执行。通信接口303用于与终端10、共识平台30或节点40进行消息交互。通信总线104用于服务器各部件之间传输信息。The server includes one or more processors 301 , memory 302 , a communication interface 303 and a communication bus 304 . The processor 301 is configured to execute the computer-executed instructions stored in the memory 302, thereby implementing the steps or actions of the path selection method in the following embodiments of the present application. The memory 302 is used for storing computer-executed instructions for executing the solutions of the present application, and the execution is controlled by the processor 301 . The communication interface 303 is used for message interaction with the terminal 10 , the consensus platform 30 or the node 40 . The communication bus 104 is used to transfer information between components of the server.

如图4所示,本申请的实施例提供了一种终端10的结构示意图,该终端10包括:收发模块11、采集模块12。As shown in FIG. 4 , an embodiment of the present application provides a schematic structural diagram of a terminal 10 . The terminal 10 includes a transceiver module 11 and a collection module 12 .

具体的,收发模块11可以通过图3所示的用户终端20的RF电路110实现发送和/或接收功能,采集模块12可以通过图2所示的终端10中的处理器和RF电路110来获取信号强度、位置等信息以实现本申请下述实施例中的路径选择方法。Specifically, the transceiver module 11 can implement the sending and/or receiving function through the RF circuit 110 of the user terminal 20 shown in FIG. 3 , and the acquisition module 12 can be obtained through the processor and the RF circuit 110 in the terminal 10 shown in FIG. 2 . Signal strength, location and other information to implement the path selection method in the following embodiments of the present application.

如图5所示,本申请的实施例提供了一种共识平台30的结构示意图,该共识平台30包括:收发模块31、处理模块32。As shown in FIG. 5 , an embodiment of the present application provides a schematic structural diagram of a consensus platform 30 , where the consensus platform 30 includes a transceiver module 31 and a processing module 32 .

具体的,收发模块31可以通过图3所示的服务器中的通信接口303实现发送和/或接收功能,处理模块32可以通过图3所示的服务器中的处理器301调用存储器302中存储的计算机执行指令来实现本申请下述实施例的路径选择方法。Specifically, the transceiver module 31 can implement the sending and/or receiving function through the communication interface 303 in the server shown in FIG. 3 , and the processing module 32 can call the computer stored in the memory 302 through the processor 301 in the server shown in FIG. 3 . The instructions are executed to implement the path selection method of the following embodiments of the present application.

如图6所示,本申请的实施例提供了一种节点40的结构示意图,该节点40包括:收发模块41、处理模块42。As shown in FIG. 6 , an embodiment of the present application provides a schematic structural diagram of a node 40 , where the node 40 includes a transceiver module 41 and a processing module 42 .

具体的,收发模块41可以通过图3所示的服务器中的通信接口303实现发送和/或接收功能,处理模块42可以通过如图3所示的服务器中的处理器301调用存储器302中存储的计算机执行指令来实现本申请下述实施例的路径选择方法。Specifically, the transceiver module 41 can implement the sending and/or receiving function through the communication interface 303 in the server shown in FIG. 3 , and the processing module 42 can call the data stored in the memory 302 through the processor 301 in the server shown in FIG. 3 . The computer executes the instructions to implement the path selection methods of the following embodiments of the present application.

图7为本申请的实施例提供的一种路径选择方法的流程示意图,应用于如图1所示的制冷设备控制系统中。该制冷设备控制方法具体包括如下步骤:FIG. 7 is a schematic flowchart of a path selection method provided by an embodiment of the present application, which is applied to the refrigeration equipment control system shown in FIG. 1 . The refrigeration equipment control method specifically includes the following steps:

S701、终端获取终端的信号强度。S701. The terminal acquires the signal strength of the terminal.

具体的,终端10的采集模块12获取终端10的信号强度。Specifically, the acquisition module 12 of the terminal 10 acquires the signal strength of the terminal 10 .

终端10在每次进行区块链数据上报前,首先获取当前所处通信环境的信号强度等信息,以避免在信号较差的通信环境下进行区块链数据上报,造成数据传输缓慢、数据传输不完整等情况的发生。The terminal 10 first obtains information such as the signal strength of the current communication environment before reporting the blockchain data each time, so as to avoid reporting the blockchain data in a communication environment with poor signal, resulting in slow data transmission and data transmission. Incompleteness and so on.

S702、终端根据信号强度判断是否获取终端的位置。S702. The terminal determines whether to acquire the location of the terminal according to the signal strength.

具体的,终端10的采集模块12在信号强度小于或等于预设值时,在预设时间后重新获取信号强度;在信号强度大于预设值时,获取终端10的位置。Specifically, the acquisition module 12 of the terminal 10 re-acquires the signal strength after a preset time when the signal strength is less than or equal to the preset value; and acquires the location of the terminal 10 when the signal strength is greater than the preset value.

考虑到终端10的位置会随用户的位置变化而产生变化,此时,终端所处的通信环境也是实时变化的。因此,终端10在判断信号强度小于或等于预设值时,判断当前通信环境不适合进行区块链数据上报,将数据缓存在终端10中,并周期性的获取和判断通信环境的信号强度。Considering that the location of the terminal 10 will change with the location of the user, at this time, the communication environment where the terminal is located also changes in real time. Therefore, when the terminal 10 judges that the signal strength is less than or equal to the preset value, it judges that the current communication environment is not suitable for blockchain data reporting, caches the data in the terminal 10, and periodically obtains and judges the signal strength of the communication environment.

在信号强度大于预设值时,终端10判断当前通信环境良好,适合进行区块链数据上报,此时,终端10获取终端10的位置。示例性的,终端10的位置可以是终端10的经纬度坐标。When the signal strength is greater than the preset value, the terminal 10 determines that the current communication environment is good and suitable for reporting the blockchain data. At this time, the terminal 10 obtains the location of the terminal 10 . Exemplarily, the location of the terminal 10 may be the latitude and longitude coordinates of the terminal 10 .

S703、终端向共识平台发送终端的位置。S703, the terminal sends the location of the terminal to the consensus platform.

具体的,终端10的收发模块11向共识平台30发送终端10的位置。Specifically, the transceiver module 11 of the terminal 10 sends the location of the terminal 10 to the consensus platform 30 .

S704、节点获取节点的位置和工作状态。S704, the node obtains the location and working state of the node.

具体的,节点40的处理模块42获取节点40的位置和工作状态。Specifically, the processing module 42 of the node 40 acquires the location and working status of the node 40 .

其中,节点40的位置可以是节点的经纬度坐标,工作状态可以是正常工作、宕机、高延迟等状态。The location of the node 40 may be the latitude and longitude coordinates of the node, and the working state may be a state of normal operation, downtime, and high delay.

S705、节点向共识平台发送节点的位置和工作状态。S705, the node sends the location and working status of the node to the consensus platform.

具体的,节点40的收发模块41向共识平台30发送节点40的位置和工作状态。Specifically, the transceiver module 41 of the node 40 sends the location and working status of the node 40 to the consensus platform 30 .

可选的,节点40的处理模块42还可以获取节点40的网络延迟、当前访问用户数量等信息,节点40的收发模块41可以向共识节点发送这些信息,使共识平台30可以根据这些信息进行路径选择,以进一步提高区块链数据上报的效率。Optionally, the processing module 42 of the node 40 can also obtain information such as the network delay of the node 40, the current number of accessing users, etc., and the transceiver module 41 of the node 40 can send these information to the consensus node, so that the consensus platform 30 can perform routing according to the information. Select to further improve the efficiency of blockchain data reporting.

S706、共识平台从终端接收终端的位置,从多个节点接收多个节点的位置和工作状态。S706, the consensus platform receives the location of the terminal from the terminal, and receives the location and working status of multiple nodes from multiple nodes.

具体的,共识平台30的收发模块31从终端10接收终端10的位置,从多个节点40接收多个节点40的位置和工作状态。Specifically, the transceiver module 31 of the consensus platform 30 receives the position of the terminal 10 from the terminal 10 , and receives the positions and working states of the plurality of nodes 40 from the plurality of nodes 40 .

示例性的,共识平台30在接收到多个节点40的位置和工作状态后,可以生成如表1所示的节点位置状态地址列表:Exemplarily, after receiving the locations and working states of multiple nodes 40, the consensus platform 30 may generate a node location state address list as shown in Table 1:

表1Table 1

节点编号Node number 位置Location 工作状态working status IP地址IP address 11 (x1,y1)(x1,y1) 正常工作normal work IP1IP1 22 (x2,y2)(x2,y2) 正常工作normal work IP2IP2 33 (x3,y3)(x3,y3) 正常工作normal work IP3IP3 44 (x4,y4)(x4,y4) 宕机downtime IP4IP4 nn (xn,yn)(xn,yn) 正常工作normal work IPnIPn

可选的,在节点40的位置或工作状态发生变化时,节点40的处理模块42获取节点40当前的位置和工作状态,节点40的收发模块41向共识平台30发送节点40当前的位置和工作状态。通过发送变化后节点40的位置和工作状态。共识平台30可以根据节点40当前的位置和工作状态更新表1。Optionally, when the position or working status of the node 40 changes, the processing module 42 of the node 40 obtains the current position and working status of the node 40, and the transceiver module 41 of the node 40 sends the current position and working status of the node 40 to the consensus platform 30. state. By sending the position and working status of the node 40 after the change. The consensus platform 30 can update Table 1 according to the current position and working status of the node 40 .

S707、共识平台根据终端的位置、多个节点的位置和工作状态,确定至少一个第一节点和至少一个第二节点。S707. The consensus platform determines at least one first node and at least one second node according to the location of the terminal, the locations and working states of multiple nodes.

具体的,共识平台30的处理模块32根据终端的位置、多个节点的位置和工作状态,确定至少一个第一节点50和至少一个第二节点60。其中,第一节点50与终端10的距离小于第二节点60与终端10的距离。Specifically, the processing module 32 of the consensus platform 30 determines at least one first node 50 and at least one second node 60 according to the location of the terminal, the locations and working states of multiple nodes. The distance between the first node 50 and the terminal 10 is smaller than the distance between the second node 60 and the terminal 10 .

可选的,共识平台30的处理模块32可以根据一下方法确定至少一个第一节点50和至少一个第二节点60:Optionally, the processing module 32 of the consensus platform 30 may determine at least one first node 50 and at least one second node 60 according to the following methods:

共识平台30的处理模块32根据多个节点40的工作状态,确定多个第四节点;根据终端10的位置和多个第四节点的位置,确定终端10与多个第四节点中每个节点的距离;根据距离的大小确定距离的中位数,确定多个第四节点中距离小于或等于中位数的节点为第一节点50,确定多个第四节点中距离大于中位数的节点为第二节点60。The processing module 32 of the consensus platform 30 determines a plurality of fourth nodes according to the working states of the plurality of nodes 40; according to the position of the terminal 10 and the positions of the plurality of fourth nodes, determines each node of the terminal 10 and the plurality of fourth nodes Determine the median of the distance according to the size of the distance, determine the node whose distance is less than or equal to the median among the plurality of fourth nodes as the first node 50, and determine the node whose distance is greater than the median among the plurality of fourth nodes is the second node 60 .

其中,多个第四节点为处于正常工作状态的节点。The plurality of fourth nodes are nodes in a normal working state.

示例性的,共识平台30根据终端10的位置和多个第四节点的位置,可以生成如表2所示终端-节点距离表:Exemplarily, the consensus platform 30 can generate the terminal-node distance table as shown in Table 2 according to the position of the terminal 10 and the positions of the plurality of fourth nodes:

表2Table 2

节点编号Node number 距离distance 11 R1R1 22 R2R2 33 R3R3 44 ---------- nn R5R5

其中,节点编号为4的节点的工作作状态为宕机状态,因此不计算该节点40与终端10的距离。The working state of the node with the node number 4 is the down state, so the distance between the node 40 and the terminal 10 is not calculated.

可选的,终端10可以在位置发生变化且信号强度大于预设值时,向共识平台30发送终端10的位置,共识平台30可以根据终端10的位置和节点40的位置、工作状态等信息实时更新表2。Optionally, the terminal 10 can send the location of the terminal 10 to the consensus platform 30 when the location changes and the signal strength is greater than the preset value, and the consensus platform 30 can real-time based on the location of the terminal 10 and the location and working status of the node 40 and other information. Update Table 2.

根据节点40的工作状态,筛选出处于正常工作状态的节点,避免出现节点40宕机时,终端10依旧将区块链数据上传至该节点,造成的效率的降低。According to the working state of the node 40, the node in the normal working state is screened out, so as to avoid the reduction of the efficiency caused by the terminal 10 still uploading the blockchain data to the node when the node 40 is down.

根据正常工作的节点40的位置与终端10的位置,确定距离终端10较近的正常工作的节点40作为第一节点50,将较远的节点40作为第二节点60,使终端在进行区块链数据上报时,只需要发送给距离较近的第一节点50。According to the position of the normal working node 40 and the position of the terminal 10, the normal working node 40 that is closer to the terminal 10 is determined as the first node 50, and the farther node 40 is used as the second node 60, so that the terminal is performing the block When the chain data is reported, it only needs to be sent to the first node 50 that is closer.

示例性的,节点40的数量可以是100个,其中工作状态为正常工作的节点可以是80个。共识平台30的处理模块根据100个节点40的工作状态,确定80个第四节点,并计算终端10这80个第四节点的距离,确定这些距离的中位数,并将其中小于或等于中位数的节点作为第一节点,将其中大于中位数的节点确定为第二节点60,从二确定40个第一节点和40个第二节点。Exemplarily, the number of nodes 40 may be 100, and the number of nodes whose working status is normal working may be 80. The processing module of the consensus platform 30 determines 80 fourth nodes according to the working status of the 100 nodes 40, calculates the distances of the 80 fourth nodes of the terminal 10, determines the median of these distances, and calculates the median of these distances as less than or equal to the median. The node with the number of digits is used as the first node, the node greater than the median is determined as the second node 60, and 40 first nodes and 40 second nodes are determined from two.

可选的,共识平台30的处理模块32还可以根据预设配置文件确定预设数量的第一节点50,并确定其它第四节点为第二节点60。使终端10在进行区块链数据上报时,只需发送给预设数量的第一节点50。Optionally, the processing module 32 of the consensus platform 30 may also determine a preset number of first nodes 50 according to a preset configuration file, and determine other fourth nodes as the second nodes 60 . The terminal 10 only needs to send the data to a preset number of first nodes 50 when reporting the blockchain data.

S708、共识平台向终端发送至少一个第一节点的IP地址。S708, the consensus platform sends the IP address of at least one first node to the terminal.

具体的,共识平台30的收发模块31向终端10发送至少一个第一节点50的IP地址。Specifically, the transceiver module 31 of the consensus platform 30 sends the IP address of at least one first node 50 to the terminal 10 .

其中,至少一个第一节点50的IP地址用于指示终端10向至少一个第一节点50发送区块链数据。Wherein, the IP address of the at least one first node 50 is used to instruct the terminal 10 to send the blockchain data to the at least one first node 50 .

S709、共识平台根据至少一个第一节点的位置、至少一个第二节点的位置,确定每个第二节点对应的第三节点。S709. The consensus platform determines a third node corresponding to each second node according to the position of at least one first node and the position of at least one second node.

具体的,共识平台30的处理模块32根据至少一个第一节点50的位置、至少一个第二节点60的位置,确定每个第二节点60对应的第三节点。Specifically, the processing module 32 of the consensus platform 30 determines the third node corresponding to each second node 60 according to the position of at least one first node 50 and the position of at least one second node 60 .

其中,第三节点为与至少一个第二节点60中的一个节点距离最近的第一节点50。The third node is the first node 50 that is closest to one of the at least one second node 60 .

可选的,共识平台30的处理模块32根据至少一个第一节点50的位置、至少一个第二节点60的位置,确定第二节点60与每个第一节点50的距离,确定与该第二节点60距离最近的第一节点50为对应的第三节点。Optionally, the processing module 32 of the consensus platform 30 determines the distance between the second node 60 and each first node 50 according to the position of at least one first node 50 and the position of at least one second node 60, and determines the distance between the second node 60 and each first node 50. The first node 50 closest to the node 60 is the corresponding third node.

通过确定每个第二节点60对应的至少一个第一节点50中的第三节点,使第一节点50从终端10接收的区块链数据,可以以最快的速度传输至第二节点60中。根据第二节点60与每个第一节点50的距离,可能出现一个第一节点50对应多个第二节点60,此时,部分没有对应的第二节点60的第一节点50则不需要向第二节点60发送区块链数据。By determining the third node in at least one first node 50 corresponding to each second node 60, the blockchain data received by the first node 50 from the terminal 10 can be transmitted to the second node 60 at the fastest speed . According to the distance between the second node 60 and each first node 50, there may be one first node 50 corresponding to multiple second nodes 60. At this time, some first nodes 50 without corresponding second nodes 60 do not need to The second node 60 sends the blockchain data.

S710、共识平台向第三节点发送对应的第二节点的IP地址。S710. The consensus platform sends the IP address of the corresponding second node to the third node.

具体的,共识平台30的收发模块向第三节点发送对应的第二节点60的IP地址。Specifically, the transceiver module of the consensus platform 30 sends the corresponding IP address of the second node 60 to the third node.

其中,第二节点的IP地址用于指示第三节点向对应的第二节点60发送区块链数据。The IP address of the second node is used to instruct the third node to send blockchain data to the corresponding second node 60 .

S711、终端从共识平台接收至少一个第一节点的IP地址。S711. The terminal receives the IP address of at least one first node from the consensus platform.

具体的,终端10的收发模块11从共识平台30接收至少一个第一节点50的IP地址。Specifically, the transceiver module 11 of the terminal 10 receives the IP address of at least one first node 50 from the consensus platform 30 .

S712、终端向至少一个第一节点发送区块链数据。S712. The terminal sends blockchain data to at least one first node.

具体的,终端10的收发模块11向至少一个第一节点50发送区块链数据。Specifically, the transceiver module 11 of the terminal 10 sends blockchain data to at least one first node 50 .

终端10根据接收的至少一个第一节点50的IP地址,将区块量数据发送给距离最近的至少一个第一节点50。The terminal 10 sends the block amount data to at least one nearest first node 50 according to the received IP address of at least one first node 50 .

S713、节点从共识平台接收对应的第二节点的IP地址,从终端接收区块链数据。S713, the node receives the IP address of the corresponding second node from the consensus platform, and receives the blockchain data from the terminal.

具体的,节点40的收发模块41从共识平台30接收对应的第二节点60的IP地址,从终端10接收区块链数据。Specifically, the transceiver module 41 of the node 40 receives the IP address of the corresponding second node 60 from the consensus platform 30 , and receives the blockchain data from the terminal 10 .

S714、节点向对应的第二节点发送区块链数据。S714, the node sends the blockchain data to the corresponding second node.

具体的,节点40向对应的第二节点60发送区块链数据。Specifically, the node 40 sends the blockchain data to the corresponding second node 60 .

节点40中的第一节点50根据从共识平台30接收的对应的第二节点60的IP地址,将从终端10接收的区块链数据发送给对应的第二节点60,使终端10的区块链数据能够发送到所有正常工作的节点40。The first node 50 in the nodes 40 sends the blockchain data received from the terminal 10 to the corresponding second node 60 according to the IP address of the corresponding second node 60 received from the consensus platform 30, so that the block Chain data can be sent to all functioning nodes 40.

本申请实施例提供的路径选择方法,通过获取终端的信号强度,判断终端只在通信环境状态较好的情况下进行区块链数据上报;共识平台通过获取节点的工作状态,使终端只向正常工作的节点发送区块链数据;通过终端的位置和节点的位置确定终端与各个节点的距离,并根据终端与各个节点距离确定第一节点和第二节点,使终端在进行数据上报时只需上传到距离较近的第一节点;共识平台根据第一节点的位置与第二节点的位置计算第一节点与第二节点的距离,确定第二节点对应的第一节点中的第三节点,使第三节点只需要将接收到的区块链数据发送到距离较近的多个第二节点中,即可将终端上报的区块链数据发送至所有节点中。使终端在进行区块链数据上报时,可以根据终端与节点的距离,节点与节点间的距离,来进行路径的选择。解决了现有技术中区块链数据上报大多采用固定的路径选择,数据上报的效率较低的问题,进行高效率的数据上报。The path selection method provided by the embodiments of the present application determines that the terminal only reports blockchain data when the communication environment is in a good state by acquiring the signal strength of the terminal; The working node sends blockchain data; the distance between the terminal and each node is determined by the position of the terminal and the position of the node, and the first node and the second node are determined according to the distance between the terminal and each node, so that the terminal only needs to report data. Upload to the first node with a closer distance; the consensus platform calculates the distance between the first node and the second node according to the position of the first node and the position of the second node, and determines the third node in the first node corresponding to the second node, The third node only needs to send the received blockchain data to multiple second nodes that are close to each other, and then the blockchain data reported by the terminal can be sent to all nodes. When the terminal reports blockchain data, it can choose the path according to the distance between the terminal and the node, and the distance between the node and the node. The method solves the problem that most of the blockchain data reporting in the prior art adopts a fixed path selection, and the efficiency of data reporting is low, and high-efficiency data reporting is performed.

本申请的实施例提供一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被计算机执行时使计算机执行如图7中所述的路径选择方法。Embodiments of the present application provide a computer-readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a computer, cause the computer to execute the path described in FIG. 7 Method of choosing.

本申请的实施例提供一种包含指令的计算机程序产品,当指令在计算机上运行时,使得计算机执行如图7中所述的路径选择方法。Embodiments of the present application provide a computer program product containing instructions that, when executed on a computer, cause the computer to execute the path selection method as described in FIG. 7 .

本申请的实施例提供一种路径选择装置,包括:处理器和存储器,存储器用于存储程序,处理器调用存储器存储的程序,以执行如图7中所述的路径选择方法。An embodiment of the present application provides a path selection apparatus, including: a processor and a memory, the memory is used for storing a program, and the processor calls the program stored in the memory to execute the path selection method as described in FIG. 7 .

由于本申请的实施例中的路径选择装置、计算机可读存储介质、计算机程序产品可以应用于上述路径选择方法,因此,其所能获得的技术效果也可参考上述方法实施例,本申请的实施例在此不再赘述。Since the path selection device, computer-readable storage medium, and computer program product in the embodiments of the present application can be applied to the above-mentioned path selection method, the technical effects that can be obtained can also refer to the above-mentioned method embodiments. The example will not be repeated here.

需要说明的是,上述各单元可以为单独设立的处理器,也可以集成在控制器的某一个处理器中实现,此外,也可以以程序代码的形式存储于控制器的存储器中,由控制器的某一个处理器调用并执行以上各单元的功能。这里所述的处理器可以是一个中央处理器(Central Processing Unit,CPU),或者是特定集成电路(Application SpecificIntegrated Circuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路。It should be noted that the above-mentioned units may be processors established separately, or may be integrated into a certain processor of the controller to be implemented. In addition, they may also be stored in the memory of the controller in the form of program codes, and the controller A certain processor of the system calls and executes the functions of the above units. The processor described here may be a central processing unit (Central Processing Unit, CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application .

应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

Claims (5)

1. A consensus platform, comprising:
the receiving and sending module is used for receiving the position of the terminal from the terminal and receiving the positions and the working states of the nodes from the nodes;
the processing module is used for determining at least one first node and at least one second node according to the position of the terminal, the positions of the plurality of nodes and the working state, wherein the distance between the first node and the terminal is smaller than the distance between the second node and the terminal;
the transceiver module is further configured to send an IP address of the at least one first node to the terminal, where the IP address of the at least one first node is used to instruct the terminal to send blockchain data to the at least one first node;
The processing module is further configured to determine a third node corresponding to each second node according to the position of the at least one first node and the position of the at least one second node, where the third node is a first node closest to one of the at least one second node;
the transceiver module is further configured to send an IP address of the second node to the third node, where the IP address of the second node is used to instruct the third node to send the block chain data to the second node;
the processing module is specifically configured to:
determining a plurality of fourth nodes according to the working states of the plurality of nodes, wherein the plurality of fourth nodes are nodes in normal working states;
determining the distance between the terminal and each node in the plurality of fourth nodes according to the position of the terminal and the positions of the plurality of fourth nodes;
determining a median of the distance according to the size of the distance, determining a node of the plurality of fourth nodes, the distance of which is less than or equal to the median, as the first node, and determining a node of the plurality of fourth nodes, the distance of which is greater than the median, as the second node.
2. A method for path selection, comprising:
the consensus platform receives the position of the terminal from the terminal, and receives the positions and the working states of a plurality of nodes from the plurality of nodes;
the consensus platform determines at least one first node and at least one second node according to the position of the terminal, the positions of the plurality of nodes and the working state, wherein the distance between the first node and the terminal is smaller than the distance between the second node and the terminal;
the consensus platform sends the IP address of the at least one first node to the terminal, wherein the IP address of the at least one first node is used for instructing the terminal to send the blockchain data to the at least one first node;
the consensus platform determines a third node corresponding to each second node according to the position of the at least one first node and the position of the at least one second node, wherein the third node is the first node closest to one of the at least one second node;
the common identification platform sends the corresponding IP address of the second node to the third node, wherein the IP address of the second node is used for indicating the third node to send the block chain data to the corresponding second node;
The consensus platform determines at least one first node and at least one second node according to the position of the terminal, the positions of the plurality of nodes and the working state, and the consensus platform comprises the following steps:
the consensus platform determines a plurality of fourth nodes according to the working states of the plurality of nodes, wherein the plurality of fourth nodes are nodes in normal working states;
the consensus platform determines the distance between the terminal and each node in the plurality of fourth nodes according to the position of the terminal and the positions of the plurality of fourth nodes;
the consensus platform determines a median of the distance according to the size of the distance, determines a node of the plurality of fourth nodes, the distance of which is less than or equal to the median, as the first node, and determines a node of the plurality of fourth nodes, the distance of which is greater than the median, as the second node.
3. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computer, cause the computer to perform the path selection method of claim 2.
4. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the path selection method of claim 2.
5. A path selection device, comprising: a processor and a memory, the memory for storing a program, the processor calling the program stored by the memory to perform the path selection method of claim 2.
CN201911183707.XA 2019-11-27 2019-11-27 A Consensus Platform, Terminal, Node and Path Selection Method Active CN110933166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911183707.XA CN110933166B (en) 2019-11-27 2019-11-27 A Consensus Platform, Terminal, Node and Path Selection Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911183707.XA CN110933166B (en) 2019-11-27 2019-11-27 A Consensus Platform, Terminal, Node and Path Selection Method

Publications (2)

Publication Number Publication Date
CN110933166A CN110933166A (en) 2020-03-27
CN110933166B true CN110933166B (en) 2022-08-12

Family

ID=69847547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911183707.XA Active CN110933166B (en) 2019-11-27 2019-11-27 A Consensus Platform, Terminal, Node and Path Selection Method

Country Status (1)

Country Link
CN (1) CN110933166B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438308B (en) * 2021-06-23 2022-12-23 上海简苏网络科技有限公司 Efficient communication method and system based on block chain

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394353B (en) * 2008-10-13 2011-11-02 北京邮电大学 Data packet competition forwarding method used in vehicle-mounted Ad hoc network
CN102148763B (en) * 2011-04-28 2013-12-25 南京航空航天大学 Dynamic path distribution method and system applicable to network on chip
CN102255807B (en) * 2011-07-07 2013-10-02 浙江大学 Multipath segmental routing method based on multihop network with master-slave structure
CN107395659B (en) * 2017-03-28 2021-08-24 创新先进技术有限公司 Method and device for business acceptance and consensus
EP3571808A4 (en) * 2018-12-28 2020-03-04 Alibaba Group Holding Limited IMPROVE THE SPEED OF BLOCKCHAIN TRANSACTIONS USING GLOBAL ACCELERATION NODES
CN109617994A (en) * 2018-12-30 2019-04-12 于涛 A kind of method and system positioning block chain interior joint position
CN110166567B (en) * 2019-06-04 2021-10-08 长春理工大学 A method and system for Internet of Things resource sharing based on blockchain
CN110324415B (en) * 2019-06-28 2022-04-05 百度在线网络技术(北京)有限公司 Method, device, equipment and medium for realizing routing of peer-to-peer network
CN110445882A (en) * 2019-09-19 2019-11-12 腾讯科技(深圳)有限公司 Communication connecting method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110933166A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN106686070B (en) Database data migration method, device, terminal and system
CN104954631B (en) A kind of method for processing video frequency, device and system
CN113382439A (en) Information reporting method, access mode determining method, terminal and network equipment
CN106708554B (en) Program operating method and device
WO2021243884A1 (en) Network element determination method and device
CN107135128B (en) Call chain data acquisition method, mobile terminal and computer-readable storage medium
CN104360307A (en) Positioning method and positioning device
CN109995862B (en) A resource scheduling method and terminal
CN110890943A (en) Determination method, terminal device and network device
CN115617278B (en) Path device selection method and device, electronic device and readable storage medium
CN111836376A (en) An uplink transmission method, an uplink transmission control method and related equipment
WO2020143579A1 (en) Link aggregation implementation method and related product
CN105227598B (en) Resource sharing method, device and system based on cloud storage
CN111278005B (en) Capability information reporting method, precoding matrix indication feedback method and related equipment
CN110933166B (en) A Consensus Platform, Terminal, Node and Path Selection Method
CN111800861A (en) Power control method and device
CN109644364B (en) Channel state information measuring and feedback method and related product
CN112132338A (en) Scheduling optimization method and device for robot automatic distribution
US11057329B2 (en) Message record combination and display method and terminal device
CN107317828B (en) File downloading method and device
CN110071788A (en) Channel state information reference signals transmission method, the network equipment and terminal
CN116094963A (en) Traffic duty ratio statistical method and device, electronic equipment and storage medium
CN105577712B (en) A kind of file uploading method, device and system
WO2020029723A1 (en) Positioning method, related device, and computer readable storage medium
CN110213069B (en) Data forwarding method and device, disaster recovery system and storage medium

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