[go: up one dir, main page]

CN114491302B - Blockchain-based positioning and trajectory detection method, electronic student ID card and medium - Google Patents

Blockchain-based positioning and trajectory detection method, electronic student ID card and medium Download PDF

Info

Publication number
CN114491302B
CN114491302B CN202111649273.5A CN202111649273A CN114491302B CN 114491302 B CN114491302 B CN 114491302B CN 202111649273 A CN202111649273 A CN 202111649273A CN 114491302 B CN114491302 B CN 114491302B
Authority
CN
China
Prior art keywords
information
positioning information
block chain
blockchain
positioning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN202111649273.5A
Other languages
Chinese (zh)
Other versions
CN114491302A (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.)
Sichuan Lingge Zhigu Technology Co ltd
Original Assignee
Sichuan Lingge Zhigu Technology 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 Sichuan Lingge Zhigu Technology Co ltd filed Critical Sichuan Lingge Zhigu Technology Co ltd
Priority to CN202111649273.5A priority Critical patent/CN114491302B/en
Publication of CN114491302A publication Critical patent/CN114491302A/en
Application granted granted Critical
Publication of CN114491302B publication Critical patent/CN114491302B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

本发明公开了一种基于区块链的定位及轨迹检测方法、电子学生证及介质,方法包括:每隔第一预设时间间隔获取第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;根据第一定位信息以及第二定位信息,检测第一区块链节点的移动范围是否偏离基准范围;在第一区块链节点的移动范围偏离基准范围时,基于第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向第一区块链节点关联的报警终端发送目标移动轨迹信息;其中,第一区块链节点为第一电子学生证,第二区块链节点为第一电子学生证关联的第二电子学生证。本发明旨在提高电子学生证定位及轨迹检测的灵活性,并且避免或者减轻数据的安全隐患。

Figure 202111649273

The invention discloses a block chain-based positioning and trajectory detection method, an electronic student ID card and a medium. The method includes: acquiring the first positioning information of the first block chain node and the second area at intervals of a first preset time interval. The second positioning information of the block chain node; according to the first positioning information and the second positioning information, detect whether the movement range of the first block chain node deviates from the reference range; when the movement range of the first block chain node deviates from the reference range, Based on the historical positioning information of the first blockchain node, determine the target movement trajectory information, and send the target movement trajectory information to the alarm terminal associated with the first blockchain node; wherein, the first blockchain node is the first electronic student ID , the second blockchain node is the second electronic student ID associated with the first electronic student ID. The invention aims at improving the flexibility of positioning and track detection of the electronic student ID card, and avoiding or alleviating potential safety hazards of data.

Figure 202111649273

Description

基于区块链的定位及轨迹检测方法、电子学生证及介质Blockchain-based positioning and trajectory detection method, electronic student ID card and medium

技术领域technical field

本发明涉及电子学生证技术领域,尤其涉及一种基于区块链的定位及轨迹检测方法、电子学生证及介质。The invention relates to the technical field of electronic student ID cards, in particular to a blockchain-based positioning and trajectory detection method, electronic student ID cards and media.

背景技术Background technique

在中小学及幼儿园的场景中,为了避免学生使用智能手机同时便于学生能够与家长进行通信交流,市场上出现了电子学生证这一专有设备。电子学生证往往具有进行定位以防止学生丢失的功能。相关技术中,仅仅能够提前设定学校区域作为安全区域,并检测学生是否位于提前设定的安全区域中。In the scenes of primary and secondary schools and kindergartens, in order to prevent students from using smartphones and facilitate students to communicate with their parents, a proprietary device called an electronic student ID card has appeared on the market. Electronic student ID cards often have the function of positioning to prevent students from being lost. In related technologies, it is only possible to set a school area as a safety area in advance and detect whether a student is located in the safety area set in advance.

在此情况下,若出现师生携学生集体外出等情况,学生将脱离安全区域。但是此时由于学生实际上并未丢失,从而会导致误报。并且,若相关数据存储服务器被网络攻击,则安全区域信息可能被篡改引起数据安全隐患。因此,上述方式进行定位及轨迹检测的方式不灵活,并且可能存在数据安全隐患。In this case, if teachers and students go out together with students, students will leave the safe area. But at this time, since the student is not actually lost, it will lead to false positives. Moreover, if the relevant data storage server is attacked by the network, the security area information may be tampered with, causing data security risks. Therefore, the above method for positioning and trajectory detection is inflexible, and there may be hidden dangers in data security.

发明内容Contents of the invention

本发明的主要目的在于提供一种基于区块链的定位及轨迹检测方法、电子学生证及介质,旨在解决定位及轨迹检测的方式不灵活,并且可能存在数据安全隐患的技术问题。The main purpose of the present invention is to provide a blockchain-based positioning and trajectory detection method, electronic student ID card and media, aiming to solve the technical problems of inflexible positioning and trajectory detection methods and potential data security risks.

为实现上述目的,本发明提供一种基于区块链的定位及轨迹检测方法,所述方法应用于第一区块链节点,所述方法包括:In order to achieve the above object, the present invention provides a block chain-based positioning and trajectory detection method, the method is applied to the first block chain node, and the method includes:

每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;Obtain the first location information of the first blockchain node and the second location information of the second blockchain node every first preset time interval;

根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围;Detecting whether the movement range of the first blockchain node deviates from a reference range according to the first positioning information and the second positioning information;

在所述第一区块链节点的移动范围偏离所述基准范围时,基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向所述第一区块链节点关联的报警终端发送所述目标移动轨迹信息;When the movement range of the first block chain node deviates from the reference range, based on the historical positioning information of the first block chain node, determine the target movement track information, and associate it with the first block chain node The alarm terminal sends the target movement track information;

其中,所述第一区块链节点为第一电子学生证,所述第二区块链节点为所述第一电子学生证关联的第二电子学生证。Wherein, the first block chain node is a first electronic student ID card, and the second block chain node is a second electronic student ID card associated with the first electronic student ID card.

可选地,所述根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围的步骤包括:Optionally, the step of detecting whether the movement range of the first blockchain node deviates from a reference range according to the first positioning information and the second positioning information includes:

分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间;extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes;

基于每个所述第二区块链节点的所述第二卫星定位信息以及所述检测时间,分别确定每个所述第二区块链节点的第二移动轨迹;Based on the second satellite positioning information of each of the second blockchain nodes and the detection time, respectively determine the second movement trajectory of each of the second blockchain nodes;

基于所有所述第二区块链节点的所述第二移动轨迹,确定所述基准轨迹;determining the reference trajectory based on the second movement trajectory of all the second blockchain nodes;

从所述第一定位信息中提取第一卫星定位信息以及第一检测时间;Extracting first satellite positioning information and a first detection time from the first positioning information;

基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹;determining a first movement track based on the first positioning information and the first detection time;

根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围。Detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track.

可选地,所述每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤之后,还包括:Optionally, after the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node at every first preset time interval, it further includes:

获取所述第一区块链节点的区块中保存的离校时间段信息;Obtain the school-leaving time period information saved in the block of the first block chain node;

基于所述离校时间段信息判断当前时间点是否需要离校;Judging whether the current time point needs to leave school based on the time period information for leaving school;

若否,则执行所述分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间的步骤;If not, then perform the step of extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes, respectively. A step of;

若是,则基于所述第一区块链节点的区块中保存的基准离校轨迹以及所述第一定位信息,检测所述第一区块链节点的所述移动范围是否偏离所述基准范围。If so, then based on the reference school-leaving track and the first positioning information stored in the block of the first blockchain node, detect whether the moving range of the first blockchain node deviates from the reference range .

可选地,所述根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围的步骤包括:Optionally, the step of detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track includes:

