[go: up one dir, main page]

CN113825139B - Block chain-based fingerprint positioning method and system for position of Internet of things equipment - Google Patents

Block chain-based fingerprint positioning method and system for position of Internet of things equipment Download PDF

Info

Publication number
CN113825139B
CN113825139B CN202110957559.3A CN202110957559A CN113825139B CN 113825139 B CN113825139 B CN 113825139B CN 202110957559 A CN202110957559 A CN 202110957559A CN 113825139 B CN113825139 B CN 113825139B
Authority
CN
China
Prior art keywords
positioning
fingerprint
electromagnetic
node
chain
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
CN202110957559.3A
Other languages
Chinese (zh)
Other versions
CN113825139A (en
Inventor
关振宇
温晓晴
李大伟
徐迈
李海花
孟涛
赵伟程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN202110957559.3A priority Critical patent/CN113825139B/en
Publication of CN113825139A publication Critical patent/CN113825139A/en
Application granted granted Critical
Publication of CN113825139B publication Critical patent/CN113825139B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/63Location-dependent; Proximity-dependent
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/10Detection; Monitoring
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/50Safety; Security of things, users, data or systems
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/60Positioning; Navigation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/10Integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/12Detection or prevention of fraud
    • H04W12/121Wireless intrusion detection systems [WIDS]; Wireless intrusion prevention systems [WIPS]
    • H04W12/122Counter-measures against attacks; Protection against rogue devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • H04W64/006Locating users or terminals or network equipment for network management purposes, e.g. mobility management with additional information processing, e.g. for direction or speed determination
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/80Wireless
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/121Timestamp
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The application discloses a method and a system for positioning position fingerprints of Internet of things equipment based on a blockchain, wherein the method comprises the steps of establishing an on-chain position fingerprint database based on the blockchain; uploading corresponding electromagnetic fingerprints by the Internet of things equipment with the positioned actual positions in the area, recording the electromagnetic fingerprints in a position fingerprint database, training a positioning model by solving nodes under an intelligent contract distribution chain, and generating an electromagnetic fingerprint positioning algorithm model after the solving nodes read the position fingerprint database; and receiving positioning requests of other nodes, generating positioning results on the chain by using an electromagnetic fingerprint positioning algorithm model according to the positioning requests, and returning the positioning results to the other nodes sending the positioning requests. The method solves the problems of lack of positioning capability and positioning tampering and forging of the Internet of things equipment, can be used for improving the positioning safety of the Internet of things equipment and provides positioning service for part of the Internet of things equipment without positioning capability.

Description

基于区块链的物联网设备位置指纹定位方法及系统Blockchain-based location fingerprint positioning method and system for IoT devices

技术领域Technical Field

本申请涉及信息安全技术领域,特别涉及一种基于区块链的物联网设备位置指纹定位方法及系统。The present application relates to the field of information security technology, and in particular to a blockchain-based method and system for locating a fingerprint of an IoT device.

背景技术Background Art

物联网是称为“物”的传感器和执行器节点的网络。“事物”是指感知物理世界信号并将其以数字形式记录的设备或传感器。基于位置的服务(LBS)应用于包括军事,电子医疗,环境监控,天气预报,预警和救援等各个领域中,位置信息对于各种无线传感器网络应用起着重要作用。全球定位系统(GPS)和北斗定位系统可以作为LBS的解决方案,但并不是所有的物联网设备都具有GPS或是北斗定位的能力,且单一的GPS定位易受到伪造、篡改的攻击,所以单一的定位技术并不适合所有应用。作为北斗与GPS定位的辅助,电磁指纹定位技术利用电磁环境作为指纹,将设备的电磁指纹与前期采集形成的指纹库进行比对,以确定设备所在位置,可以有效解决物联网设备缺乏定位模块以及定位信息易收到篡改的问题。The Internet of Things is a network of sensor and actuator nodes called "things". "Things" refer to devices or sensors that sense signals from the physical world and record them in digital form. Location-based services (LBS) are used in various fields including military, electronic medical, environmental monitoring, weather forecasting, early warning and rescue, and location information plays an important role in various wireless sensor network applications. The Global Positioning System (GPS) and Beidou positioning system can be used as LBS solutions, but not all IoT devices have GPS or Beidou positioning capabilities, and single GPS positioning is vulnerable to forgery and tampering attacks, so a single positioning technology is not suitable for all applications. As an auxiliary to Beidou and GPS positioning, electromagnetic fingerprint positioning technology uses the electromagnetic environment as a fingerprint, compares the electromagnetic fingerprint of the device with the fingerprint library formed in the early stage, to determine the location of the device, which can effectively solve the problem that IoT devices lack positioning modules and the positioning information is easily tampered.

近年来,越来越多的物联网(IoT)设备被部署,包括手机、电脑、各种传感器等。基于位置的服务(LBS)利用位置数据为用户提供适当的信息,例如附近的商家、附近的交通状况等。LBS广泛应用于车联网、电子医疗、环境监测、家庭办公自动化等。位置信息在各种无线传感器网络应用中扮演着重要的角色。全球定位系统(GPS)可用作基于位置的服务的解决方案。然而,物联网厂商往往不把安全作为优先考虑因素,这给物联网中的定位服务带来了一些安全风险。此外,一些物联网设备不具备主动定位自身的能力,例如摄像头、传感器等,它们没有定位模块。In recent years, more and more Internet of Things (IoT) devices have been deployed, including mobile phones, computers, various sensors, etc. Location-based services (LBS) use location data to provide users with appropriate information, such as nearby businesses, nearby traffic conditions, etc. LBS is widely used in Internet of Vehicles, e-health, environmental monitoring, home office automation, etc. Location information plays an important role in various wireless sensor network applications. The Global Positioning System (GPS) can be used as a solution for location-based services. However, IoT vendors often do not prioritize security, which brings some security risks to positioning services in IoT. In addition, some IoT devices do not have the ability to actively locate themselves, such as cameras, sensors, etc., which do not have positioning modules.

区块链是随着比特币等数字加密货币的日益普及而逐渐兴起的一种去中心化基础架构,全网认证的独特工作机制使得其在分布式系统和对等(P2P)网络中具备防欺骗、防双重支付等特点。经过几年的发展和改进,区块链已逐步脱离比特币,成为了一种新型的分布式、去中心化的技术方案,独立地成为网络技术创新的热点,开创了一种全新的数据分布式存储技术,其应用受到了越来越多的关注。作为一种低成本建立信任的新型计算范式和协作模式,区块链凭借其独有的信任建立机制,正在改变诸多行业的应用场景和运行规则,是未来构建新型信任体系不可或缺的技术之一。Blockchain is a decentralized infrastructure that has gradually emerged with the increasing popularity of digital cryptocurrencies such as Bitcoin. The unique working mechanism of full network authentication enables it to have anti-fraud and anti-double payment characteristics in distributed systems and peer-to-peer (P2P) networks. After several years of development and improvement, blockchain has gradually separated from Bitcoin and become a new type of distributed and decentralized technical solution. It has independently become a hot spot for network technology innovation and has created a new data distributed storage technology. Its application has received more and more attention. As a new computing paradigm and collaboration model for establishing trust at a low cost, blockchain is changing the application scenarios and operating rules of many industries with its unique trust establishment mechanism. It is one of the indispensable technologies for building a new trust system in the future.

区块链技术的应用,为解决电磁指纹定位过程中离线数据收集复杂、中心化计算存储的隐私保护、定位信息共享困难的等问题提供了新的思路,结合智能合约实现链上计算与链下计算相结合指纹定位方案,形成在线更新的分布式定位方案。综上,基于区块链的物联网设备定位技术研究具有重要意义。The application of blockchain technology provides a new way to solve the problems of complex offline data collection, privacy protection of centralized computing and storage, and difficulty in sharing positioning information in the process of electromagnetic fingerprint positioning. It combines smart contracts to realize the fingerprint positioning solution that combines on-chain computing with off-chain computing, forming an online updated distributed positioning solution. In summary, the research on IoT device positioning technology based on blockchain is of great significance.

发明内容Summary of the invention

本申请旨在至少在一定程度上解决相关技术中的技术问题之一。The present application aims to solve one of the technical problems in the related art at least to some extent.

为此,本申请的一个目的在于提出一种基于区块链的物联网设备位置指纹定位方法,该方法可用于提高物联网设备定位的安全性并为部分不具备定位能力的物联网设备提供定位服务。To this end, one purpose of the present application is to propose a blockchain-based IoT device location fingerprint positioning method, which can be used to improve the security of IoT device positioning and provide positioning services for some IoT devices that do not have positioning capabilities.

本申请的另一个目的在于提出一种基于区块链的物联网设备位置指纹定位系统。Another object of this application is to propose a blockchain-based IoT device location fingerprint positioning system.

为达到上述目的,本申请一方面实施例提出了一种基于区块链的物联网设备位置指纹定位方法,包括以下步骤:建立基于区块链的链上位置指纹数据库;由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将所述电磁指纹记录在所述位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在所述求解节点读取所述位置指纹数据库后,生成电磁指纹定位算法模型;接收其他节点的定位请求,根据所述定位请求利用所述电磁指纹定位算法模型在所述链上生成定位结果,并将所述定位结果返回给发送定位请求的其他节点。To achieve the above-mentioned purpose, an embodiment of the present application proposes a blockchain-based IoT device location fingerprint positioning method, comprising the following steps: establishing an on-chain location fingerprint database based on blockchain; uploading corresponding electromagnetic fingerprints by IoT devices whose actual locations have been located in the area, and recording the electromagnetic fingerprints in the location fingerprint database; training the positioning model by the solving node under the smart contract distribution chain, and generating an electromagnetic fingerprint positioning algorithm model after the solving node reads the location fingerprint database; receiving positioning requests from other nodes, generating positioning results on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning requests, and returning the positioning results to other nodes that sent the positioning requests.

为达到上述目的,本申请另一方面实施例提出了一种基于区块链的物联网设备位置指纹定位系统,包括:数据库建立模块,用于建立基于区块链的链上位置指纹数据库;模型建立模块,用于由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将所述电磁指纹记录在所述位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在所述求解节点读取所述位置指纹数据库后,生成电磁指纹定位算法模型;定位模块,用于接收其他节点的定位请求,根据所述定位请求利用所述电磁指纹定位算法模型在所述链上生成定位结果,并将所述定位结果返回给发送定位请求的其他节点。To achieve the above-mentioned purpose, on the other hand, an embodiment of the present application proposes a blockchain-based IoT device location fingerprint positioning system, including: a database establishment module, used to establish an on-chain location fingerprint database based on blockchain; a model establishment module, used to upload corresponding electromagnetic fingerprints by IoT devices whose actual positions have been located in the area, and record the electromagnetic fingerprints in the location fingerprint database, and train the positioning model by the solving node under the smart contract distribution chain, and generate an electromagnetic fingerprint positioning algorithm model after the solving node reads the location fingerprint database; a positioning module, used to receive positioning requests from other nodes, generate positioning results on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning request, and return the positioning results to other nodes that sent the positioning request.

本申请实施例的基于区块链的物联网设备位置指纹定位方法及系统,可用于提高物联网设备定位的安全性并为部分不具备定位能力的物联网设备提供定位服务,具具有以下有益效果:The blockchain-based IoT device location fingerprint positioning method and system of the embodiment of the present application can be used to improve the security of IoT device positioning and provide positioning services for some IoT devices that do not have positioning capabilities, and has the following beneficial effects:

1)引入位置指纹解决方案作为GPS的补充,为无法定位的设备提供定位服务,并验证位置的真实性,增加了位置伪造和篡改的成本;1) Introducing location fingerprint solutions as a supplement to GPS to provide positioning services for devices that cannot be located and verify the authenticity of the location, increasing the cost of location forgery and tampering;

2)利用区块链技术,通过在链上建立位置指纹数据库,加强该系统的可信度和安全性,降低离线采集指纹的复杂性;2) Using blockchain technology, by establishing a location fingerprint database on the chain, the credibility and security of the system can be enhanced, and the complexity of offline fingerprint collection can be reduced;

3)通过智能合约和链下计算的结合,可以在节省计算时间和资源消耗的同时保证定位的安全性。3) Through the combination of smart contracts and off-chain computing, it is possible to save computing time and resource consumption while ensuring the security of positioning.

本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

图1为根据本申请一个实施例的基于区块链的物联网设备位置指纹定位系统整体框架;FIG1 is an overall framework of a blockchain-based IoT device location fingerprint positioning system according to an embodiment of the present application;

图2为根据本申请一个实施例的基于区块链的物联网设备位置指纹定位方法流程图;FIG2 is a flow chart of a method for locating a location fingerprint of an IoT device based on blockchain according to an embodiment of the present application;

图3为根据本申请一个实施例的链上链下结合的定位计算方案示意图;FIG3 is a schematic diagram of a positioning calculation solution combining on-chain and off-chain according to an embodiment of the present application;

图4为根据本申请一个实施例的计算任务验证流程设计图;FIG4 is a design diagram of a computing task verification process according to an embodiment of the present application;

图5为根据本申请一个实施例的基于区块链的物联网设备位置指纹定位系统结构示意图。FIG5 is a schematic diagram of the structure of a blockchain-based IoT device location fingerprint positioning system according to an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

本申请主要为解决物联网设备缺乏定位能力以及定位篡改、伪造的问题,采用位置电磁指纹算法获取辅助定位信息作为定位信号的补充和验证,利用区块链数据不可篡改、可追溯等特点,在区块链框架下设计在线更新的分布式定位方案,具有定位能力的物联网设备在线上传自己的定位与电磁指纹,形成链上存储的电磁指纹库,供没有定位能力的设备进行电磁指纹定位以及对定位结果进行验证。This application is mainly to solve the problems of lack of positioning capability and positioning tampering and forgery of IoT devices. It adopts the position electromagnetic fingerprint algorithm to obtain auxiliary positioning information as a supplement and verification of the positioning signal. It uses the characteristics of blockchain data such as immutability and traceability to design an online updated distributed positioning solution under the blockchain framework. IoT devices with positioning capabilities upload their own positioning and electromagnetic fingerprints online to form an electromagnetic fingerprint library stored on the chain, which can be used by devices without positioning capabilities to perform electromagnetic fingerprint positioning and verify the positioning results.