将所述基准轨迹标记在地图中,得到基准地图区域;Marking the reference track on the map to obtain the reference map area;

将所述第一移动轨迹标记在所述地图中,得到待检测地图区域;Marking the first movement track in the map to obtain a map area to be detected;

检测所述待检测地图区域中是否存在于所述基准地图区域未重合的目标地图区域;Detecting whether there is a target map area that does not overlap with the reference map area in the map area to be detected;

若是,则计算所述目标地图区域中的每个位置与所述基准地图区域的距离,并在所述距离中选取最大距离,在所述最大距离大于预设距离阈值时,则确定所述移动范围偏离所述基准范围。If so, calculate the distance between each position in the target map area and the reference map area, and select the maximum distance among the distances, and when the maximum distance is greater than a preset distance threshold, determine the movement The range deviates from the reference range.

可选地,所述基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹的步骤之后,还包括:Optionally, after the step of determining the first movement track based on the first positioning information and the first detection time, it further includes:

获取所述第一区块链节点的区块中包括的基准卫星定位信息;Obtain the reference satellite positioning information included in the block of the first blockchain node;

在所述第一卫星定位信息或者所述第二卫星定位信息,与所述基准卫星定位信息不相同时,执行根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围的步骤。When the first satellite positioning information or the second satellite positioning information is different from the reference satellite positioning information, perform detecting whether the movement range deviates from the reference trajectory according to whether the first movement trajectory deviates from the reference trajectory Steps for the base range.

可选地,所述每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤之前,所述方法还包括:Optionally, before the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node every first preset time interval, the method further includes:

获取服务器发送的预设课程信息,以及所述预设课程信息与预设电子学生证标识的对应关系信息;Obtaining the preset course information sent by the server, and the corresponding relationship information between the preset course information and the preset electronic student ID;

获取所述第一电子学生证的登录用户信息,并获取所述登录用户信息对应的目标课程信息;Obtain the login user information of the first electronic student ID, and obtain the target course information corresponding to the login user information;

根据所述目标课程信息与所述对应关系信息,确定与所述目标课程信息相同的所述预设电子学生证为所述第二电子学生证;According to the target course information and the corresponding relationship information, determine the preset electronic student ID that is the same as the target course information as the second electronic student ID;

基于所述第一电子学生证建立所述第一区块链节点,并基于所述第二电子学生证建立所述第二区块链节点。The first blockchain node is established based on the first electronic student ID, and the second blockchain node is established based on the second electronic student ID.

可选地,所述基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息的步骤包括:Optionally, the step of determining target movement track information based on the historical location information of the first blockchain node includes:

获取所述第一区块链节点的区块中保存的历史时间段内的所述历史定位信息,所述历史定位信息包括历史卫星定位位置以及第三检测时间;Acquiring the historical positioning information within the historical time period stored in the block of the first blockchain node, the historical positioning information including the historical satellite positioning position and the third detection time;

基于所述历史定位信息,在地图中标记所述历史卫星定位位置以及每个所述历史卫星定位位置对应的所述第三检测时间,得到目标地图信息,将所述目标地图信息作为所述目标移动轨迹信息。Based on the historical positioning information, mark the historical satellite positioning positions and the third detection time corresponding to each of the historical satellite positioning positions on the map to obtain target map information, and use the target map information as the target Mobile trajectory information.

可选地,所述方法还包括:Optionally, the method also includes:

每隔第二预设时间间隔,识别所述第一区块链节点的用户身份;identifying the user identity of the first blockchain node every second preset time interval;

在识别所述用户身份成功时,执行每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤;When the identity of the user is successfully identified, the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node at a first preset time interval is performed;

在识别所述用户身份失败时,向所述第一区块链节点关联的所述报警终端发送所述目标移动轨迹信息。When the identification of the user identity fails, the target movement track information is sent to the alarm terminal associated with the first block chain node.

此外,为实现上述目的,本发明还提供一种电子学生证,所述电子学生证包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于区块链的定位及轨迹检测程序,所述基于区块链的定位及轨迹检测程序被所述处理器执行时实现上述任一项所述的基于区块链的定位及轨迹检测方法的步骤。In addition, in order to achieve the above object, the present invention also provides an electronic student ID card, which includes a memory, a processor, and a block chain-based positioning system stored on the memory and operable on the processor. And a track detection program, when the block chain-based positioning and track detection program is executed by the processor, the steps of the block chain-based positioning and track detection method described in any one of the above are implemented.

此外,为实现上述目的,本发明化提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于区块链的定位及轨迹检测程序,所述基于区块链的定位及轨迹检测程序被处理器执行时实现上述任一项所述的基于区块链的定位及轨迹检测方法的步骤。In addition, in order to achieve the above object, the present invention provides a computer-readable storage medium, the computer-readable storage medium stores a positioning and trajectory detection program based on blockchain, and the positioning and trajectory detection program based on blockchain When the detection program is executed by the processor, the steps of the block chain-based positioning and trajectory detection method described in any one of the above are realized.

本发明实施例提出的一种基于区块链的定位及轨迹检测方法、电子学生证及介质,通过每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围;在所述第一区块链节点的移动范围偏离所述基准范围时,基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向所述第一区块链节点关联的报警终端发送所述目标移动轨迹信息;其中,所述第一区块链节点为第一电子学生证,所述第二区块链节点为所述第一电子学生证关联的第二电子学生证。由于区块链中存储的信息难以被篡改,因此定位信息和轨迹信息具备较高的真实性,提高数据的准确性,减少数据安全隐患,同时,基于第一区块链节点以及第二区块链节点的定位信息,检测第一区块链节点的移动范围是否偏离基准范围,参考了不同电子学生证的定位信息,能够灵活地在多种场景通过定位和轨迹检测学生是否偏离基准范围,并在学生偏离基准范围时,及时提醒,有效提高了灵活性和减缓了数据安全隐患。The embodiment of the present invention proposes a blockchain-based positioning and trajectory detection method, electronic student ID card and media, by acquiring the first positioning information and the second positioning information of the first blockchain node every first preset time interval Second positioning information of the second block chain node; according to the first positioning information and the second positioning information, detect whether the movement range of the first block chain node deviates from the reference range; in the first block When the movement range of the chain node deviates from the reference range, based on the historical positioning information of the first block chain node, determine the target movement track information, and send the target to the alarm terminal associated with the first block chain node Movement track information; wherein, the first block chain node is a first electronic student ID card, and the second block chain node is a second electronic student ID card associated with the first electronic student ID card. Since the information stored in the blockchain is difficult to be tampered with, the positioning information and trajectory information have high authenticity, which improves the accuracy of the data and reduces potential data security risks. At the same time, based on the first blockchain node and the second block The positioning information of the chain node detects whether the movement range of the first block chain node deviates from the reference range, referring to the positioning information of different electronic student ID cards, and can flexibly detect whether the student deviates from the reference range through positioning and trajectory in various scenarios, and When students deviate from the benchmark range, they will be reminded in time, which effectively improves flexibility and reduces potential data security risks.

附图说明Description of drawings

图1是本发明实施例方案涉及的电子学生证的结构示意图;Fig. 1 is the structural representation of the electronic student ID card that the embodiment scheme of the present invention relates to;

图2为本发明基于区块链的定位及轨迹检测方法第一实施例的流程示意图;2 is a schematic flow diagram of the first embodiment of the blockchain-based positioning and trajectory detection method of the present invention;

图3为本发明基于区块链的定位及轨迹检测方法第二实施例的流程示意图;3 is a schematic flow diagram of the second embodiment of the blockchain-based positioning and trajectory detection method of the present invention;

图4为本发明基于区块链的定位及轨迹检测方法第三实施例的流程示意图。FIG. 4 is a schematic flowchart of a third embodiment of the blockchain-based positioning and trajectory detection method of the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