考虑到未来5G的蓬勃发展,5G基站将大规模建设,可用于生成位置指纹数据库。每个移动设备从一个或多个AP接收信号,并使用移动设备的RSS作为位置指纹,由确定身份的移动设备上传到位置指纹数据库作为剩余移动设备位置证书的参考。位置指纹通常有两个阶段:离线阶段和在线阶段。在离线阶段,为了在各个地点采集指纹并建立数据库,需要在指定区域进行繁琐的调查。将指定区域划分为方格,在格点测量RSS,称为训练集。在在线阶段,移动设备的具体位置是未知的,甚至不太可能在网格点上。假设移动设备已经测量到每个AP的RSS,确定移动设备的位置就是在指纹数据库中找到与移动设备测量的RSS最匹配的指纹。一旦找到最佳匹配,移动设备的位置被估计为最佳匹配指纹的对应位置。虽然位置指纹算法可以有效解决无法定位的物联网设备的定位问题,但是位置指纹数据库的建立需要大量繁琐的采集工作。面对建立位置指纹库的问题,区块链中的节点自行上传指纹,可以快速方便地建立位置指纹库。节点上传的位置指纹存储在区块链中,可以通过位置指纹数据库和该点的RSS获取某一点的位置。Considering the booming development of 5G in the future, 5G base stations will be built on a large scale, which can be used to generate a location fingerprint database. Each mobile device receives a signal from one or more APs and uses the RSS of the mobile device as a location fingerprint, which is uploaded by the mobile device with a confirmed identity to the location fingerprint database as a reference for the location certificate of the remaining mobile devices. Location fingerprinting usually has two stages: offline and online. In the offline stage, in order to collect fingerprints at various locations and establish a database, a tedious survey is required in the designated area. The designated area is divided into grids, and the RSS is measured at the grid points, which is called a training set. In the online stage, the specific location of the mobile device is unknown, and it is even unlikely to be on the grid point. Assuming that the mobile device has measured the RSS of each AP, determining the location of the mobile device is to find the fingerprint in the fingerprint database that best matches the RSS measured by the mobile device. Once the best match is found, the location of the mobile device is estimated as the corresponding position of the best matching fingerprint. Although the location fingerprint algorithm can effectively solve the positioning problem of IoT devices that cannot be located, the establishment of a location fingerprint database requires a lot of tedious collection work. Faced with the problem of establishing a location fingerprint library, the nodes in the blockchain upload fingerprints by themselves, which can quickly and easily establish a location fingerprint library. The location fingerprint uploaded by the node is stored in the blockchain, and the location of a certain point can be obtained through the location fingerprint database and the RSS of the point.

现有区块链技术在公链、单链结构下,在容量、计算性能、可扩展性上存在瓶颈。链式本地存储的数据存储方式,难以进行业务的平行扩展;同步式状态机的共识模型,难以处理低延迟要求的计算;受限于网络中节点的性能极限,无法满足物联网场景下性能、容量以及延迟的需求。而物联网设备定位,存在着定位数据量大,节点多且计算、存储能力小,定位实时性要求高的特点。为了解决这些问题,本申请提出了适应于物联网场景的基于区块链的位置指纹定位方案。Existing blockchain technology has bottlenecks in capacity, computing performance, and scalability under public chain and single chain structures. The data storage method of chained local storage makes it difficult to expand the business in parallel; the consensus model of the synchronous state machine makes it difficult to handle calculations with low latency requirements; and it is limited by the performance limits of nodes in the network and cannot meet the performance, capacity, and latency requirements in the IoT scenario. The positioning of IoT devices has the characteristics of large amount of positioning data, many nodes, small computing and storage capabilities, and high real-time positioning requirements. In order to solve these problems, this application proposes a blockchain-based location fingerprint positioning solution suitable for IoT scenarios.

本申请提出的系统整体架构如图1所示,为了适应物联网节点数量多、单节点功率有限的情况,采用了联盟链结构。全节点由具有强大计算和存储能力的物联网节点充当,例如计算机或服务器。他们存储区块链的所有信息,参与区块链的共识,分担链下计算任务。资源受限节点充当的轻节点主要涉及位置指纹的上传和定位。此外,在定位场景中,将节点分为启用定位和不启用定位能力。具备定位功能的物联网设备上传自己的位置指纹,在链上形成在线位置指纹数据库,供不具备主动定位能力的设备进行定位。考虑到物联网位置数据量大、计算时延要求高,系统采用主子链相结合的方式。范围内的物联网节点组成子链,记录了该区域的位置指纹和定位算法模型。子链以哈希的形式记录在主链上,减少了主链的存储和计算压力,提高了定位效率。The overall architecture of the system proposed in this application is shown in Figure 1. In order to adapt to the situation where there are many IoT nodes and the power of a single node is limited, a consortium chain structure is adopted. Full nodes are IoT nodes with strong computing and storage capabilities, such as computers or servers. They store all the information of the blockchain, participate in the consensus of the blockchain, and share the off-chain computing tasks. The light nodes acted by resource-constrained nodes mainly involve the uploading and positioning of location fingerprints. In addition, in the positioning scenario, nodes are divided into nodes with and without positioning capabilities. IoT devices with positioning functions upload their own location fingerprints, forming an online location fingerprint database on the chain for devices without active positioning capabilities to locate. Considering the large amount of IoT location data and high computing latency requirements, the system adopts a combination of main and sub-chains. The IoT nodes within the range form a sub-chain, which records the location fingerprint and positioning algorithm model of the area. The sub-chain is recorded on the main chain in the form of a hash, which reduces the storage and computing pressure of the main chain and improves the positioning efficiency.

作为区块链的初始节点,所有AP的位置指纹一直保存在位置指纹数据库中,没有进行更新。移动设备经过区块链中现有节点的验证后加入区块链,并定期广播自己的位置指纹。节点收集接收到的位置指纹广播,打包生成新的区块,并在共识机制的作用下向链中添加新的区块。节点根据以下规则判断一个区块是否合法:块必须由合法节点生成;验证块中的位置指纹是正确的,即通过将RSS输入位置指纹算法得到的坐标与块中记录的坐标之间的欧式距离是可以接受的;区块中记录的哈希值必须是前一个区块的哈希值,即当前区块链中最后一个区块的哈希值。经过验证的区块将被添加到现有区块链中。记录在区块链所有区块中的位置指纹构成了位置指纹数据库,该数据库是真实的,不可篡改的。As the initial node of the blockchain, the location fingerprints of all APs have been stored in the location fingerprint database without being updated. Mobile devices join the blockchain after being verified by existing nodes in the blockchain and broadcast their location fingerprints regularly. Nodes collect the received location fingerprint broadcasts, package them to generate new blocks, and add new blocks to the chain under the action of the consensus mechanism. Nodes determine whether a block is legal according to the following rules: the block must be generated by a legal node; the location fingerprint in the verification block is correct, that is, the Euclidean distance between the coordinates obtained by inputting RSS into the location fingerprint algorithm and the coordinates recorded in the block is acceptable; the hash value recorded in the block must be the hash value of the previous block, that is, the hash value of the last block in the current blockchain. The verified block will be added to the existing blockchain. The location fingerprints recorded in all blocks of the blockchain constitute the location fingerprint database, which is authentic and cannot be tampered with.

本申请解决物联网设备缺乏定位能力以及定位篡改、伪造的问题,采用位置电磁指纹算法获取辅助定位信息作为定位信号的补充和验证,利用区块链数据不可篡改、可追溯等特点,在区块链框架下设计在线更新的分布式定位方案,具有定位能力的物联网设备在线上传自己的定位与电磁指纹,形成链上存储的电磁指纹库,供没有定位能力的设备进行电磁指纹定位以及对定位结果进行验证。This application solves the problem of lack of positioning capability and positioning tampering and forgery of IoT devices. It adopts the position electromagnetic fingerprint algorithm to obtain auxiliary positioning information as a supplement and verification of the positioning signal. It uses the characteristics of blockchain data such as immutability and traceability to design an online updated distributed positioning solution under the blockchain framework. IoT devices with positioning capabilities upload their own positioning and electromagnetic fingerprints online to form an electromagnetic fingerprint library stored on the chain, which can be used by devices without positioning capabilities to perform electromagnetic fingerprint positioning and verify the positioning results.