如图1所示,图1是本发明实施例方案涉及的电子学生证的结构示意图。As shown in Fig. 1, Fig. 1 is a schematic structural diagram of the electronic student ID card involved in the solution of the embodiment of the present invention.

如图1所示,该电子学生证可以包括:处理器1001,例如CPU,存储器1002,通信总线1003。其中,通信总线1003用于实现这些组件之间的连接通信。存储器1002可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1002可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the electronic student ID card may include: a processor 1001 , such as a CPU, a memory 1002 , and a communication bus 1003 . Wherein, the communication bus 1003 is used to realize connection and communication between these components. The memory 1002 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1002 may also be a storage device independent of the foregoing processor 1001 .

本领域技术人员可以理解,图1中示出的电子学生证结构并不构成对电子学生证的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the electronic student ID card shown in Figure 1 does not constitute a limitation on the electronic student ID card, and may include more or less components than those shown in the illustration, or combine some components, or different components layout.

如图1所示,作为一种计算机存储介质的存储器1002中可以包括基于区块链的定位及轨迹检测程序。As shown in FIG. 1 , the memory 1002 as a computer storage medium may include a blockchain-based positioning and trajectory detection program.

在图1所示的电子学生证中,处理器1001可以用于调用存储器1002中存储的基于区块链的定位及轨迹检测程序,并执行以下操作:In the electronic student ID card shown in Figure 1, the processor 1001 can be used to call the block chain-based positioning and track detection program stored in the memory 1002, and perform the following operations:

每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;Obtain the first location information of the first blockchain node and the second location information of the second blockchain node every first preset time interval;

根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围;Detecting whether the movement range of the first blockchain node deviates from a reference range according to the first positioning information and the second positioning information;

在所述第一区块链节点的移动范围偏离所述基准范围时,基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向所述第一区块链节点关联的报警终端发送所述目标移动轨迹信息;When the movement range of the first block chain node deviates from the reference range, based on the historical positioning information of the first block chain node, determine the target movement track information, and associate it with the first block chain node The alarm terminal sends the target movement track information;

其中,所述第一区块链节点为第一电子学生证,所述第二区块链节点为所述第一电子学生证关联的第二电子学生证。Wherein, the first block chain node is a first electronic student ID card, and the second block chain node is a second electronic student ID card associated with the first electronic student ID card.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间;extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes;

基于每个所述第二区块链节点的所述第二卫星定位信息以及所述检测时间,分别确定每个所述第二区块链节点的第二移动轨迹;Based on the second satellite positioning information of each of the second blockchain nodes and the detection time, respectively determine the second movement trajectory of each of the second blockchain nodes;

基于所有所述第二区块链节点的所述第二移动轨迹,确定所述基准轨迹;determining the reference trajectory based on the second movement trajectory of all the second blockchain nodes;

从所述第一定位信息中提取第一卫星定位信息以及第一检测时间;Extracting first satellite positioning information and a first detection time from the first positioning information;

基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹;determining a first movement track based on the first positioning information and the first detection time;

根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围。Detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

获取所述第一区块链节点的区块中保存的离校时间段信息;Obtain the school-leaving time period information saved in the block of the first block chain node;

基于所述离校时间段信息判断当前时间点是否需要离校;Judging whether the current time point needs to leave school based on the time period information for leaving school;

若否,则执行所述分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间的步骤;If not, then perform the step of extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes, respectively. A step of;

若是,则基于所述第一区块链节点的区块中保存的基准离校轨迹以及所述第一定位信息,检测所述第一区块链节点的所述移动范围是否偏离所述基准范围。If so, then based on the reference school-leaving track and the first positioning information stored in the block of the first blockchain node, detect whether the moving range of the first blockchain node deviates from the reference range .

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

将所述基准轨迹标记在地图中,得到基准地图区域;Marking the reference track on the map to obtain the reference map area;

将所述第一移动轨迹标记在所述地图中,得到待检测地图区域;Marking the first movement track in the map to obtain a map area to be detected;

检测所述待检测地图区域中是否存在于所述基准地图区域未重合的目标地图区域;Detecting whether there is a target map area that does not overlap with the reference map area in the map area to be detected;

若是,则计算所述目标地图区域中的每个位置与所述基准地图区域的距离,并在所述距离中选取最大距离,在所述最大距离大于预设距离阈值时,则确定所述移动范围偏离所述基准范围。If so, calculate the distance between each position in the target map area and the reference map area, and select the maximum distance among the distances, and when the maximum distance is greater than a preset distance threshold, determine the movement The range deviates from the reference range.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

获取所述第一区块链节点的区块中包括的基准卫星定位信息;Obtain the reference satellite positioning information included in the block of the first blockchain node;

在所述第一卫星定位信息以及所述第二卫星定位信息,均与所述基准卫星定位信息不相同时,执行根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围的步骤。When both the first satellite positioning information and the second satellite positioning information are different from the reference satellite positioning information, perform detecting whether the movement range is based on whether the first movement track deviates from the reference track. Steps away from the reference range.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

获取服务器发送的预设课程信息,以及所述预设课程信息与预设电子学生证标识的对应关系信息;Obtaining the preset course information sent by the server, and the corresponding relationship information between the preset course information and the preset electronic student ID;

获取所述第一电子学生证的登录用户信息,并获取所述登录用户信息对应的目标课程信息;Obtain the login user information of the first electronic student ID, and obtain the target course information corresponding to the login user information;

根据所述目标课程信息与所述对应关系信息,确定与所述目标课程信息相同的所述预设电子学生证为所述第二电子学生证;According to the target course information and the corresponding relationship information, determine the preset electronic student ID that is the same as the target course information as the second electronic student ID;

基于所述第一电子学生证建立所述第一区块链节点,并基于所述第二电子学生证建立所述第二区块链节点。The first blockchain node is established based on the first electronic student ID, and the second blockchain node is established based on the second electronic student ID.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

获取所述第一区块链节点的区块中保存的历史时间段内的所述历史定位信息,所述历史定位信息包括历史卫星定位位置以及第三检测时间;Acquiring the historical positioning information within the historical time period stored in the block of the first blockchain node, the historical positioning information including the historical satellite positioning position and the third detection time;

基于所述历史定位信息,在地图中标记所述历史卫星定位位置以及每个所述历史卫星定位位置对应的所述第三检测时间,得到目标地图信息,将所述目标地图信息作为所述目标移动轨迹信息。Based on the historical positioning information, mark the historical satellite positioning positions and the third detection time corresponding to each of the historical satellite positioning positions on the map to obtain target map information, and use the target map information as the target Mobile trajectory information.

进一步地,处理器1001可以调用存储器1002中存储的基于区块链的定位及轨迹检测程序,还执行以下操作:Further, the processor 1001 can call the block chain-based positioning and trajectory detection program stored in the memory 1002, and also perform the following operations:

每隔第二预设时间间隔,识别所述第一区块链节点的用户身份;identifying the user identity of the first blockchain node every second preset time interval;

在识别所述用户身份成功时,执行每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤;When the identity of the user is successfully identified, the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node at a first preset time interval is performed;

在识别所述用户身份失败时,向所述第一区块链节点关联的所述报警终端发送所述目标移动轨迹信息。When the identification of the user identity fails, the target movement track information is sent to the alarm terminal associated with the first block chain node.

参照图2,本发明第一实施例提供一种基于区块链的定位及轨迹检测方法,所述基于区块链的定位及轨迹检测方法包括:Referring to Fig. 2, the first embodiment of the present invention provides a blockchain-based positioning and trajectory detection method, the blockchain-based positioning and trajectory detection method comprising:

步骤S10,每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;Step S10, acquiring the first location information of the first blockchain node and the second location information of the second blockchain node every first preset time interval;