下面参照附图描述根据本申请实施例提出的基于区块链的物联网设备位置指纹定位方法及系统。The following describes a blockchain-based IoT device location fingerprint positioning method and system proposed according to an embodiment of the present application with reference to the accompanying drawings.

首先将参照附图描述根据本申请实施例提出的基于区块链的物联网设备位置指纹定位方法。First, the blockchain-based IoT device location fingerprint positioning method proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

图2为根据本申请一个实施例的基于区块链的物联网设备位置指纹定位方法流程图。FIG2 is a flow chart of a blockchain-based method for locating an IoT device using fingerprints according to an embodiment of the present application.

如图2所示,该基于区块链的物联网设备位置指纹定位方法包括以下步骤:As shown in FIG2 , the blockchain-based IoT device location fingerprint positioning method includes the following steps:

在步骤S101中,建立基于区块链的链上位置指纹数据库。In step S101, a blockchain-based location fingerprint database is established.

可选地,在本申请的一个实施例中,建立基于区块链的链上位置指纹数据库,包括:在每个移动设备从一个或多个AP接收信号时,使用每个移动设备的接收信号强度向量作为电磁指纹,将移动设备的电磁指纹与位置信息上传到位置指纹数据库中。Optionally, in one embodiment of the present application, a blockchain-based on-chain location fingerprint database is established, including: when each mobile device receives a signal from one or more APs, the received signal strength vector of each mobile device is used as an electromagnetic fingerprint, and the electromagnetic fingerprint and location information of the mobile device are uploaded to the location fingerprint database.

为了缓解部分物联网设备无法定位的情况,降低位置篡改和伪造的风险,引入位置指纹算法作为GPS的补充。为了增强安全性和说服力,利用区块链来模拟物联网设备的定位网络,并提出了基于区块链的位置指纹定位方案。通过将位置指纹库以及定位的计算放在链上,利用区块链的去中心化特性更好地保护数据安全和用户隐私。In order to alleviate the situation where some IoT devices cannot be located and reduce the risk of location tampering and forgery, the location fingerprint algorithm is introduced as a supplement to GPS. In order to enhance security and persuasiveness, blockchain is used to simulate the positioning network of IoT devices, and a blockchain-based location fingerprint positioning solution is proposed. By placing the location fingerprint library and positioning calculations on the chain, the decentralized characteristics of blockchain are used to better protect data security and user privacy.

首先进行电磁指纹定位,每个移动设备从一个或多个AP接收信号,并使用移动设备的RSS作为电磁指纹,由确定身份的移动设备上传到电磁指纹数据库,作为剩余移动设备位置证书的参考。First, electromagnetic fingerprint positioning is performed. Each mobile device receives signals from one or more APs and uses the RSS of the mobile device as the electromagnetic fingerprint, which is uploaded to the electromagnetic fingerprint database by the mobile device with confirmed identity as a reference for the location certificates of the remaining mobile devices.

电磁指纹由两部分组成:接收信号强度向量RSS和位置信息P。向量RSS由周围AP的节点测得的接收信号强度组成,表示为:RSS=[ρ12,…,ρn],其中ρi是来自第i个AP的平均接收信号强度。位置信息是一个带有标签P=(x,y)的二元组。The electromagnetic fingerprint consists of two parts: the received signal strength vector RSS and the location information P. The vector RSS consists of the received signal strength measured by the nodes around the AP, expressed as: RSS = [ρ 12 ,…,ρ n ], where ρ i is the average received signal strength from the i-th AP. The location information is a two-tuple with a label P = (x, y).

在步骤S102中,由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将电磁指纹记录在位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在求解节点读取位置指纹数据库后,生成电磁指纹定位算法模型。In step S102, the IoT device with the actual position located in the area uploads the corresponding electromagnetic fingerprint and records the electromagnetic fingerprint in the location fingerprint database. The positioning model is trained by the solving node under the smart contract distribution chain, and after the solving node reads the location fingerprint database, an electromagnetic fingerprint positioning algorithm model is generated.

可选地,在本申请的一个实施例中,将通过验证的电磁指纹记录在位置指纹数据库中,验证过程进一步包括:分别计算待测节点与指纹数据库中每个接收信号强度向量的距离;选择距离最近的K个电磁指纹计算标签(x,y)的数值,并将指纹的K个位置坐标的平均值得到定位结果。定位结果的计算公式为:Optionally, in one embodiment of the present application, the verified electromagnetic fingerprint is recorded in the location fingerprint database, and the verification process further includes: calculating the distance between the node to be tested and each received signal strength vector in the fingerprint database; selecting the values of the K electromagnetic fingerprint calculation labels (x, y) closest to each other, and obtaining the positioning result by averaging the K position coordinates of the fingerprint. The calculation formula of the positioning result is:

其中,(xi,yi)指接收信号强度向量欧几里得距离最近的K个点的位置。若计算的定位结果与设备上传结果误差在一定阈值内,则认为验证通过。Where (x i ,y i ) refers to the positions of the K points with the closest Euclidean distance to the received signal strength vector. If the error between the calculated positioning result and the result uploaded by the device is within a certain threshold, the verification is considered to be successful.

节点上传的电磁指纹存储在区块链中,通过电磁指纹库和某个点的RSS,可以得到这个点的位置信息。电磁指纹方法可以看作是分类或回归问题(特征是RSS向量,标签是位置)。有监督的机器学习方法可以训练一个从数据到特征到标签的映射模型。本申请采用K-近邻(KNN)分类算法确定节点位置,即选择距离当前RSS最近的K个指纹位置来估计当前位置。The electromagnetic fingerprint uploaded by the node is stored in the blockchain. Through the electromagnetic fingerprint library and the RSS of a certain point, the location information of this point can be obtained. The electromagnetic fingerprint method can be regarded as a classification or regression problem (the feature is the RSS vector and the label is the position). Supervised machine learning methods can train a mapping model from data to features to labels. This application uses the K-nearest neighbor (KNN) classification algorithm to determine the node position, that is, select the K fingerprint positions closest to the current RSS to estimate the current position.

为了测量实时RSS采样值与位置数据库中的采样值之间的距离,假设采样点和AP的数量分别为m,n,采用欧几里得距离作为衡量两个RSS采样之间的距离:In order to measure the distance between the real-time RSS sampling value and the sampling value in the location database, assuming that the number of sampling points and APs are m and n respectively, the Euclidean distance is used as the distance between two RSS samples:

其中,ρij指电磁指纹数据库中第j个AP的i参考点的RSS采样值,ρj指的是实时来自第j个AP的RSS采样值。Among them, ρ ij refers to the RSS sampling value of the i reference point of the j-th AP in the electromagnetic fingerprint database, and ρ j refers to the RSS sampling value from the j-th AP in real time.

分别计算待测节点与指纹库中每个RSS向量的距离,选择最近的K电磁指纹进行标签(x,y)的数值计算。指纹的K位置坐标的平均值用作定位结果。The distance between the node to be tested and each RSS vector in the fingerprint library is calculated respectively, and the nearest K electromagnetic fingerprints are selected for the numerical calculation of the label (x, y). The average value of the K position coordinates of the fingerprint is used as the positioning result.