步骤S20,根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围;Step S20, according to the first positioning information and the second positioning information, detect whether the movement range of the first blockchain node deviates from a reference range;

步骤S30,在所述第一区块链节点的移动范围偏离所述基准范围时,基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向所述第一区块链节点关联的报警终端发送所述目标移动轨迹信息;Step S30, when the moving range of the first block chain node deviates from the reference range, based on the historical location information of the first block chain node, determine the target moving track information, and send to the first block chain The alarm terminal associated with the chain node sends the target movement track information;

其中,所述第一区块链节点为第一电子学生证,所述第二区块链节点为所述第一电子学生证关联的第二电子学生证。Wherein, the first block chain node is a first electronic student ID card, and the second block chain node is a second electronic student ID card associated with the first electronic student ID card.

第一区块链节点为第一电子学生证,第一电子学生证作为执行主体,主要是指需要检测定位信息以及轨迹信息的电子学生证。第一预设时间间隔是预先设定的用于限定定位信息的获取时机的时间间隔。第一定位信息是第一区块链节点检测并存储在区块中的定位信息。第二区块链节点为第一电子学生预先关联的电子学生证,并且属于区块链中的一个节点。第二定位信息是第二区块链节点检测并存储在区块中的定位信息。移动范围指第一区块链节点进行移动时所经过的地理位置范围。基准范围是用于规定的第一电子学生证应当处于的地理位置范围。历史定位信息是当前时间点以前的一段时间内的第一电子学生证的定位信息,包括历史位置和历史位置对应的历史检测时间。目标移动轨迹信息是基于历史定位信息绘制或者确定的移动轨迹信息。报警终端是用于警示第一电子学生证的轨迹出现偏移的终端。比如可以将第一电子学生证对应学生的监护人的终端作为报警终端。The first blockchain node is the first electronic student ID card, and the first electronic student ID card is the executive body, which mainly refers to the electronic student ID card that needs to detect location information and track information. The first preset time interval is a preset time interval used to limit the timing of acquiring positioning information. The first location information is the location information detected and stored in the block by the first blockchain node. The second block chain node is the electronic student ID card associated with the first electronic student in advance, and belongs to a node in the block chain. The second location information is location information detected by the second block chain node and stored in the block. The moving range refers to the geographic location range through which the first blockchain node moves. The reference range is the geographical range where the specified first electronic student ID should be located. The historical location information is the location information of the first electronic student ID card within a period of time before the current time point, including the historical location and the historical detection time corresponding to the historical location. The target moving track information is the moving track information drawn or determined based on the historical positioning information. The alarm terminal is a terminal used to warn that the trajectory of the first electronic student ID card deviates. For example, the terminal of the student's guardian corresponding to the first electronic student ID card may be used as an alarm terminal.

可选地,基于第一定位信息以及第二定位信息是否均相同,若均相同的情况下,则表明第一电子学生证与第二电子学生证处于相同的定位地点,此时可以确定移动范围没有偏离基准范围。其原因在于,在实际的校园场景中,学生往往是集体进行活动,所经过的位置也大都相似,若存在某些学生偏离了集体的情况下,其检测到的第一定位信息与第二定位信息会出现较大差异。因此,本实施例中,主要应用场景在于,持有第一电子学生证以及第二电子学生证的学生原本就集中活动于特定的场所,但由于并不局限于某一特定的场所,因而其灵活性相对现有技术得到提高。Optionally, based on whether the first positioning information and the second positioning information are the same, if they are the same, it indicates that the first electronic student ID and the second electronic student ID are at the same positioning location, and the movement range can be determined at this time There is no deviation from the baseline range. The reason is that in the actual campus scene, students often carry out activities in groups, and the locations they pass are mostly similar. If some students deviate from the group, the detected first positioning information and the second positioning information Information can vary widely. Therefore, in this embodiment, the main application scenario is that the students who hold the first electronic student ID card and the second electronic student ID card originally concentrated their activities in a specific place, but since they are not limited to a specific place, their Compared with the prior art, the flexibility is improved.

比如,在持有第一电子学生证以及第二电子学生证的学生处于学校内进行活动时,第一定位信息与第二定位信息均应当主要位于学校范围内。而当师生携学生集体进行外出时,此时只需要进一步基于第一定位信息与第二定位信息的相似程度,则可以确定是否持有第一电子学生证的学生是否偏离了集体,而可能出现丢失的现象。因此,通过引入第二电子学生证的第二定位信息,检测第一区块链的移动范围是否偏离基准范围,能够提高多种场景下检测移动范围是否偏离基准范围的灵活性。进一步能够提高在多种场景下检测学生是否偏离集体的灵活性。并且,第一电子学生证以及每个第二电子学生证均作为一个区块链节点,通过区块保存数据,有效避免数据被篡改。For example, when students holding the first electronic student ID card and the second electronic student ID card are carrying out activities in the school, both the first location information and the second location information should be mainly located within the school. And when teachers and students take students to go out collectively, it only needs to be further based on the similarity between the first positioning information and the second positioning information at this time, then it can be determined whether the student holding the first electronic student ID deviates from the group, and may Lost phenomenon occurs. Therefore, by introducing the second positioning information of the second electronic student ID card to detect whether the movement range of the first blockchain deviates from the reference range, the flexibility of detecting whether the movement range deviates from the reference range in various scenarios can be improved. It can further improve the flexibility of detecting whether students deviate from the group in various scenarios. Moreover, the first electronic student ID card and each second electronic student ID card are used as a block chain node to store data through blocks, effectively preventing data from being tampered with.

可选地,第一定位信息包括通过卫星检测到的第一卫星定位信息以及检测第一卫星定位信息的检测时间。Optionally, the first positioning information includes first satellite positioning information detected through satellites and a detection time of detecting the first satellite positioning information.

可选地,区块链可以是分布式账本,可以是私有链、公链或者联盟链。Optionally, the blockchain can be a distributed ledger, a private chain, a public chain or an alliance chain.

可选地,当第一区块链节点端检测到定位信息时,对定位信息进行哈希运算,并生成区块哈希值,并将定位信息以及其对应的区块哈希值以一个交易的形式广播至区块链各个第二区块链节点,使得各第二区块链节点后续基于共识机制,将该交易存入自身的区块链,从而实现定位信息的多方存证,当定位信息的哈希值与区块链节点中己发布的哈希值不一致时,表示定位信息被篡改。Optionally, when the first block chain node detects the location information, perform a hash operation on the location information, generate a block hash value, and combine the location information and its corresponding block hash value with a transaction In the form of broadcasting to each second blockchain node of the blockchain, each second blockchain node subsequently stores the transaction in its own blockchain based on the consensus mechanism, thereby realizing multi-party storage of positioning information. When the hash value of the information is inconsistent with the hash value published in the blockchain node, it means that the positioning information has been tampered with.

可选地,目标移动轨迹信息可以是字符串形式、数据列表形式,或者,也可是标记在地图中。无论哪种形式,目标移动轨迹信息均根据历史定位信息得到,并包括历史位置信息和历史时间信息。Optionally, the target moving track information may be in the form of a character string or a data list, or may also be marked on a map. Regardless of the form, the target moving track information is obtained according to historical positioning information, and includes historical position information and historical time information.

在一实施例中,所述基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息的步骤包括:In one embodiment, the step of determining target movement track information based on the historical location information of the first blockchain node includes:

获取所述第一区块链节点的区块中保存的历史时间段内的所述历史定位信息,所述历史定位信息包括历史卫星定位位置以及第三检测时间;Acquiring the historical positioning information within the historical time period stored in the block of the first blockchain node, the historical positioning information including the historical satellite positioning position and the third detection time;

基于所述历史定位信息,在地图中标记所述历史卫星定位位置以及每个所述历史卫星定位位置对应的所述第三检测时间,得到目标地图信息,将所述目标地图信息作为所述目标移动轨迹信息。Based on the historical positioning information, mark the historical satellite positioning positions and the third detection time corresponding to each of the historical satellite positioning positions on the map to obtain target map information, and use the target map information as the target Mobile trajectory information.

历史时间段是当前时间点之前的时间段。历史卫星定位位置是历史时间段内第一学生证通过卫星定位检测到的位置。第三检测时间是检测历史卫星定位位置的时间。目标地图信息是包含历史卫星定位位置和第三检测时间的地图信息。目标地图信息中具体可以包括经纬度信息以及经纬度信息关联的第三检测时间。The historical time period is the time period before the current point in time. The historical satellite positioning position is the position detected by the first student ID through satellite positioning within the historical time period. The third detection time is the time for detecting historical satellite positioning positions. The target map information is map information including the historical satellite positioning position and the third detection time. Specifically, the target map information may include latitude and longitude information and a third detection time associated with the latitude and longitude information.

通过将历史定位信息标记在地图中,能够便于查看学生的移动轨迹。By marking the historical location information on the map, it is easy to view the student's movement track.

在一实施例中,所述方法还包括:In one embodiment, the method also includes:

每隔第二预设时间间隔,识别所述第一区块链节点的用户身份;identifying the user identity of the first blockchain node every second preset time interval;

在识别所述用户身份成功时,执行每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤;When the identity of the user is successfully identified, the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node at a first preset time interval is performed;

在识别所述用户身份失败时,向所述第一区块链节点关联的所述报警终端发送所述目标移动轨迹信息。When the identification of the user identity fails, the target movement track information is sent to the alarm terminal associated with the first block chain node.

第二预设时间间隔是预先设定的用于限定识别用户身份时机的时间间隔。用户身份是持有第一电子学生证的用户的身份。The second preset time interval is a preset time interval used to limit the opportunity to identify the identity of the user. The user identity is the identity of the user holding the first electronic student ID card.

可选地,通过指纹识别、声纹识别或者人脸识别的方式,识别第一区块链节点的用户身份。Optionally, the identity of the user of the first blockchain node is identified through fingerprint recognition, voiceprint recognition or face recognition.

在识别成功的情况下,可以检测移动轨迹是否偏离基准范围,在识别失败的情况下,则直接生成并发送目标移动轨迹信息,从而在某些场景中,及时使得报警终端获取第一电子学生证的移动轨迹。比如,学生可能已经丢失的场景中,可能未携带第一电子学生证,或者已携带但不便于进行身份验证,此时通过直接发送目标移动轨迹信息,能够及时使得报警终端获得学生丢失情况下的移动轨迹。In the case of successful recognition, it can detect whether the moving track deviates from the reference range, and in the case of failed recognition, directly generate and send the target moving track information, so that in some scenarios, the alarm terminal can obtain the first electronic student ID card in time movement track. For example, in the scene where the student may have been lost, the first electronic student ID card may not be carried, or it may be carried but it is not convenient for identity verification. At this time, by directly sending the target movement track information, the alarm terminal can obtain the student's lost information in time. moving track.

在本实施中,通过每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息;根据所述第一定位信息以及所述第二定位信息,检测所述第一区块链节点的移动范围是否偏离基准范围;在所述第一区块链节点的移动范围偏离所述基准范围时,基于所述第一区块链节点的历史定位信息,确定目标移动轨迹信息,并向所述第一区块链节点关联的报警终端发送所述目标移动轨迹信息;其中,所述第一区块链节点为第一电子学生证,所述第二区块链节点为所述第一电子学生证关联的第二电子学生证。由于区块链中存储的信息难以被篡改,因此定位信息和轨迹信息具备较高的真实性,提高数据的准确性,减少数据安全隐患,同时,基于第一区块链节点以及第二区块链节点的定位信息,检测第一区块链节点的移动范围是否偏离基准范围,参考了不同电子学生证的定位信息,能够灵活地在多种场景通过定位和轨迹检测学生是否偏离基准范围,并在学生偏离基准范围时,及时提醒,有效提高了灵活性和减缓了数据安全隐患。In this implementation, the first positioning information of the first blockchain node and the second positioning information of the second blockchain node are obtained at every first preset time interval; according to the first positioning information and the The second positioning information, detecting whether the movement range of the first block chain node deviates from the reference range; when the movement range of the first block chain node deviates from the reference range, based on the first block chain The historical positioning information of the node determines the target movement trajectory information, and sends the target movement trajectory information to the alarm terminal associated with the first block chain node; wherein, the first block chain node is the first electronic student ID , the second blockchain node is the second electronic student ID associated with the first electronic student ID. Since the information stored in the blockchain is difficult to be tampered with, the positioning information and trajectory information have high authenticity, which improves the accuracy of the data and reduces potential data security risks. At the same time, based on the first blockchain node and the second block The positioning information of the chain node detects whether the movement range of the first block chain node deviates from the reference range, referring to the positioning information of different electronic student ID cards, and can flexibly detect whether the student deviates from the reference range through positioning and trajectory in various scenarios, and When students deviate from the benchmark range, they will be reminded in time, which effectively improves flexibility and reduces potential data security risks.

参照图3,本发明第二实施例提供一种基于区块链的定位及轨迹检测方法,基于上述图2所示的第一实施例,所述步骤S20包括:Referring to FIG. 3, the second embodiment of the present invention provides a blockchain-based positioning and trajectory detection method. Based on the first embodiment shown in FIG. 2 above, the step S20 includes:

步骤S21,分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间;Step S21, respectively extracting the second satellite positioning information and the second detection time of each second blockchain node from the second positioning information of each second blockchain node;

步骤S22,基于每个所述第二区块链节点的所述第二卫星定位信息以及所述检测时间,分别确定每个所述第二区块链节点的第二移动轨迹;Step S22, based on the second satellite positioning information of each of the second blockchain nodes and the detection time, respectively determine the second movement trajectory of each of the second blockchain nodes;

步骤S23,基于所有所述第二区块链节点的所述第二移动轨迹,确定所述基准轨迹;Step S23, determining the reference trajectory based on the second movement trajectory of all the second blockchain nodes;

步骤S24,从所述第一定位信息中提取第一卫星定位信息以及第一检测时间;Step S24, extracting the first satellite positioning information and the first detection time from the first positioning information;

步骤S25,基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹;Step S25, determining a first movement track based on the first positioning information and the first detection time;

步骤S26,根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围。Step S26, according to whether the first moving track deviates from the reference track, detect whether the moving range deviates from the reference range.

第二区块链节点的数量为多个。每个第二区块链节点均有对应的第二定位信息。第二定位信息包括第二卫星定位信息以及第二检测时间。第二卫星定位信息为第二区块链节点通过卫星定位检测到的位置信息。第二检测时间为第二区块链检测第二卫星定位信息的时间。每个检测到的卫星定位位置均对应一个检测时间。第二移动轨迹是第二区块链节点移动的轨迹。每个第二区块链节点均存在对应的第二移动轨迹。基准轨迹是基于第二移动轨迹得到的用于描述第二电子学生证整体轨迹的信息。第一卫星定位信息为第一电子学生证通过卫星定位检测到的位置信息。第一检测时间是第一电子学生证检测第一卫星定位信息的检测时间。第一移动轨迹是第一电子学生证的移动轨迹。The number of second block chain nodes is multiple. Each second blockchain node has corresponding second location information. The second positioning information includes second satellite positioning information and a second detection time. The second satellite positioning information is the position information detected by the second blockchain node through satellite positioning. The second detection time is the time when the second block chain detects the second satellite positioning information. Each detected satellite positioning position corresponds to a detection time. The second movement trajectory is the trajectory of the movement of the second blockchain node. Each second blockchain node has a corresponding second movement track. The reference trajectory is information used to describe the overall trajectory of the second electronic student ID card obtained based on the second movement trajectory. The first satellite positioning information is the position information detected by the first electronic student ID through satellite positioning. The first detection time is the detection time when the first electronic student ID card detects the first satellite positioning information. The first movement track is the movement track of the first electronic student ID card.