其中,(xi,yi)指RSS欧几里得距离最近的K个点的位置,参数K的最优值通过10折交叉验证来估计,交叉验证的流程如下:Where ( xi , yi ) refers to the positions of the K points with the closest RSS Euclidean distance. The optimal value of parameter K is estimated by 10-fold cross validation. The cross validation process is as follows:

(1)将数据集分成十份,轮流将其中9份作为训练数据,1份作为测试数据,进行试验。每次试验都会得出相应的正确率(或差错率)。(1) Divide the data set into ten parts, and use nine of them as training data and one as test data in turn for experiments. Each experiment will yield a corresponding accuracy rate (or error rate).

(2)10次的结果的正确率(或差错率)的平均值作为对算法精度的估计。(2) The average of the correctness (or error rate) of the 10 results is used as an estimate of the accuracy of the algorithm.

(3)重复(1)和(2)步骤,再求其均值,作为对算法准确性的估计。(3) Repeat steps (1) and (2) and calculate the mean as an estimate of the accuracy of the algorithm.

电磁指纹定位算法具体如下:The electromagnetic fingerprint positioning algorithm is as follows:

在步骤S103中,接收其他节点的定位请求,根据定位请求利用电磁指纹定位算法模型在链上生成定位结果,并将定位结果返回给发送定位请求的其他节点。In step S103, the positioning request of other nodes is received, the positioning result is generated on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning request, and the positioning result is returned to the other node that sent the positioning request.

利用智能合约执行定位算法主要面临着资源消耗大、耗时长的难题,由于智能合约的运算结果要经过节点的共识才能记录在链上,产生了很多的冗余计算。为了提高计算效率,将电磁指纹定位算法中的训练过程放在链下进行,定位的计算放在链上,保证了定位计算的安全性的同时减少了资源的消耗。The main problem of using smart contracts to execute positioning algorithms is that they consume a lot of resources and take a long time. Since the calculation results of smart contracts must be recorded on the chain after the consensus of the nodes, a lot of redundant calculations are generated. In order to improve the calculation efficiency, the training process in the electromagnetic fingerprint positioning algorithm is placed off-chain, and the positioning calculation is placed on-chain, which ensures the security of the positioning calculation while reducing resource consumption.

链上链下结合的定位方案的整体流程如图3所示,可以分为电磁指纹库的建立、链下定位模型训练以及电磁指纹定位三个阶段。首先由区域内的具有定位能力的物联网设备上传自己的电磁指纹,经过真实性验证的电磁指纹记录在链上电磁指纹库中;由智能合约分配链下的求解节点进行定位算法模型的训练,求解节点读取链上的电磁指纹库后,在本地完成定位算法的训练,并将签名后的训练模型上传。区块链对训练模型进行签名验证以及模型验证后,将更新的电磁指纹定位模型记录在链上;有定位需求的节点向智能合约发起定位请求,链上执行定位算法并将定位结果返回给定位请求节点。The overall process of the on-chain and off-chain positioning solution is shown in Figure 3, which can be divided into three stages: the establishment of the electromagnetic fingerprint library, the off-chain positioning model training, and the electromagnetic fingerprint positioning. First, the IoT devices with positioning capabilities in the area upload their own electromagnetic fingerprints, and the electromagnetic fingerprints that have been verified for authenticity are recorded in the on-chain electromagnetic fingerprint library; the smart contract assigns the off-chain solving node to train the positioning algorithm model. After the solving node reads the on-chain electromagnetic fingerprint library, it completes the training of the positioning algorithm locally and uploads the signed training model. After the blockchain verifies the signature and model of the training model, it records the updated electromagnetic fingerprint positioning model on the chain; the node with positioning requirements initiates a positioning request to the smart contract, and the positioning algorithm is executed on the chain and the positioning result is returned to the positioning request node.

系统设置LCoin作为参与链上计算的奖励,LCoin可用于在系统中发起定位请求。由区块链的可追溯、不可篡改的特点,保证了链上存储的电磁指纹的可信,且节点在上传电磁指纹时,都要经过验证误差在3m以内,才能成功上链;否则,上传虚假电磁指纹的节点将受到罚款的处罚。The system sets LCoin as a reward for participating in on-chain calculations, and LCoin can be used to initiate positioning requests in the system. The traceability and non-tamperability of blockchain ensure the credibility of electromagnetic fingerprints stored on the chain, and when nodes upload electromagnetic fingerprints, they must verify that the error is within 3m before they can be successfully uploaded to the chain; otherwise, nodes that upload false electromagnetic fingerprints will be fined.

为了防止单个节点短时间内在同一地点恶意大量上传电磁指纹,造成系统定位的偏移,设置每个用户的上传间隔,要求每个人用户十分钟内不能超过5次上传电磁指纹。同时,为了防止节点伪造大量身份上传大量伪造的电磁指纹,节点每次上传电磁指纹时需要上缴一部分的保证金,如果上传了伪造的电磁指纹,即没有通过验证,则保证金会被收回;如果上传的电磁指纹经过了验证,则保证金被归还给节点。In order to prevent a single node from maliciously uploading a large number of electromagnetic fingerprints at the same location in a short period of time, causing the system positioning to shift, the upload interval for each user is set, requiring each user to upload electromagnetic fingerprints no more than 5 times within ten minutes. At the same time, in order to prevent nodes from forging a large number of identities and uploading a large number of forged electromagnetic fingerprints, each time the node uploads an electromagnetic fingerprint, it needs to pay a part of the deposit. If a forged electromagnetic fingerprint is uploaded, that is, it fails to pass the verification, the deposit will be withdrawn; if the uploaded electromagnetic fingerprint is verified, the deposit will be returned to the node.

可选地,在本申请的一个实施例中,在生成电磁指纹定位算法模型之后,还包括:将前一个区块的哈希值作为随机数生成计算节点,并在链上公布,使得节点通过访问智能合约获取计算节点的序列号;被选中的计算节点将ID和时间戳发送至智能合约,以确定其参与链下计算;如果被选中的计算节点在预设时间内没有响应,则视为放弃计算权,且智能合约将等待获取前一个区块的哈希作为随机数,并选择新的解决方案节点,其中,智能合约分配计算节点后,联盟链上的所有节点均投票至验证节点,及验证通过后,将解决方案节点、验证签名和电磁指纹定位算法模型记录在区块链上。Optionally, in one embodiment of the present application, after generating the electromagnetic fingerprint positioning algorithm model, it also includes: using the hash value of the previous block as a random number to generate a computing node, and publishing it on the chain, so that the node obtains the serial number of the computing node by accessing the smart contract; the selected computing node sends the ID and timestamp to the smart contract to determine its participation in off-chain calculations; if the selected computing node does not respond within a preset time, it is deemed to have waived the computing right, and the smart contract will wait to obtain the hash of the previous block as a random number and select a new solution node, wherein after the smart contract assigns the computing node, all nodes on the alliance chain vote to the verification node, and after the verification is passed, the solution node, verification signature and electromagnetic fingerprint positioning algorithm model are recorded on the blockchain.