可选地,基准轨迹包括所有第二移动轨迹。Optionally, the reference trajectory includes all second movement trajectories.

可选地,通过按照第一检测时间从早至晚依次在列表中对每个第一卫星定位信息进行排序得到第一移动轨迹。或者,也可以将第一卫星定位信息标记在地图中以得到第一移动轨迹。Optionally, the first movement trajectory is obtained by sorting each piece of first satellite positioning information in the list according to the first detection time from early to late. Alternatively, the first satellite positioning information may also be marked on the map to obtain the first movement track.

可选地,通过按照第二检测时间从早至晚依次在列表中对每个第二卫星定位信息进行排序得到第二移动轨迹。或者,也可以将第二卫星定位信息标记在地图中以得到第二移动轨迹。Optionally, the second movement trajectory is obtained by sorting each piece of second satellite positioning information in the list according to the second detection time from early to late. Alternatively, the second satellite positioning information may also be marked on the map to obtain the second movement track.

在一实施例中,所述每隔第一预设时间间隔获取所述第一区块链节点的第一定位信息以及第二区块链节点的第二定位信息的步骤之后,还包括:In one embodiment, after the step of acquiring the first location information of the first blockchain node and the second location information of the second blockchain node at every first preset time interval, it further includes:

获取所述第一区块链节点的区块中保存的离校时间段信息;Obtain the school-leaving time period information saved in the block of the first block chain node;

基于所述离校时间段信息判断当前时间点是否需要离校;Judging whether the current time point needs to leave school based on the time period information for leaving school;

若否,则执行所述分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间的步骤;If not, then perform the step of extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes, respectively. A step of;

若是,则基于所述第一区块链节点的区块中保存的基准离校轨迹以及所述第一定位信息,检测所述第一区块链节点的所述移动范围是否偏离所述基准范围。If so, then based on the reference school-leaving track and the first positioning information stored in the block of the first blockchain node, detect whether the moving range of the first blockchain node deviates from the reference range .

离校时间段信息是预先保存在区块中,用于指示持有学生何时离校的时间段信息。基准离校轨迹是预先保存在区块中,用于指示第一电子学生证离校时应当对应的移动轨迹。The school-leaving time period information is pre-stored in the block, and is used to indicate the time period information of when the student leaves school. The reference school leaving track is pre-stored in the block, and is used to indicate the corresponding moving track when the first electronic student ID card leaves school.

在不需要离校的场景中,学生应当是集体活动,此时,可以结合第一定位信息以第二定位信息检测学生的位置是否脱离了集体,在脱离集体的情况下,则需要发送目标轨迹信息。在学生需要离校的场景中,第一定位信息与第二定位信息不存在特定的规律,此时,可以结合基准离校轨迹检测第一电子学生证是否偏离应有的移动路线。比如,可以将回家的路线作为基准轨迹。In the scene where there is no need to leave the school, the students should be in a group activity. At this time, the first positioning information can be combined with the second positioning information to detect whether the student's position is out of the group. In the case of leaving the group, the target trajectory needs to be sent information. In the scenario where students need to leave school, there is no specific rule between the first positioning information and the second positioning information. At this time, it can be combined with the reference school leaving track to detect whether the first electronic student ID deviates from the expected moving route. For example, the route home can be used as the reference trajectory.

在一实施例中,所述根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围的步骤包括:In an embodiment, the step of detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track includes:

将所述基准轨迹标记在地图中,得到基准地图区域;Marking the reference track on the map to obtain the reference map area;

将所述第一移动轨迹标记在所述地图中,得到待检测地图区域;Marking the first movement track in the map to obtain a map area to be detected;

检测所述待检测地图区域中是否存在于所述基准地图区域未重合的目标地图区域;Detecting whether there is a target map area that does not overlap with the reference map area in the map area to be detected;

若是,则计算所述目标地图区域中的每个位置与所述基准地图区域的距离,并在所述距离中选取最大距离,在所述最大距离大于预设距离阈值时,则确定所述移动范围偏离所述基准范围。If so, calculate the distance between each position in the target map area and the reference map area, and select the maximum distance among the distances, and when the maximum distance is greater than a preset distance threshold, determine the movement The range deviates from the reference range.

基准地图区域是通过基准轨迹标记地图得到的地图区域。待检测地图区域是通过第一移动轨迹得到的地图区域。目标地图区域是待检测地图区域与基准地图区域中未重合部分的趋于。预设距离阈值是预先设定的用于指示是否偏离基准范围的距离阈值。The reference map area is the map area obtained by marking the map with the reference track. The map area to be detected is a map area obtained through the first movement track. The target map area is the tendency of the non-overlapping part of the map area to be detected and the reference map area. The preset distance threshold is a preset distance threshold used to indicate whether to deviate from the reference range.

可选地,基准地图区域可以采用经纬度信息进行表示。通过将基准轨迹对应的所有经纬度信息标记在地图中,并对基准轨迹对应的所有经纬度进行拟合,得到地图中的第一拟合图形作为基准地图区域。Optionally, the reference map area may be represented by latitude and longitude information. By marking all the latitude and longitude information corresponding to the reference trajectory in the map, and fitting all the latitude and longitude information corresponding to the reference trajectory, the first fitting figure in the map is obtained as the reference map area.

可选地,待检测地图区域可采用经纬度信息表示,通过将第一移动轨迹对应的所有经纬度信息标记在地图中,并对第一移动轨迹对应的所有经纬度进行拟合,得到地图中的第二拟合图形作为待检测地图区域。Optionally, the map area to be detected can be represented by latitude and longitude information. By marking all the latitude and longitude information corresponding to the first movement track in the map, and fitting all the latitude and longitude information corresponding to the first movement track, the second position in the map is obtained. The fitting graph is used as the map area to be detected.

可选地,通过将目标地图区域中的所有经纬度信息与基准地图区域的所有经纬度信息之间的距离,得到最大距离,并在最大距离大于预设距离阈值时,表明第一电子学生证移动过远,从而偏离基准范围。Optionally, by calculating the distance between all the latitude and longitude information in the target map area and all the latitude and longitude information in the reference map area, the maximum distance is obtained, and when the maximum distance is greater than the preset distance threshold, it indicates that the first electronic student ID card has moved far away from the reference range.

在一实施例中,所述基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹的步骤之后,还包括:In an embodiment, after the step of determining the first movement track based on the first positioning information and the first detection time, it further includes:

获取所述第一区块链节点的区块中包括的基准卫星定位信息;Obtain the reference satellite positioning information included in the block of the first blockchain node;

在所述第一卫星定位信息以及所述第二卫星定位信息,均与所述基准卫星定位信息不相同时,执行根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围的步骤。When both the first satellite positioning information and the second satellite positioning information are different from the reference satellite positioning information, perform detecting whether the movement range is based on whether the first movement track deviates from the reference track. Steps away from the reference range.

基准卫星定位信息是预先存储在区块中的固定卫星定位信息。The reference satellite positioning information is fixed satellite positioning information stored in the block in advance.

比如,可以将学校所对应的卫星定位信息作为基准卫星定位信息。For example, the satellite positioning information corresponding to the school may be used as the reference satellite positioning information.

在第一卫星定位信息以及第二卫星定位信息均与基准卫星定位信息不同时,则表明学生可能集体外出,此时,为了在集体外出的场景中,仍然检测第一电子学生证是否丢失,需要进一步基于第一移动轨迹是否偏离基准轨迹,检测移动范围是否基准范围,避免集体外出的场景中,出现的错误判断移动范围偏离的情况。When the first satellite positioning information and the second satellite positioning information are different from the reference satellite positioning information, it indicates that the students may go out together. At this time, in order to still detect whether the first electronic student ID is lost in the group going out scene, it is necessary Further, based on whether the first moving track deviates from the reference track, it is detected whether the moving range is in the reference range, so as to avoid the situation of wrongly judging that the moving range deviates in the scene of group going out.

在本实施例中,通过分别从每个所述第二区块链节点的所述第二定位信息中,提取每个所述第二区块链节点的第二卫星定位信息以及第二检测时间;基于每个所述第二区块链节点的所述第二卫星定位信息以及所述检测时间,分别确定每个所述第二区块链节点的第二移动轨迹;基于所有所述第二区块链节点的所述第二移动轨迹,确定所述基准轨迹;从所述第一定位信息中提取第一卫星定位信息以及第一检测时间;基于所述第一定位信息以及所述第一检测时间,确定第一移动轨迹;根据所述第一移动轨迹是否偏离所述基准轨迹,检测所述移动范围是否偏离所述基准范围。从而能够基于第二电子学生证的第二移动轨迹作为基准,判断第一移动轨迹是否偏离基准轨迹,从而能够在集体外出的场景中,还能够继续检测第一电子学生证的移动轨迹是否偏离,提高了在不同场景下的应用灵活性。In this embodiment, by extracting the second satellite positioning information and the second detection time of each of the second blockchain nodes from the second positioning information of each of the second blockchain nodes ; Based on the second satellite positioning information of each of the second blockchain nodes and the detection time, respectively determine the second movement trajectory of each of the second blockchain nodes; based on all the second The second moving trajectory of the blockchain node determines the reference trajectory; extracts the first satellite positioning information and the first detection time from the first positioning information; based on the first positioning information and the first Detecting time to determine a first movement track; detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track. Therefore, based on the second moving track of the second electronic student ID card as a reference, it can be judged whether the first moving track deviates from the reference track, so that in the scene of group going out, it is possible to continue to detect whether the moving track of the first electronic student ID card deviates, Improved application flexibility in different scenarios.

参照图4,本发明第三实施例提供一种基于区块链的定位及轨迹检测方法,基于上述图2所示的第一实施例,所述步骤S10之前,还包括:Referring to FIG. 4, the third embodiment of the present invention provides a blockchain-based positioning and trajectory detection method. Based on the first embodiment shown in FIG. 2 above, before the step S10, it also includes:

步骤S40,获取服务器发送的预设课程信息,以及所述预设课程信息与预设电子学生证标识的对应关系信息;Step S40, obtaining the preset course information sent by the server, and the correspondence relationship information between the preset course information and the preset electronic student ID;

步骤S50,获取所述第一电子学生证的登录用户信息,并获取所述登录用户信息对应的目标课程信息;Step S50, obtaining the login user information of the first electronic student ID card, and obtaining the target course information corresponding to the login user information;

步骤S60,根据所述目标课程信息与所述对应关系信息,确定与所述目标课程信息相同的所述预设电子学生证为所述第二电子学生证;Step S60, according to the target course information and the corresponding relationship information, determine the preset electronic student ID that is the same as the target course information as the second electronic student ID;

步骤S70,基于所述第一电子学生证建立所述第一区块链节点,并基于所述第二电子学生证建立所述第二区块链节点。Step S70, establishing the first blockchain node based on the first electronic student ID, and establishing the second blockchain node based on the second electronic student ID.

预设课程信息为预先设定的课程信息。每一预设课程信息均具有对应的预设电子学生证标识。预设电子学生证标识是用于识别电子学生证的标识。第一电子学生证以及第二电子学生证均具有对应的标识。登录用户信息是登录第一电子学生证的用户的信息。目标课程信息是与登录用户信息对应的课程信息。The preset course information is preset course information. Each preset course information has a corresponding preset electronic student ID. The preset electronic student ID ID is an ID for identifying the electronic student ID card. Both the first electronic student ID card and the second electronic student ID card have corresponding identifications. The login user information is the information of the user who has logged in the first electronic student ID card. The target course information is course information corresponding to the login user information.

在确定第二电子学生证时,需要从与目标课程信息相同的预设电子学生证中提出第一电子学生证,并将剔除后其余的预设电子学生证作为第二电子学生证。When determining the second electronic student ID, it is necessary to select the first electronic student ID from the preset electronic student IDs with the same target course information, and use the remaining preset electronic student IDs after elimination as the second electronic student ID.

在一场景中,不同课程对应的学生可能不同,此时,为了能够准确地检测第一电子学生证的移动轨迹是否偏离基准轨迹,将具有相同课程的电子学生证建立第二区块链节点,从而能够针对选修课等场景更加针对性地检测移动轨迹是否偏离,提高在选修课场景下的应用灵活性。In one scenario, students corresponding to different courses may be different. At this time, in order to accurately detect whether the movement track of the first electronic student ID deviates from the reference track, a second block chain node will be established for the electronic student ID card with the same course, In this way, it is possible to more specifically detect whether the movement trajectory deviates from scenarios such as elective courses, and improve the application flexibility in the elective course scenario.

在本实施例中,通过获取服务器发送的预设课程信息,以及所述预设课程信息与预设电子学生证标识的对应关系信息;获取所述第一电子学生证的登录用户信息,并获取所述登录用户信息对应的目标课程信息;根据所述目标课程信息与所述对应关系信息,确定与所述目标课程信息相同的所述预设电子学生证为所述第二电子学生证;基于所述第一电子学生证建立所述第一区块链节点,并基于所述第二电子学生证建立所述第二区块链节点。能够进一步提高在课程不同的情况下,检测移动范围是否偏离基准范围的灵活性。In this embodiment, by obtaining the preset course information sent by the server, and the corresponding relationship information between the preset course information and the preset electronic student ID; acquiring the login user information of the first electronic student ID, and obtaining The target course information corresponding to the login user information; according to the target course information and the correspondence information, determine the preset electronic student ID that is the same as the target course information as the second electronic student ID; based on The first electronic student ID establishes the first block chain node, and establishes the second block chain node based on the second electronic student ID. It is possible to further improve the flexibility of detecting whether the movement range deviates from the reference range when courses are different.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, as used herein, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or system comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or system. Without further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system comprising that element.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台电子学生证执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make an electronic student ID card execute the method described in each embodiment of the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process conversion made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related technical fields , are all included in the scope of patent protection of the present invention in the same way.

Claims (7)