具体地,链下计算任务的分配和验证是在智能合约上实现的。为了保证计算节点选择的随机性,将前一个区块的哈希值作为随机数生成计算节点,并在链上公布。节点通过访问智能合约获取计算节点的序列号。被选中的节点将ID和时间戳发送给智能合约,以确定其参与链下计算。如果被选中的节点在一定的等待时间内没有响应,则视为放弃计算权,智能合约将等待获取前一个区块的哈希作为随机数并选择新的解决方案节点。为保证链下计算结果的可信度,智能合约分配计算节点后,联盟链上的所有全节点都会投票给验证节点。验证节点对解节点的计算结果进行验证,将验证结果返回给智能合约。智能合约收集验证结果,如果超过一定比例的节点一致,则认为验证通过。如果验证失败,执行此计算的解决方案节点将面临罚款以及一段时间内失去参与链下计算资格的处罚,而验证节点将获得奖励。然后智能合约将重新分配解决方案节点进行计算。如果验证通过,解决方案节点、验证签名和指纹定位模型将一起记录在区块链上。Specifically, the allocation and verification of off-chain computing tasks are implemented on smart contracts. In order to ensure the randomness of the selection of computing nodes, the hash value of the previous block is used as a random number to generate computing nodes and is announced on the chain. The node obtains the serial number of the computing node by accessing the smart contract. The selected node sends the ID and timestamp to the smart contract to determine its participation in off-chain computing. If the selected node does not respond within a certain waiting time, it is deemed to have given up the computing right, and the smart contract will wait to obtain the hash of the previous block as a random number and select a new solution node. To ensure the credibility of the off-chain computing results, after the smart contract assigns the computing node, all full nodes on the alliance chain will vote for the verification node. The verification node verifies the calculation results of the solution node and returns the verification results to the smart contract. The smart contract collects the verification results, and if more than a certain proportion of nodes are consistent, the verification is considered to be passed. If the verification fails, the solution node that performs this calculation will face a fine and a penalty of losing the qualification to participate in off-chain computing for a period of time, while the verification node will receive a reward. The smart contract will then reallocate the solution node for calculation. If the verification passes, the solution node, verification signature, and fingerprint positioning model will be recorded together on the blockchain.

程序的具体流程如图4所示,主要包括以下几个步骤:The specific process of the program is shown in Figure 4, which mainly includes the following steps:

步骤1:随机生成计算节点编号,并发布在合约上。Step 1: Randomly generate a computing node number and publish it on the contract.

numbercom=hashpremod numcandidate number com =hash pre mod num candidate

其中,numbercom为计算节编号,hashpre为前一个区块的hash,numcandidate为候选节点数。Among them, number com is the calculation node number, hash pre is the hash of the previous block, and num candidate is the number of candidate nodes.

步骤2:计算节点从合约中获取发布的结果,将其ID和签名发送到智能合约并在本地进行计算。如果求解节点在一定的Timelimit内没有回复,则视为自动放弃计算权。此时,计算节点不会被罚款。Step 2: The computing node obtains the published result from the contract, sends its ID and signature to the smart contract and performs the calculation locally. If the solving node does not respond within a certain time limit , it is deemed to have automatically waived the computing right. At this time, the computing node will not be fined.

步骤3:解决方案节点将结果的哈希和签名返回给智能合约。智能合约验证签名后,计算结果的哈希值存储在链上。如果计算节点在这一步超时,也视为自动放弃计算,同时该节点将被罚款。Step 3: The solution node returns the hash and signature of the result to the smart contract. After the smart contract verifies the signature, the hash value of the calculation result is stored on the chain. If the calculation node times out at this step, it is also considered to have automatically abandoned the calculation, and the node will be fined.

步骤4:智能合约组织节点投票给验证节点,并发布验证节点。验证节点获取在合约上发布的结果,将其ID发送到智能合约并在本地进行计算。如果验证节点在一定的Timelimit内没有回复,则视为自动放弃验证权。Step 4: The smart contract organizes nodes to vote for the verification node and publishes the verification node. The verification node obtains the results published on the contract, sends its ID to the smart contract and performs calculations locally. If the verification node does not respond within a certain time limit , it is deemed to have automatically waived the verification right.

步骤5:验证节点将结果的哈希和签名返回给智能合约。智能合约根据节点返回的结果和阈值Passpercentage判断验证是否通过。如果验证通过,计算节点将结果本身重新上传到智能合约。Step 5: The verification node returns the hash and signature of the result to the smart contract. The smart contract determines whether the verification is passed based on the result returned by the node and the threshold Pass percentage . If the verification is passed, the computing node re-uploads the result itself to the smart contract.

步骤6:智能合约在检查后记录结果。最后,计算节点和验证节点获得奖励。Step 6: The smart contract records the result after checking. Finally, the computing nodes and verification nodes receive rewards.

根据本申请实施例提出的基于区块链的物联网设备位置指纹定位方法,通过位置指纹作为GPS的补充,为无法定位的设备提供位置,并增加了针对位置攻击的成本。此外,该系统利用区块链对物联网设备的定位环境进行建模。链上位置指纹库保护指纹安全,提供在线更新和数据共享的渠道。通过结合智能合约和链下计算,在区块链上部署指纹定位算法,通过分布式计算保证定位的可信度。According to the blockchain-based IoT device location fingerprint positioning method proposed in the embodiment of the present application, the location fingerprint is used as a supplement to GPS to provide the location of devices that cannot be located, and the cost of location attacks is increased. In addition, the system uses blockchain to model the positioning environment of IoT devices. The on-chain location fingerprint library protects fingerprint security and provides channels for online updates and data sharing. By combining smart contracts and off-chain computing, the fingerprint positioning algorithm is deployed on the blockchain, and the credibility of positioning is guaranteed through distributed computing.

其次参照附图描述根据本申请实施例提出的基于区块链的物联网设备位置指纹定位系统。Next, the blockchain-based IoT device location fingerprint positioning system proposed in accordance with an embodiment of the present application is described with reference to the accompanying drawings.

图5为根据本申请一个实施例的基于区块链的物联网设备位置指纹定位系统结构示意图。FIG5 is a schematic diagram of the structure of a blockchain-based IoT device location fingerprint positioning system according to an embodiment of the present application.

如图5所示,该基于区块链的物联网设备位置指纹定位系统包括:数据库建立模块100、模型建立模块200和定位模块300。As shown in FIG. 5 , the blockchain-based IoT device location fingerprint positioning system includes: a database establishment module 100 , a model establishment module 200 and a positioning module 300 .

其中,数据库建立模块100,用于建立基于区块链的链上位置指纹数据库。模型建立模块200,用于由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将电磁指纹记录在位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在求解节点读取位置指纹数据库后,生成电磁指纹定位算法模型。定位模块300,用于接收其他节点的定位请求,根据定位请求利用电磁指纹定位算法模型在链上生成定位结果,并将定位结果返回给发送定位请求的其他节点。Among them, the database establishment module 100 is used to establish an on-chain location fingerprint database based on blockchain. The model establishment module 200 is used for the Internet of Things devices that have located their actual locations in the area to upload the corresponding electromagnetic fingerprints, and record the electromagnetic fingerprints in the location fingerprint database. The smart contract allocates the solution node under the chain to train the positioning model, and after the solution node reads the location fingerprint database, it generates an electromagnetic fingerprint positioning algorithm model. The positioning module 300 is used to receive positioning requests from other nodes, generate positioning results on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning request, and return the positioning results to other nodes that sent the positioning request.

可选地,在本申请的一个实施例中,建立基于区块链的链上位置指纹数据库,包括:在每个移动设备从一个或多个AP接收信号时,使用每个移动设备的接收信号强度向量作为电磁指纹,将移动设备的电磁指纹与位置信息上传到位置指纹数据库中。Optionally, in one embodiment of the present application, a blockchain-based on-chain location fingerprint database is established, including: when each mobile device receives a signal from one or more APs, the received signal strength vector of each mobile device is used as an electromagnetic fingerprint, and the electromagnetic fingerprint and location information of the mobile device are uploaded to the location fingerprint database.

可选地,在本申请的一个实施例中,将电磁指纹记录在位置指纹数据库中,进一步包括:分别计算待测节点与指纹数据库中每个接收信号强度向量的距离;选择距离最近的K个电磁指纹计算标签(x,y)的数值,并将指纹的K个位置坐标的平均值得到定位结果。Optionally, in one embodiment of the present application, the electromagnetic fingerprint is recorded in a location fingerprint database, further comprising: respectively calculating the distance between the node to be measured and each received signal strength vector in the fingerprint database; selecting the values of the K electromagnetic fingerprint calculation labels (x, y) closest to each other, and obtaining the positioning result by taking the average value of the K position coordinates of the fingerprint.

可选地,在本申请的一个实施例中,定位结果的计算公式为:Optionally, in one embodiment of the present application, the calculation formula of the positioning result is:

其中,(xi,yi)指接收信号强度向量欧几里得距离最近的K个点的位置。Wherein, (x i , y i ) refers to the positions of the K points with the closest Euclidean distance to the received signal strength vector.

需要说明的是,前述对基于区块链的物联网设备位置指纹定位方法实施例的解释说明也适用于该实施例的基于区块链的物联网设备位置指纹定位系统,此处不再赘述。It should be noted that the aforementioned explanation of the embodiment of the blockchain-based IoT device location fingerprint positioning method is also applicable to the blockchain-based IoT device location fingerprint positioning system of this embodiment, and will not be repeated here.

根据本申请实施例提出的基于区块链的物联网设备位置指纹定位系统,通过位置指纹作为GPS的补充,为无法定位的设备提供位置,并增加了针对位置攻击的成本。此外,该系统利用区块链对物联网设备的定位环境进行建模。链上位置指纹库保护指纹安全,提供在线更新和数据共享的渠道。通过结合智能合约和链下计算,在区块链上部署指纹定位算法,通过分布式计算保证定位的可信度。According to the blockchain-based IoT device location fingerprint positioning system proposed in the embodiment of the present application, the location fingerprint is used as a supplement to GPS to provide the location of devices that cannot be located, and the cost of location attacks is increased. In addition, the system uses blockchain to model the positioning environment of IoT devices. The on-chain location fingerprint library protects fingerprint security and provides channels for online updates and data sharing. By combining smart contracts and off-chain computing, the fingerprint positioning algorithm is deployed on the blockchain, and the credibility of positioning is guaranteed through distributed computing.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in the field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims (4)

1.一种基于区块链的物联网设备位置指纹定位方法,其特征在于,包括以下步骤:1. A blockchain-based method for locating the location fingerprint of an IoT device, comprising the following steps: 建立基于区块链的链上位置指纹数据库,具体包括:Establish a blockchain-based on-chain location fingerprint database, including: 在每个移动设备从一个或多个AP接收信号时,使用所述每个移动设备的接收信号强度向量作为电磁指纹,将移动设备的电磁指纹与位置信息上传到所述位置指纹数据库中;When each mobile device receives a signal from one or more APs, the received signal strength vector of each mobile device is used as an electromagnetic fingerprint, and the electromagnetic fingerprint and location information of the mobile device are uploaded to the location fingerprint database; 由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将所述电磁指纹记录在所述位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在所述求解节点读取所述位置指纹数据库后,生成电磁指纹定位算法模型;The IoT device with the actual location in the area uploads the corresponding electromagnetic fingerprint, and records the electromagnetic fingerprint in the location fingerprint database. The solution node under the smart contract distribution chain trains the positioning model, and after the solution node reads the location fingerprint database, an electromagnetic fingerprint positioning algorithm model is generated; 将前一个区块的哈希值作为随机数生成计算节点,并在链上公布,使得节点通过访问智能合约获取计算节点的序列号;被选中的计算节点将ID和时间戳发送至所述智能合约,以确定其参与链下计算;如果所述被选中的计算节点在预设时间内没有响应,则视为放弃计算权,且所述智能合约将等待获取前一个区块的哈希作为随机数,并选择新的解决方案节点,其中,所述智能合约分配所述计算节点后,联盟链上的所有节点均投票至验证节点,及验证通过后,将解决方案节点、验证签名和电磁指纹定位算法模型记录在区块链上;以及The hash value of the previous block is used as a random number to generate a computing node, and is announced on the chain, so that the node obtains the serial number of the computing node by accessing the smart contract; the selected computing node sends the ID and timestamp to the smart contract to determine its participation in the off-chain computing; if the selected computing node does not respond within a preset time, it is deemed to have given up the computing right, and the smart contract will wait to obtain the hash of the previous block as a random number and select a new solution node, wherein after the smart contract assigns the computing node, all nodes on the alliance chain vote to the verification node, and after the verification is passed, the solution node, verification signature and electromagnetic fingerprint positioning algorithm model are recorded on the blockchain; and 接收其他节点的定位请求,根据所述定位请求利用所述电磁指纹定位算法模型在所述链上生成定位结果,并将所述定位结果返回给发送定位请求的其他节点。Receive positioning requests from other nodes, generate positioning results on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning requests, and return the positioning results to other nodes that sent the positioning requests. 2.一种基于区块链的物联网设备位置指纹定位系统,其特征在于,包括:2. A blockchain-based IoT device location fingerprint positioning system, characterized by comprising: 数据库建立模块,用于建立基于区块链的链上位置指纹数据库,具体包括:The database establishment module is used to establish an on-chain location fingerprint database based on blockchain, specifically including: 在每个移动设备从一个或多个AP接收信号时,使用所述每个移动设备的接收信号强度向量作为电磁指纹,将移动设备的电磁指纹与位置信息上传到所述位置指纹数据库中;When each mobile device receives a signal from one or more APs, the received signal strength vector of each mobile device is used as an electromagnetic fingerprint, and the electromagnetic fingerprint and location information of the mobile device are uploaded to the location fingerprint database; 模型建立模块,用于由区域内的已定位实际位置的物联网设备上传对应的电磁指纹,并将所述电磁指纹记录在所述位置指纹数据库中,由智能合约分配链下的求解节点训练定位模型,并在所述求解节点读取所述位置指纹数据库后,生成电磁指纹定位算法模型;A model building module is used for uploading corresponding electromagnetic fingerprints by IoT devices whose actual positions have been located in the area, and recording the electromagnetic fingerprints in the location fingerprint database. The location model is trained by the solution node under the smart contract distribution chain, and after the solution node reads the location fingerprint database, an electromagnetic fingerprint positioning algorithm model is generated; 记录模块,用于在生成所述电磁指纹定位算法模型之后,将前一个区块的哈希值作为随机数生成计算节点,并在链上公布,使得节点通过访问智能合约获取计算节点的序列号;被选中的计算节点将ID和时间戳发送至所述智能合约,以确定其参与链下计算;如果所述被选中的计算节点在预设时间内没有响应,则视为放弃计算权,且所述智能合约将等待获取前一个区块的哈希作为随机数,并选择新的解决方案节点,其中,所述智能合约分配所述计算节点后,联盟链上的所有节点均投票至验证节点,及验证通过后,将解决方案节点、验证签名和电磁指纹定位算法模型记录在区块链上;A recording module is used to generate a computing node using the hash value of the previous block as a random number after generating the electromagnetic fingerprint positioning algorithm model, and publish it on the chain so that the node obtains the serial number of the computing node by accessing the smart contract; the selected computing node sends the ID and timestamp to the smart contract to determine its participation in the off-chain calculation; if the selected computing node does not respond within a preset time, it is deemed to have waived the computing right, and the smart contract will wait to obtain the hash of the previous block as a random number and select a new solution node, wherein after the smart contract assigns the computing node, all nodes on the alliance chain vote to the verification node, and after the verification is passed, the solution node, verification signature and electromagnetic fingerprint positioning algorithm model are recorded on the blockchain; 定位模块,用于接收其他节点的定位请求,根据所述定位请求利用所述电磁指纹定位算法模型在所述链上生成定位结果,并将所述定位结果返回给发送定位请求的其他节点。The positioning module is used to receive positioning requests from other nodes, generate positioning results on the chain using the electromagnetic fingerprint positioning algorithm model according to the positioning requests, and return the positioning results to other nodes that sent the positioning requests. 3.根据权利要求2所述的系统,其特征在于,所述将所述电磁指纹记录在所述位置指纹数据库中,进一步包括:分别计算待测节点与所述指纹数据库中每个接收信号强度向量的距离;选择距离最近的K个电磁指纹计算标签(x,y)的数值,并将指纹的K个位置坐标的平均值得到定位结果。3. The system according to claim 2 is characterized in that recording the electromagnetic fingerprint in the location fingerprint database further includes: calculating the distance between the node to be tested and each received signal strength vector in the fingerprint database respectively; selecting the values of the K electromagnetic fingerprint calculation labels (x, y) closest to each other, and obtaining the positioning result by taking the average value of the K position coordinates of the fingerprint. 4.根据权利要求3所述的系统,其特征在于,所述定位结果的计算公式为:4. The system according to claim 3, characterized in that the calculation formula of the positioning result is: 其中,(xi,yi)指接收信号强度向量欧几里得距离最近的K个点的位置。Wherein, (x i , y i ) refers to the positions of the K points with the closest Euclidean distance to the received signal strength vector.
CN202110957559.3A 2021-08-18 2021-08-18 Block chain-based fingerprint positioning method and system for position of Internet of things equipment Active CN113825139B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110957559.3A CN113825139B (en) 2021-08-18 2021-08-18 Block chain-based fingerprint positioning method and system for position of Internet of things equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110957559.3A CN113825139B (en) 2021-08-18 2021-08-18 Block chain-based fingerprint positioning method and system for position of Internet of things equipment