1. A positioning and track detection method based on a block chain is applied to a first block chain node, and the method comprises the following steps:
acquiring first positioning information of the first block chain node and second positioning information of the second block chain node at intervals of a first preset time interval;
acquiring off-calibration time period information stored in the block of the first block link node;
judging whether the current time point needs to be calibrated based on the calibration time period information;
if not, detecting whether the moving range of the first block chain node deviates from a reference range according to the first positioning information and the second positioning information, wherein the step of detecting whether the moving range of the first block chain node deviates from the reference range according to the first positioning information and the second positioning information comprises the following steps: acquiring reference satellite positioning information included in a block of the first block chain node, and detecting whether the movement range deviates from the reference range when the first positioning information and the second positioning information are different from the reference satellite positioning information;
if so, detecting whether the moving range of the first block chain node deviates from the reference range based on a reference deviation track stored in a block of the first block chain node and the first positioning information;
when the moving range of the first block chain node deviates from the reference range, determining target moving track information based on historical positioning information of the first block chain node, and sending the target moving track information to an alarm terminal associated with the first block chain node;
the first block chain node is a first electronic student certificate, the second block chain node is a second electronic student certificate associated with the first electronic student certificate, and the reference satellite positioning information is satellite positioning information corresponding to a school;
before the step of acquiring the first positioning information of the first blockchain node and the second positioning information of the second blockchain node at every first preset time interval, the method further includes:
acquiring preset course information sent by a server and corresponding relation information between the preset course information and a preset electronic student identity card identifier;
acquiring login user information of the first electronic student certificate, and acquiring target course information corresponding to the login user information;
determining the preset electronic student certificate which is the same as the target course information as the second electronic student certificate according to the target course information and the corresponding relation information;
and establishing the first block chain node based on the first electronic student identity card, and establishing the second block chain node based on the second electronic student identity card.
2. The method of claim 1, wherein the step of detecting whether the moving range of the first blockchain node deviates from a reference range according to the first positioning information and the second positioning information comprises:
extracting second satellite positioning information and second detection time of each second blockchain node from the second positioning information of each second blockchain node respectively;
determining a second movement trajectory of each second blockchain node respectively based on the second satellite positioning information and the detection time of each second blockchain node;
determining a reference track based on the second movement tracks of all the second blockchain nodes;
extracting first satellite positioning information and first detection time from the first positioning information;
determining a first movement track based on the first positioning information and the first detection time;
and acquiring reference satellite positioning information included in the block of the first block chain node, and detecting whether the movement range deviates from the reference range according to whether the first movement track deviates from the reference track when the first satellite positioning information and the second satellite positioning information are different from the reference satellite positioning information.
3. The method according to claim 2, wherein the step of detecting whether the movement range deviates from the reference range according to whether the first movement trajectory deviates from the reference trajectory comprises:
marking the reference track in a map to obtain a reference map area;
marking the first moving track in the map to obtain a map area to be detected;
detecting whether a target map area which is not overlapped with the reference map area exists in the to-be-detected map area or not;
if yes, calculating the distance between each position in the target map area and the reference map area, selecting the maximum distance from the distances, and determining that the moving range deviates from the reference range when the maximum distance is greater than a preset distance threshold.
4. The method of claim 1, wherein the step of determining target movement trajectory information based on historical positioning information of the first blockchain node comprises:
obtaining historical positioning information in a historical time period saved in a block of the first block chain node, wherein the historical positioning information comprises a historical satellite positioning position and third detection time;
and marking the historical satellite positioning positions and the third detection time corresponding to each historical satellite positioning position in a map based on the historical positioning information to obtain target map information, and taking the target map information as the target moving track information.
5. The method of claim 1, wherein the method further comprises:
identifying the user identity of the first block chain node every a second preset time interval;
when the user identity is successfully identified, a step of acquiring first positioning information of the first block chain node and second positioning information of the second block chain node at intervals of a first preset time interval is executed;
and when the user identity is failed to be identified, sending the target movement track information to the alarm terminal associated with the first block link point.
6. An electronic student card comprising a memory, a processor and a blockchain based positioning and trajectory detection program stored on the memory and executable on the processor, the blockchain based positioning and trajectory detection program when executed by the processor implementing the steps of the blockchain based positioning and trajectory detection method according to any one of claims 1 to 5.
7. A computer-readable storage medium, wherein a blockchain-based positioning and trajectory detection program is stored on the computer-readable storage medium, and when the blockchain-based positioning and trajectory detection program is executed by a processor, the steps of the blockchain-based positioning and trajectory detection method according to any one of claims 1 to 5 are implemented.
CN202111649273.5A 2021-12-29 2021-12-29 Blockchain-based positioning and trajectory detection method, electronic student ID card and medium Expired - Fee Related CN114491302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111649273.5A CN114491302B (en) 2021-12-29 2021-12-29 Blockchain-based positioning and trajectory detection method, electronic student ID card and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111649273.5A CN114491302B (en) 2021-12-29 2021-12-29 Blockchain-based positioning and trajectory detection method, electronic student ID card and medium

Publications (2)

Publication Number Publication Date
CN114491302A CN114491302A (en) 2022-05-13
CN114491302B true CN114491302B (en) 2023-03-24

Family

ID=81508952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111649273.5A Expired - Fee Related CN114491302B (en) 2021-12-29 2021-12-29 Blockchain-based positioning and trajectory detection method, electronic student ID card and medium

Country Status (1)

Country Link
CN (1) CN114491302B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118348570B (en) * 2024-05-06 2025-05-09 深圳市飞瑞航空服务有限公司 Position tracking method, device and storage medium based on satellite communication

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568941A (en) * 2020-04-28 2021-10-29 深圳云天励飞技术有限公司 A kind of excavation method, device and electronic equipment for same track personnel

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007138816A1 (en) * 2006-05-26 2007-12-06 Panasonic Corporation Notification system, notification device, and notification method
JP2008003690A (en) * 2006-06-20 2008-01-10 Matsushita Electric Ind Co Ltd Observer monitoring device, observer monitoring system, and observer monitoring method
JP2008113184A (en) * 2006-10-30 2008-05-15 Nec Corp POSITION MONITORING SYSTEM, POSITION MONITORING DEVICE, POSITION MONITORING METHOD, AND MOBILE TERMINAL
CN109068268A (en) * 2018-08-13 2018-12-21 四川科道芯国智能技术股份有限公司 Student's trajectory analysis method and device
CN109191782A (en) * 2018-10-31 2019-01-11 广东小天才科技有限公司 Children safety early warning system and method
CN109218116A (en) * 2018-11-27 2019-01-15 谭秉逸 A kind of block catenary system and block chain update method
CN112288994A (en) * 2020-10-29 2021-01-29 湖南省大美盈科研学旅游文化有限公司 Research and study travel positioning management system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568941A (en) * 2020-04-28 2021-10-29 深圳云天励飞技术有限公司 A kind of excavation method, device and electronic equipment for same track personnel

Also Published As

Publication number Publication date
CN114491302A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US10033731B2 (en) Protection from unfamiliar login locations
US9432845B2 (en) System and method for automated analysis comparing a wireless device location with another geographic location
AU2007349233B2 (en) System and method for automated analysis comparing a wireless device location with another geographic location
US9699016B2 (en) Sign-in method and system
US20180072539A1 (en) System and method for automated analysis comparing a wireless device location with another geographic location
EP3373626B1 (en) Method and device for use in risk management of application information
JP2020525941A5 (en)
US20190190911A1 (en) Methods, apparatus, and systems for identity authentication
CN104346566A (en) Method, device, terminal, server and system for detecting privacy authority risks
CN104780043A (en) Access control method and system based on two-dimension code
CN105074492A (en) Determining a location of a mobile user terminal
CN114491302B (en) Blockchain-based positioning and trajectory detection method, electronic student ID card and medium
CN104994471A (en) Position tracking method for terminal equipment, server and terminal equipment
CN109831738A (en) Intelligent device positioning method and intelligent device
CN105897663A (en) Method for determining access authority, device and equipment
CN107610452A (en) The closely quick about car method and system of bluetooth hot spot positioning
CN105246157A (en) A positioning method and positioning system for a mobile terminal
CN109102581B (en) Card punching method, device, system and storage medium
JP2016115095A (en) Identification information processing system based on location information, and method
CN103984716A (en) Method and system for precisely positioning space address based on geographical information
CN105371849B (en) An object search method and server
CN110853293A (en) Security early warning method and device for map fence
CN105101089B (en) Method, related device and system for realizing positioning
KR20200054634A (en) Method, Recording medium and Blockchain system for confirming blockchain transaction using location information
CN107341275A (en) The method for pushing and device of alumnus's information

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230324

CF01 Termination of patent right due to non-payment of annual fee