Publications (2)

Publication Number Publication Date
CN113825139A CN113825139A (en) 2021-12-21
CN113825139B true CN113825139B (en) 2024-09-20

Family

ID=78922785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110957559.3A Active CN113825139B (en) 2021-08-18 2021-08-18 Block chain-based fingerprint positioning method and system for position of Internet of things equipment

Country Status (1)

Country Link
CN (1) CN113825139B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116193574B (en) * 2023-02-22 2023-10-13 中电建建筑集团有限公司 5g network-based observation information fusion positioning key technical method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108717175A (en) * 2018-04-18 2018-10-30 同济大学 Indoor fingerprint positioning method based on region division and sparse support vector regression
CN111125784A (en) * 2019-12-24 2020-05-08 山东爱城市网信息技术有限公司 Artificial intelligence training model method, device and medium based on block chain
CN111988844A (en) * 2020-08-31 2020-11-24 广东技术师范大学 An indoor room-level localization method based on blockchain and mobile crowd-sensing

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9801058B2 (en) * 2014-04-29 2017-10-24 Tarik Tali Method and system for authenticating an individual's geo-location via a communication network and applications using the same
EP3227708A1 (en) * 2014-12-04 2017-10-11 HERE Global B.V. Supporting a collaborative collection of data
US11138827B2 (en) * 2016-09-15 2021-10-05 Simpsx Technologies Llc Implementations of a computerized business transaction exchange for various users
US10439820B2 (en) * 2017-06-19 2019-10-08 Dell Products, Lp Method and apparatus for secure access to a mobile edge computing gateway device based on a subscriber location fingerprint
CN108648071B (en) * 2018-05-17 2020-05-19 阿里巴巴集团控股有限公司 Resource value evaluation method and device based on block chain
KR101979586B1 (en) * 2018-12-19 2019-05-17 주식회사 마크애니 IoT DEVICE MANAGED BASED ON BLOCK CHAIN, SYSTEM AND METHOD THEREOF
CN111191283B (en) * 2019-12-27 2023-02-07 广西大学 Beidou positioning information security encryption method and device based on alliance block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108717175A (en) * 2018-04-18 2018-10-30 同济大学 Indoor fingerprint positioning method based on region division and sparse support vector regression
CN111125784A (en) * 2019-12-24 2020-05-08 山东爱城市网信息技术有限公司 Artificial intelligence training model method, device and medium based on block chain
CN111988844A (en) * 2020-08-31 2020-11-24 广东技术师范大学 An indoor room-level localization method based on blockchain and mobile crowd-sensing

Also Published As

Publication number Publication date
CN113825139A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
Shi et al. DRL-based V2V computation offloading for blockchain-enabled vehicular networks
Zhang et al. Recent advances in blockchain and artificial intelligence integration: Feasibility analysis, research issues, applications, challenges, and future work
Xu et al. A blockchain-powered crowdsourcing method with privacy preservation in mobile environment
Wang et al. A fast and secured vehicle-to-vehicle energy trading based on blockchain consensus in the internet of electric vehicles
He et al. Bift: A blockchain-based federated learning system for connected and autonomous vehicles
CN111770073A (en) A fog network offloading decision-making and resource allocation method based on blockchain technology
Xu et al. A scalable two-layer blockchain system for distributed multicloud storage in IIoT
Zhang et al. AI-based security design of mobile crowdsensing systems: Review, challenges and case studies
CN114418109A (en) Node selection and aggregation optimization system and method for federal learning under micro-service architecture
Asheralieva et al. Throughput-efficient lagrange coded private blockchain for secured IoT systems
Qiu et al. Rendering secure and trustworthy edge intelligence in 5G-enabled IIoT using proof of learning consensus protocol
Noshad et al. Analyzing and securing data using data science and blockchain in smart networks
Feng et al. Securing traffic-related messages exchange against inside-and-outside collusive attack in vehicular networks
Xie et al. HLOChain: A hierarchical blockchain framework with lightweight consensus and optimized storage for IoT
Chen et al. Efficient and secure blockchain consensus algorithm for heterogeneous industrial Internet of Things nodes based on double-DAG
Xian et al. A distributed efficient blockchain oracle scheme for internet of things
CN113825139B (en) Block chain-based fingerprint positioning method and system for position of Internet of things equipment
Liu et al. Communitychain: Toward a scalable blockchain in smart home
Dai et al. Permissioned blockchain and deep reinforcement learning for content caching in vehicular edge computing and networks
Bai et al. Blockchain-based Authentication and Proof-of-Reputation Mechanism for Trust Data Sharing in Internet of Vehicles.
CN114363089B (en) Block chain-based network edge terminal data sharing method and model
Batool et al. Block-racs: Towards reputation-aware client selection and monetization mechanism for federated learning
Guo et al. Calculation and selection scheme of node reputation values for notary mechanism in cross-chain.
Diallo et al. An improved PBFT-based consensus for securing traffic messages in VANETs
Diallo et al. Toward scalable blockchain for data management in VANETs

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