CN112131325A - Track determination method, device and equipment and storage medium - Google Patents
Track determination method, device and equipment and storage medium Download PDFInfo
- Publication number
- CN112131325A CN112131325A CN201910555349.4A CN201910555349A CN112131325A CN 112131325 A CN112131325 A CN 112131325A CN 201910555349 A CN201910555349 A CN 201910555349A CN 112131325 A CN112131325 A CN 112131325A
- Authority
- CN
- China
- Prior art keywords
- data
- target
- data attribute
- index
- attribute
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Remote Sensing (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及数据处理技术领域,尤其涉及的是一种轨迹确定方法、装置及设备、存储介质。The present invention relates to the technical field of data processing, and in particular, to a method, device and equipment for determining a trajectory, and a storage medium.
背景技术Background technique
在一些封闭式场景比如园区中,为了规范对象的出入管理,预防不法分子带来的不安全因素,对园区内的对象进行全天轨迹的追踪,精确掌握对象在园区内行动轨迹。In some closed scenes such as parks, in order to regulate the access management of objects and prevent unsafe factors caused by lawbreakers, the objects in the park are tracked throughout the day, and the object's movement trajectory in the park can be accurately grasped.
相关轨迹确定方式中,主要基于用户上报(比如通过手机上报)对象的GPS数据来生成对象的轨迹,再将轨迹存储到文件或者关系型数据库中。但是,在一些特殊的场景比如园区中,一般都没有接收用户上报的GPS数据的接收设备,无法通过上述方式来生成轨迹。In the related trajectory determination method, the trajectory of the object is generated mainly based on the GPS data of the object reported by the user (for example, reported by a mobile phone), and then the trajectory is stored in a file or a relational database. However, in some special scenarios such as a park, there is generally no receiving device for receiving the GPS data reported by the user, and the trajectory cannot be generated by the above method.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明提供一种轨迹确定方法、装置及设备、存储介质,用数据源的位置信息生成移动轨迹,可适用于园区等没有GPS数据接收设备的场景。In view of this, the present invention provides a trajectory determination method, device and device, and storage medium, which uses the location information of a data source to generate a moving trajectory, which can be applied to scenarios such as parks without GPS data receiving equipment.
本发明第一方面提供一种轨迹确定方法,包括:A first aspect of the present invention provides a trajectory determination method, comprising:
从不同数据源提取数据属性,所述数据属性至少包括:对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息;Extracting data attributes from different data sources, the data attributes at least include: the object identification ID of the object, the time information when the object was collected, and the location information of the data source;
将提取的每一数据属性存储至指定数据存储系统;Store each extracted data attribute to the specified data storage system;
接收外部输入的查询条件,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。Receive externally input query conditions, query target data attributes that satisfy the query conditions from the specified data storage system according to the query conditions, and search the target data attributes including the same object ID according to the time information in the target data attributes including the same object ID. The data source location information in the target data attribute of the ID is sorted to obtain the movement track corresponding to the object ID.
根据本发明的一个实施例,所述指定数据存储系统中存储的每一数据属性具有对应的索引,数据属性对应的索引包括数据属性包含的时间信息;According to an embodiment of the present invention, each data attribute stored in the designated data storage system has a corresponding index, and the index corresponding to the data attribute includes time information contained in the data attribute;
所述查询条件包括:目标时间段;依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,包括:The query conditions include: a target time period; according to the query conditions, query the target data attributes that satisfy the query conditions from the specified data storage system, including:
依据所述目标时间段在指定数据存储系统中查询目标索引,所述目标索引中的时间信息处于所述目标时间段内;querying a target index in a specified data storage system according to the target time period, where the time information in the target index is within the target time period;
将所述目标索引对应的数据属性确定为参考数据属性;Determining the data attribute corresponding to the target index as the reference data attribute;
从各参考数据属性中确定出目标数据属性。The target data attribute is determined from the reference data attributes.
根据本发明的一个实施例,从所述参考数据属性中确定出目标数据属性,包括:According to an embodiment of the present invention, determining the target data attribute from the reference data attribute includes:
从各参考数据属性包含的对象ID中选择目标对象ID,其中,所有参考数据属性中包含所述目标对象ID的参考数据属性的数量大于预设数量;Selecting a target object ID from the object IDs included in each reference data attribute, wherein the number of reference data attributes including the target object ID in all reference data attributes is greater than a preset number;
采用Scroll方式从所述指定数据存储系统拉取包含所述目标对象ID的参考数据属性作为所述目标数据属性。The reference data attribute including the target object ID is pulled from the designated data storage system in a scroll manner as the target data attribute.
根据本发明的一个实施例,所述指定数据存储系统中包括至少两个索引存储段,每个索引存储段具有对应的时间段,每个索引存储段用于存储时间信息处于对应时间段内的索引;According to an embodiment of the present invention, the designated data storage system includes at least two index storage segments, each index storage segment has a corresponding time segment, and each index storage segment is used to store time information within the corresponding time segment. index;
依据所述目标时间段在指定数据存储系统中查询目标索引,包括:Querying the target index in the specified data storage system according to the target time period, including:
从所述指定数据存储系统中确定目标索引存储段,所述目标索引存储段对应的时间段与所述目标时间段存在交集;Determine a target index storage segment from the specified data storage system, and the time segment corresponding to the target index storage segment has an intersection with the target time segment;
从所述目标索引存储段中查询所述目标索引。The target index is queried from the target index bucket.
根据本发明的一个实施例,According to an embodiment of the present invention,
该方法还进一步包括:The method further includes:
获取外部输入的参考对象ID,确定所述参考对象ID对应的参考移动轨迹,计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度;Obtain the reference object ID input from the outside, determine the reference movement track corresponding to the reference object ID, and calculate the similarity between the movement track corresponding to each object ID and the reference movement track;
从各对象ID对应的移动轨迹中选取与所述参考移动轨迹的相似度最大的至少一个移动轨迹。At least one movement trajectory with the greatest similarity to the reference movement trajectory is selected from the movement trajectories corresponding to each object ID.
根据本发明的一个实施例,所述计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度,包括:According to an embodiment of the present invention, the calculating the similarity between the movement trajectory corresponding to each object ID and the reference movement trajectory includes:
针对每一对象ID对应的移动轨迹,依据该移动轨迹与参考移动轨迹确定数据属性对和数据属性总和N,计算数据属性对的数量与所述N的比值,依据所述比值确定该移动轨迹与参考移动轨迹之间的相似度;For the movement track corresponding to each object ID, determine the data attribute pair and the data attribute sum N according to the movement track and the reference movement track, calculate the ratio of the number of data attribute pairs to the N, and determine the movement track and the N according to the ratio. The similarity between the reference movement trajectories;
其中,每对数据属性对中的一个数据属性所包括的数据源位置信息处于该移动轨迹中,另一数据属性所包括的数据源位置信息处于参考移动轨迹中,每对数据属性对中的时间信息的差值小于等于指定时间信息,每对数据属性对中的数据源位置信息对应的区域标识相同;所述数据属性总和为移动轨迹、参考移动轨迹中每一数据源位置信息所处的数据属性的数量之和。Wherein, the data source location information included in one data attribute in each pair of data attributes is in the movement track, the data source location information included in the other data attribute is in the reference movement track, and the time of each pair of data attributes is in the movement track. The difference value of the information is less than or equal to the specified time information, and the region identifiers corresponding to the data source location information in each pair of data attribute pairs are the same; the sum of the data attributes is the movement track and the data where the position information of each data source in the reference movement track is located. The sum of the number of attributes.
本发明第二方面提供一种轨迹确定装置,包括:A second aspect of the present invention provides a trajectory determination device, comprising:
数据属性提取模块,用于从不同数据源提取数据属性,所述数据属性至少包括:对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息;A data attribute extraction module, used for extracting data attributes from different data sources, the data attributes at least include: the object identification ID of the object, the time information of the collected object, and the location information of the data source;
数据属性存储模块,用于将提取的每一数据属性存储至指定数据存储系统;a data attribute storage module for storing each extracted data attribute to a specified data storage system;
移动轨迹生成模块,用于接收外部输入的查询条件,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。The movement trajectory generation module is used for receiving externally input query conditions, and according to the query conditions, from the designated data storage system to query the target data attributes that satisfy the query conditions, according to the time in the target data attributes including the same object ID The information sorts the data source location information in the target data attribute including the same object ID to obtain a movement track corresponding to the object ID.
根据本发明的一个实施例,所述指定数据存储系统中存储的每一数据属性具有对应的索引,数据属性对应的索引包括数据属性包含的时间信息;According to an embodiment of the present invention, each data attribute stored in the designated data storage system has a corresponding index, and the index corresponding to the data attribute includes time information contained in the data attribute;
所述查询条件包括:目标时间段;所述移动轨迹生成模块包括:The query conditions include: target time period; the movement trajectory generation module includes:
目标索引查询单元,用于依据所述目标时间段在指定数据存储系统中查询目标索引,所述目标索引中的时间信息处于所述目标时间段内;a target index query unit, configured to query a target index in a specified data storage system according to the target time period, and the time information in the target index is within the target time period;
参考数据属性确定单元,用于将所述目标索引对应的数据属性确定为参考数据属性;a reference data attribute determining unit, configured to determine the data attribute corresponding to the target index as a reference data attribute;
目标数据属性确定单元,用于从各参考数据属性中确定出目标数据属性。The target data attribute determining unit is used for determining the target data attribute from each reference data attribute.
根据本发明的一个实施例,所述目标数据属性确定单元包括:According to an embodiment of the present invention, the target data attribute determination unit includes:
选择子单元,用于从各参考数据属性包含的对象ID中选择目标对象ID,其中,所有参考数据属性中包含所述目标对象ID的参考数据属性的数量大于预设数量;A selection subunit for selecting a target object ID from the object IDs included in each reference data attribute, wherein the number of reference data attributes that include the target object ID in all reference data attributes is greater than a preset number;
拉取子单元,用于采用Scroll方式从所述指定数据存储系统拉取包含所述目标对象ID的参考数据属性作为所述目标数据属性。The pulling subunit is used for pulling the reference data attribute including the target object ID from the designated data storage system in the scroll mode as the target data attribute.
根据本发明的一个实施例,所述指定数据存储系统中包括至少两个索引存储段,每个索引存储段具有对应的时间段,每个索引存储段用于存储时间信息处于对应时间段内的索引;According to an embodiment of the present invention, the designated data storage system includes at least two index storage segments, each index storage segment has a corresponding time segment, and each index storage segment is used to store time information within the corresponding time segment. index;
所述目标索引查询单元包括:The target index query unit includes:
索引存储段确定子单元,用于从所述指定数据存储系统中确定目标索引存储段,所述目标索引存储段对应的时间段与所述目标时间段存在交集;an index storage segment determination subunit, configured to determine a target index storage segment from the specified data storage system, and the time segment corresponding to the target index storage segment has an intersection with the target time segment;
目标索引查询子单元,用于从所述目标索引存储段中查询所述目标索引。A target index query subunit, configured to query the target index from the target index storage segment.
根据本发明的一个实施例,According to an embodiment of the present invention,
该装置还进一步包括:The device further includes:
相似度计算模块,用于获取外部输入的参考对象ID,确定所述参考对象ID对应的参考移动轨迹,计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度;A similarity calculation module, used to obtain the reference object ID input from the outside, determine the reference movement track corresponding to the reference object ID, and calculate the similarity between the movement track corresponding to each object ID and the reference movement track;
移动轨迹选取模块,用于从各对象ID对应的移动轨迹中选取与所述参考移动轨迹的相似度最大的至少一个移动轨迹。A movement trajectory selection module, configured to select at least one movement trajectory with the greatest similarity to the reference movement trajectory from the movement trajectories corresponding to each object ID.
根据本发明的一个实施例,所述相似度计算模块包括:According to an embodiment of the present invention, the similarity calculation module includes:
相似度计算单元,用于针对每一对象ID对应的移动轨迹,依据该移动轨迹与参考移动轨迹确定数据属性对和数据属性总和N,计算数据属性对的数量与所述N的比值,依据所述比值确定该移动轨迹与参考移动轨迹之间的相似度;The similarity calculation unit is used to determine the data attribute pair and the data attribute sum N according to the movement trajectory and the reference movement trajectory for the movement trajectory corresponding to each object ID, calculate the ratio of the number of data attribute pairs and the N, according to the The ratio determines the similarity between the movement trajectory and the reference movement trajectory;
其中,每对数据属性对中的一个数据属性所包括的数据源位置信息处于该移动轨迹中,另一数据属性所包括的数据源位置信息处于参考移动轨迹中,每对数据属性对中的时间信息的差值小于等于指定时间信息,每对数据属性对中的数据源位置信息对应的区域标识相同;所述数据属性总和为移动轨迹、参考移动轨迹中每一数据源位置信息所处的数据属性的数量之和。Wherein, the data source location information included in one data attribute in each pair of data attributes is in the movement track, the data source location information included in the other data attribute is in the reference movement track, and the time of each pair of data attributes is in the movement track. The difference value of the information is less than or equal to the specified time information, and the region identifiers corresponding to the data source location information in each pair of data attribute pairs are the same; the sum of the data attributes is the movement track and the data where the position information of each data source in the reference movement track is located. The sum of the number of attributes.
本发明第三方面提供一种电子设备,包括处理器及存储器;所述存储器存储有可被处理器调用的程序;其中,所述处理器执行所述程序时,实现如前述实施例所述的轨迹确定方法。A third aspect of the present invention provides an electronic device, including a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the above-described embodiments are implemented. trajectory determination method.
本发明第四方面提供一种机器可读存储介质,其上存储有程序,该程序被处理器执行时,实现如前述实施例所述的轨迹确定方法。A fourth aspect of the present invention provides a machine-readable storage medium on which a program is stored, and when the program is executed by a processor, implements the trajectory determination method described in the foregoing embodiments.
本发明实施例具有以下有益效果:The embodiment of the present invention has the following beneficial effects:
本发明实施例中,将从不同数据源提取的数据属性存储在指定数据存储系统中,在收到外部输入的查询条件时,可从指定数据存储系统中查找出的目标数据属性,对同一对象ID的目标数据属性中的位置信息按照时间信息排序可生成该对象ID对应的移动轨迹,由于数据源在场景中的位置信息已知,当数据源采集到对象时,说明对象路过了该数据源,所以该数据源的位置信息可视作对象的一个轨迹点,实现了利用数据源的位置信息来生成对象的移动轨迹,可适用于园区等没有GPS数据接收设备的场景。In this embodiment of the present invention, data attributes extracted from different data sources are stored in a designated data storage system. When receiving externally input query conditions, the target data attributes can be searched out from the designated data storage system. The position information in the target data attribute of the ID can be sorted according to the time information to generate the movement trajectory corresponding to the object ID. Since the position information of the data source in the scene is known, when the data source collects the object, it means that the object has passed the data source. , so the location information of the data source can be regarded as a trajectory point of the object, which realizes the use of the location information of the data source to generate the movement trajectory of the object, which can be applied to scenarios such as parks without GPS data receiving equipment.
附图说明Description of drawings
图1是本发明一实施例的轨迹确定方法的流程示意图;1 is a schematic flowchart of a method for determining a trajectory according to an embodiment of the present invention;
图2是本发明一实施例的轨迹确定装置的结构框图;2 is a structural block diagram of a trajectory determination device according to an embodiment of the present invention;
图3是本发明一实施例的电子设备的结构框图。FIG. 3 is a structural block diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with some aspects of the invention as recited in the appended claims.
在本发明使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the present invention is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in this specification and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本发明可能采用术语第一、第二、第三等来描述各种器件,但这些信息不应限于这些术语。这些术语仅用来将同一类型的器件彼此区分开。例如,在不脱离本发明范围的情况下,第一器件也可以被称为第二器件,类似地,第二器件也可以被称为第一器件。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used herein to describe various devices, this information should not be limited by these terms. These terms are only used to distinguish devices of the same type from one another. For example, a first device could be termed a second device, and similarly, a second device could be termed a first device, without departing from the scope of the present invention. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determining."
为了使得本发明的描述更清楚简洁,下面对本发明中的一些技术术语进行解释:In order to make the description of the present invention clearer and concise, some technical terms in the present invention are explained below:
ES:全称为ElasticSearch,它是一个开源的、实时的分布式搜索及分析引擎,Elasticsearch中的索引是非关系型数据库,用于存储数据。ES: The full name is ElasticSearch. It is an open source, real-time distributed search and analysis engine. The index in Elasticsearch is a non-relational database for storing data.
LCSS:全称为Longest-Common-Subsequence,最长公共子序列算法。LCSS: The full name is Longest-Common-Subsequence, the longest common subsequence algorithm.
Kafka:一种高吞吐量、分布式发布订阅消息系统。Kafka: A high-throughput, distributed publish-subscribe messaging system.
Scroll方式:在ElasticSearch中一种用于进行大规模数据遍历的方式,类似于数据库的游标,遍历速度要明显快于分页方式。Scroll method: A method used for large-scale data traversal in ElasticSearch, similar to the cursor of the database, and the traversal speed is significantly faster than the paging method.
下面对本发明实施例的轨迹确定方法进行更具体的描述,但不应以此为限。The method for determining a trajectory according to the embodiment of the present invention will be described in more detail below, but it should not be limited thereto.
本发明实施例的轨迹确定方法可以用在园区等封闭式场景中,这些场景的固定点位上原本就设置有用于采集对象的采集设备,当采集设备采集到对象时,会生成相应的数据属性,可用采集到同一对象的不同采集设备的位置信息生成该对象的轨迹,充分利用了园区、停车场、交通路段等场景中的旧有资源,也无需任何与GPS相关设备的参与。The trajectory determination method of the embodiment of the present invention can be used in closed scenes such as parks. In these scenes, a collection device for collecting objects is originally set at a fixed point. When the collection device collects an object, it will generate corresponding data attributes. , the trajectory of the object can be generated by the location information of different collection devices that have collected the same object, making full use of the old resources in the park, parking lot, traffic section and other scenes, and without the participation of any GPS-related equipment.
以园区为例,园区是当前社会组织生产办公最常见的地域范畴,随着智慧城市建设的不断深入,“智慧园区”这一理念也进入了公众的视野,各种形式的园区数量呈现爆发式增长,并且近年来视频监控技术的不断发展以及人们安防意识的不断提高,对园区监控的应用也不断增加。Taking parks as an example, parks are the most common geographical category for production and office work by social organizations. With the continuous deepening of smart city construction, the concept of "smart parks" has also entered the public's field of vision, and the number of parks in various forms has exploded. In recent years, with the continuous development of video surveillance technology and the continuous improvement of people's security awareness, the application of park monitoring has also continued to increase.
园区中一般没有接收用户通过手机发送的GPS数据的设备,无法实现基于用户上报的GPS数据生成用户的轨迹,为了保证园区的安全性,园区中通常会设置比如门禁设备、人脸抓拍相机、视频监控设备等采集设备,这些设备通常具有固定的点位,即设备的位置信息固定不变,本发明实施例中将采集到对象的设备的位置信息作为对象出现过的一个轨迹点,生成对象的移动轨迹。Generally, there is no device in the park to receive the GPS data sent by the user through the mobile phone, and it is impossible to generate the user's trajectory based on the GPS data reported by the user. Monitoring equipment and other acquisition equipment, these equipment usually have fixed points, that is, the location information of the equipment is fixed. movement track.
在一个实施例中,参看图1,一种轨迹确定方法,包括以下步骤:In one embodiment, referring to FIG. 1, a trajectory determination method includes the following steps:
S100:从不同数据源提取数据属性,所述数据属性至少包括:对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息;S100: Extract data attributes from different data sources, where the data attributes at least include: the object identification ID of the object, the time information of the collected object, and the location information of the data source;
S200:将提取的每一数据属性存储至指定数据存储系统;S200: Store each extracted data attribute in a designated data storage system;
S300:接收外部输入的查询条件,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。S300: Receive an externally input query condition, query the specified data storage system for a target data attribute that satisfies the query condition according to the query condition, and search the target data attribute including the same object ID according to the time information in the target data attribute including the same object ID. The data source location information in the target data attribute of the same object ID is sorted to obtain the movement track corresponding to the object ID.
本发明实施例的轨迹确定方法的执行主体可以为电子设备,比如可以是计算机设备组成的服务器,计算机设备的性能可根据需要进行配置。The execution body of the trajectory determination method in the embodiment of the present invention may be an electronic device, for example, a server composed of a computer device, and the performance of the computer device may be configured as required.
步骤S100中,从不同数据源提取数据属性,所述数据属性至少包括:对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息。In step S100, data attributes are extracted from different data sources, and the data attributes at least include: the object identification ID of the object, the time information when the object is collected, and the location information of the data source.
数据源比如是园区等封闭式场景中的采集设备,采集设备可以包括门禁设备、人脸抓拍相机、视频监控设备等,具体有门禁读卡器、摄像头等。由于数据源在场景中有固定的点位,因而数据源的位置信息可以预先配置在数据源中,数据源在采集到对象时会生成相应的数据,可从其中提取出数据属性。For example, the data source is the collection equipment in the closed scene such as the park. The collection equipment can include access control equipment, face capture cameras, video monitoring equipment, etc., specifically, access control card readers, cameras, etc. Since the data source has fixed points in the scene, the location information of the data source can be pre-configured in the data source, and the data source will generate corresponding data when the object is collected, and the data attributes can be extracted from it.
不同数据源的数据格式有可能是不同的,换言之,不同数据源产生的数据可能是异构数据,可通过Kafka来从这些异构数据中提取所需的数据属性。数据属性至少包括对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息,当然,具体也不限于此,根据需要还可包括更多信息。The data formats of different data sources may be different. In other words, the data generated by different data sources may be heterogeneous data, and the required data attributes can be extracted from these heterogeneous data through Kafka. The data attribute includes at least the object identification ID of the object, the time information when the object is collected, and the location information of the data source. Of course, it is not limited to this, and more information may be included as needed.
对象可以指人、机动车、非机动车等,对象ID用于表征该对象,以人为例,对象ID可以为人的姓名、身份证号等,具体不限于此。时间信息可以包括指示年、月、日、时、分、秒的信息。数据源的位置信息可以是数据源在场景中的点位标识,或者可以是地理位置。The object may refer to a person, a motor vehicle, a non-motor vehicle, etc. The object ID is used to represent the object. Taking a person as an example, the object ID may be the person's name, ID number, etc., but is not limited to this. The time information may include information indicating year, month, day, hour, minute, and second. The location information of the data source may be a point identification of the data source in the scene, or may be a geographic location.
数据源采集到对象,说明该对象路过了该数据源,因而可以该数据源的位置信息可以视作该对象当时的位置信息,通过采集到同一对象的不同数据源的位置信息可构建出该对象的移动轨迹。The object is collected by the data source, indicating that the object has passed the data source, so the location information of the data source can be regarded as the location information of the object at that time, and the object can be constructed by collecting the location information of different data sources of the same object. movement trajectory.
步骤S200中,将提取的每一数据属性存储至指定数据存储系统。In step S200, each extracted data attribute is stored in a designated data storage system.
指定数据存储系统优选为ES,可实现分布式环境下的数据存取,当然此处只是举例,也可以是其他数据存储系统。一种方式中,通过Kafka从数据源提取数据属性后,可批量地将数据属性发往ES,实现对数据属性的及时、快速存储。The specified data storage system is preferably ES, which can realize data access in a distributed environment. Of course, this is just an example, and other data storage systems may also be used. In one way, after extracting data attributes from the data source through Kafka, the data attributes can be sent to ES in batches to realize timely and fast storage of data attributes.
在将数据属性存储到ES中时,可在ES中为数据属性分配索引,后续可根据数据属性的索引来查询数据属性。将数据属性存储在ES中,可实现数据属性的快速存储,可应对大规模数据量的场景,进而保证提取轨迹的效率。When the data attribute is stored in the ES, an index can be assigned to the data attribute in the ES, and the data attribute can be subsequently queried according to the index of the data attribute. Storing data attributes in ES can realize fast storage of data attributes, and can cope with large-scale data volume scenarios, thereby ensuring the efficiency of trajectory extraction.
步骤S300中,接收外部输入的查询条件,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。In step S300, the query condition input from the outside is received, the target data attribute that satisfies the query condition is queried from the specified data storage system according to the query condition, and the target data attribute including the same object ID is queried according to the time information in the target data attribute. The data source position information in the target data attribute including the same object ID is sorted to obtain the movement track corresponding to the object ID.
查询条件可以是外部输入的查询请求中携带的,依据查询条件可查询出所需的数据属性,比如是查询出一段时间内的数据属性,或者可以查询出某些对象ID对应的数据属性,等等。The query conditions can be carried in the externally input query request. According to the query conditions, the required data attributes can be queried, for example, the data attributes within a period of time can be queried, or the data attributes corresponding to certain object IDs can be queried, etc. Wait.
利用查询出的目标数据属性生成目标数据属性中同一对象ID对应的移动轨迹,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。The movement track corresponding to the same object ID in the target data attribute is generated by using the queried target data attribute, and the data source location information in the target data attribute including the same object ID is calculated according to the time information in the target data attribute including the same object ID. Sort to get the movement track corresponding to the object ID.
同一对象ID的目标数据属性中的位置信息处于同一条移动轨迹中,并且这些位置信息按照时间信息的先后顺序。顺序可以是从早到晚、或者从晚到早的顺序,具体顺序不限。The position information in the target data attribute of the same object ID is in the same movement track, and the position information is in the order of time information. The order may be from morning to night, or from late to early, and the specific order is not limited.
每一对象ID对应的移动轨迹可作为该对象ID所标识的对象的移动轨迹,如此,实现了利用数据源的位置信息来生成对象的移动轨迹。The movement track corresponding to each object ID can be used as the movement track of the object identified by the object ID. In this way, the position information of the data source is used to generate the movement track of the object.
本发明实施例中,将从不同数据源提取的数据属性存储在指定数据存储系统中,在收到外部输入的查询条件时,可从指定数据存储系统中查找出的目标数据属性,对同一对象ID的目标数据属性中的位置信息按照时间信息排序可生成该对象ID对应的移动轨迹,由于数据源在场景中的位置信息已知,当数据源采集到对象时,说明对象路过了该数据源,所以该数据源的位置信息可视作对象的一个轨迹点,实现了利用数据源的位置信息来生成对象的移动轨迹,可适用于园区等没有GPS数据接收设备的场景。In this embodiment of the present invention, data attributes extracted from different data sources are stored in a designated data storage system. When receiving externally input query conditions, the target data attributes can be searched out from the designated data storage system. The position information in the target data attribute of the ID can be sorted according to the time information to generate the movement trajectory corresponding to the object ID. Since the position information of the data source in the scene is known, when the data source collects the object, it means that the object has passed the data source. , so the location information of the data source can be regarded as a trajectory point of the object, which realizes the use of the location information of the data source to generate the movement trajectory of the object, which can be applied to scenarios such as parks without GPS data receiving equipment.
在一个实施例中,所述指定数据存储系统中存储的每一数据属性具有对应的索引,数据属性对应的索引包括数据属性包含的时间信息;In one embodiment, each data attribute stored in the specified data storage system has a corresponding index, and the index corresponding to the data attribute includes time information contained in the data attribute;
所述查询条件包括:目标时间段;步骤S300中,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,包括:The query conditions include: a target time period; in step S300, query the specified data storage system for target data attributes that satisfy the query conditions according to the query conditions, including:
S301:依据所述目标时间段在指定数据存储系统中查询目标索引,所述目标索引中的时间信息处于所述目标时间段内;S301: query a target index in a specified data storage system according to the target time period, where the time information in the target index is within the target time period;
S302:将所述目标索引对应的数据属性确定为参考数据属性;S302: Determine the data attribute corresponding to the target index as a reference data attribute;
S303:从各参考数据属性中确定出目标数据属性。S303: Determine the target data attribute from each reference data attribute.
查询条件比如为:start_time<time<end_time;start_time为目标时间段的起始时间,end_time为目标时间段的结束时间。For example, the query condition is: start_time<time<end_time; start_time is the start time of the target time period, and end_time is the end time of the target time period.
如此,依据查询条件可以找出时间信息处于起始时间到结束时间的这一目标时间段中的索引,可以通过遍历指定数据存储系统中的所有索引来找出目标索引,比如,判断遍历到的索引中的时间信息是否处于目标时间段,如果是,则遍历到的索引为目标索引。In this way, according to the query conditions, the index whose time information is in the target time period from the start time to the end time can be found, and the target index can be found by traversing all the indexes in the specified data storage system, for example, judging the traversed Whether the time information in the index is in the target time period, if so, the traversed index is the target index.
将目标索引对应的数据属性确定为参考数据属性,可以对参考数据属性再进一步进行筛选,从各参考数据属性中确定出更符合需要的目标数据属性。当然,也可以直接将目标索引对应的数据属性确定为目标数据属性。利用索引来查询数据属性,查询速率更快。The data attribute corresponding to the target index is determined as the reference data attribute, and the reference data attribute can be further screened, and the target data attribute that is more suitable for the needs can be determined from each reference data attribute. Of course, the data attribute corresponding to the target index can also be directly determined as the target data attribute. Using the index to query data attributes, the query speed is faster.
在一个实施例中,步骤S303中,从所述参考数据属性中确定出目标数据属性,包括:In one embodiment, in step S303, the target data attribute is determined from the reference data attribute, including:
S3031:从各参考数据属性包含的对象ID中选择目标对象ID,其中,所有参考数据属性中包含所述目标对象ID的参考数据属性的数量大于预设数量;S3031: Select a target object ID from the object IDs included in each reference data attribute, wherein the number of reference data attributes including the target object ID in all reference data attributes is greater than a preset number;
S3032:采用Scroll方式从所述指定数据存储系统拉取包含所述目标对象ID的参考数据属性作为所述目标数据属性。S3032: Pull a reference data attribute including the target object ID from the designated data storage system in a scroll manner as the target data attribute.
步骤S3031中,预设数量可以根据情况而定,以预设数量为1为例,如果同一对象ID的参考数据属性的数量只有1条,那么该对象ID就不是目标对象ID,如果同一对象ID的参考数据属性的数量大于1条,那么该对象ID是目标对象ID。In step S3031, the preset number can be determined according to the situation. Taking the preset number of 1 as an example, if the number of reference data attributes of the same object ID is only 1, then the object ID is not the target object ID. If the same object ID The number of reference data attributes is greater than 1, then the object ID is the target object ID.
选择目标对象ID的操作可控制由指定数据存储系统来执行,舍弃同一对象ID的参考数据属性条数较少的参考数据属性,减少从指定数据存储系统中真正拉取的数据属性条数,可以减少服务器所需的处理量。The operation of selecting the target object ID can be controlled to be performed by the specified data storage system. The reference data attributes with fewer reference data attributes of the same object ID are discarded, and the number of data attributes actually pulled from the specified data storage system can be reduced. Reduce the amount of processing required by the server.
步骤S3032中,确定出目标对象ID后,可以采用Scroll方式进行数据拉取,将包含所述目标对象ID的参考数据属性拉取到服务器中作为目标数据属性。In step S3032, after the target object ID is determined, the data can be pulled in the scroll mode, and the reference data attribute including the target object ID is pulled to the server as the target data attribute.
采用Scroll方式拉取数据,可以避免深度分页问题,非常适合数据量较大的情况。当然,在数据拉取完成之后,可将服务器中用于实现Scroll功能的内存数据删除,以避免占用内存。Using the Scroll method to pull data can avoid the problem of deep paging, which is very suitable for situations with large amounts of data. Of course, after the data pull is completed, the memory data used to implement the Scroll function in the server can be deleted to avoid occupying memory.
在一个实施例中,所述指定数据存储系统中包括至少两个索引存储段,每个索引存储段具有对应的时间段,每个索引存储段用于存储时间信息处于对应时间段内的索引;In one embodiment, the designated data storage system includes at least two index storage segments, each index storage segment has a corresponding time segment, and each index storage segment is used to store an index whose time information is within the corresponding time segment;
步骤S301中,依据所述目标时间段在指定数据存储系统中查询目标索引,包括:In step S301, query the target index in the specified data storage system according to the target time period, including:
S3011:从所述指定数据存储系统中确定目标索引存储段,所述目标索引存储段对应的时间段与所述目标时间段存在交集;S3011: Determine a target index storage segment from the specified data storage system, where a time segment corresponding to the target index storage segment and the target time segment have an intersection;
S3012:从所述目标索引存储段中查询所述目标索引。S3012: Query the target index from the target index storage segment.
为了防止数据过多造成单个数据属性索引性能下降的问题,可以每隔一段时间比如7天建立一个新的索引存储段(可分布在多个分片上),将最新获取到的数据属性存储到新的索引存储段中,这样能最大限度地存储数据并提升性能。In order to prevent the performance of a single data attribute index from being degraded due to excessive data, you can create a new index storage segment (which can be distributed on multiple shards) at regular intervals, such as 7 days, and store the newly acquired data attributes in the new index storage segment. , which maximizes data storage and improves performance.
每个索引存储段具有对应的时间段,可以存储对应时间段内获取到的数据属性,根据时间段来确定数据属性所在的索引存储段。Each index storage segment has a corresponding time segment, which can store the data attributes obtained in the corresponding time segment, and the index storage segment where the data attribute is located is determined according to the time segment.
步骤S3011中,可以根据目标时间段从所述指定数据存储系统中确定目标索引存储段。In step S3011, the target index storage segment may be determined from the specified data storage system according to the target time period.
比如,一个索引存储段对应的时间段为2018-08-28-00到2018-09-04-00(该索引存储段中存储了这段时间段内获取到的数据属性),如果目标时间段为2018-08-30-00到2018-09-06-00,那么该索引存储段为目标索引段。当然,还可找出另一目标索引存储段,该另一目标索引存储段对应的时间段为2018-09-04-00到2018-09-11-00,从而可以找出指定数据存储系统中所有对应时间段与目标时间段有交集的目标索引存储段。For example, the time period corresponding to an index storage segment is 2018-08-28-00 to 2018-09-04-00 (the index storage segment stores the data attributes obtained during this time period), if the target time period From 2018-08-30-00 to 2018-09-06-00, the index storage segment is the target index segment. Of course, another target index storage segment can also be found, and the time period corresponding to the other target index storage segment is 2018-09-04-00 to 2018-09-11-00, so that the specified data storage system can be found. All target index buckets whose corresponding time period intersects with the target time period.
步骤S3012中,从所述目标索引存储段中查询所述目标索引。可以遍历每个目标索引存储段中的每个目标索引,判断遍历到的索引中的时间信息是否处于目标时间段,如果是,则遍历到的索引为目标索引。In step S3012, the target index is queried from the target index storage segment. Each target index in each target index storage segment can be traversed to determine whether the time information in the traversed index is in the target time period, and if so, the traversed index is the target index.
在一个实施例中,该方法还进一步包括以下步骤:In one embodiment, the method further comprises the following steps:
S400:获取外部输入的参考对象ID,确定所述参考对象ID对应的参考移动轨迹,计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度;S400: Obtain an externally input reference object ID, determine a reference movement track corresponding to the reference object ID, and calculate the similarity between the movement track corresponding to each object ID and the reference movement track;
S500:从各对象ID对应的移动轨迹中选取与所述参考移动轨迹的相似度最大的至少一个移动轨迹。S500: Select at least one movement trajectory with the greatest similarity to the reference movement trajectory from the movement trajectories corresponding to each object ID.
步骤S400和S500可以在步骤S300之后执行。Steps S400 and S500 may be performed after step S300.
参考对象ID可以是各对象ID(即确定了移动轨迹的对象的对象ID)中的一个,此时,可以参考对象ID对应的参考移动轨迹可以从各对象ID对应的移动轨迹中获取;当然,参考对象ID也可以是其他对象的对象ID,此时,参考对象ID可以从本地预设的移动轨迹中获取。The reference object ID can be one of each object ID (that is, the object ID of the object whose movement track is determined), and at this time, the reference movement track corresponding to the reference object ID can be obtained from the movement track corresponding to each object ID; of course, The reference object ID may also be the object ID of other objects. In this case, the reference object ID may be obtained from a local preset movement track.
可以通过轨迹相似性算法来计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度,具体的轨迹相似性算法不限,比如是LCSS算法等。The similarity between the movement trajectory corresponding to each object ID and the reference movement trajectory can be calculated by a trajectory similarity algorithm, and the specific trajectory similarity algorithm is not limited, such as the LCSS algorithm.
计算出各对象ID对应的移动轨迹与参考移动轨迹的相似度后,从各对象ID对应的移动轨迹中选取与所述参考移动轨迹的相似度最大的至少一个移动轨迹。可以按照相似度从大到小的顺序对各移动轨迹进行排序,将靠前的M个移动轨迹作为目标移动轨迹,M可以是大于等于1的整数。After calculating the similarity between the movement trajectory corresponding to each object ID and the reference movement trajectory, at least one movement trajectory with the greatest similarity with the reference movement trajectory is selected from the movement trajectories corresponding to each object ID. The movement trajectories may be sorted in descending order of similarity, and the first M movement trajectories may be used as target movement trajectories, where M may be an integer greater than or equal to 1.
为了规范园区人员的出入管理,预防不法分子带来的不安全因素,对园区内的人员进行全天轨迹的追踪,精确掌握每个员工在园区内行动轨迹,并且根据目标人员的轨迹,寻找出相应的同行人,对于园区安全具有重要的意义。In order to regulate the entry and exit management of personnel in the park and prevent unsafe factors caused by criminals, track the trajectory of personnel in the park throughout the day, accurately grasp the movement trajectory of each employee in the park, and find out the trajectory of the target person according to the trajectory of the target person. Corresponding peers are of great significance to the safety of the park.
本实施例中,将选取出的移动轨迹成为目标移动轨迹,由于目标移动轨迹与参考移动轨迹相似度较高,因而可以认为目标移动轨迹对应的对象是参考移动轨迹对应的对象的同行对象,据此可进一步判断同行对象是否合法,保证园区等场景的安全性。In this embodiment, the selected movement trajectory is regarded as the target movement trajectory. Since the similarity between the target movement trajectory and the reference movement trajectory is relatively high, it can be considered that the object corresponding to the target movement trajectory is a peer object of the object corresponding to the reference movement trajectory. This can further determine whether the peers are legal and ensure the safety of scenarios such as parks.
步骤S400中,所述计算各对象ID对应的移动轨迹与参考移动轨迹之间的相似度,包括:In step S400, the calculation of the similarity between the movement trajectory corresponding to each object ID and the reference movement trajectory includes:
针对每一对象ID对应的移动轨迹,依据该移动轨迹与参考移动轨迹确定数据属性对和数据属性总和N,计算数据属性对的数量与所述N的比值,依据所述比值确定该移动轨迹与所述参考移动轨迹之间的相似度;For the movement track corresponding to each object ID, determine the data attribute pair and the data attribute sum N according to the movement track and the reference movement track, calculate the ratio of the number of data attribute pairs to the N, and determine the movement track and the N according to the ratio. similarity between the reference movement trajectories;
其中,每对数据属性对中的一个数据属性所包括的数据源位置信息处于该移动轨迹中,另一数据属性所包括的数据源位置信息处于参考移动轨迹中,每对数据属性对中的时间信息的差值小于等于指定时间信息,每对数据属性对中的数据源位置信息对应的区域标识相同;所述数据属性总和为移动轨迹、参考移动轨迹中每一数据源位置信息所处的数据属性的数量之和。Wherein, the data source location information included in one data attribute in each pair of data attributes is in the movement track, the data source location information included in the other data attribute is in the reference movement track, and the time of each pair of data attributes is in the movement track. The difference value of the information is less than or equal to the specified time information, and the region identifiers corresponding to the data source location information in each pair of data attribute pairs are the same; the sum of the data attributes is the movement track and the data where the position information of each data source in the reference movement track is located. The sum of the number of attributes.
依据该移动轨迹与参考移动轨迹确定数据属性对,其实就是确定该移动轨迹与参考移动轨迹的最长公共子序列。Determining the data attribute pair according to the movement trajectory and the reference movement trajectory is actually to determine the longest common subsequence of the movement trajectory and the reference movement trajectory.
假设该移动轨迹为X,参考移动轨迹为Y。解最长公共子序列问题时最容易想到的算法是穷举搜索法,即对X的每一个子序列,检查它是否也是Y的子序列,从而确定它是否为X和Y的公共子序列,并且在检查过程中选出最长的公共子序列。X和Y的所有子序列都检查过后,即可求出X和Y的最长公共子序列。Assume that the movement trajectory is X, and the reference movement trajectory is Y. The easiest algorithm to think of when solving the longest common subsequence problem is the exhaustive search method, that is, for each subsequence of X, check whether it is also a subsequence of Y, so as to determine whether it is a common subsequence of X and Y, And the longest common subsequence is selected during the inspection process. After all subsequences of X and Y have been checked, the longest common subsequence of X and Y can be found.
为了减少所需的计算量,可以采用LCSS算法来求出X和Y的最长公共子序列。设移动轨迹X=<x1,x2,…,xm>和Y=<y1,y2,…,yn>的一个最长公共子序列Z=<z1,z2,…,zk>,则LCSS算法中会有以下递归定义:In order to reduce the amount of computation required, the LCSS algorithm can be used to find the longest common subsequence of X and Y. Assuming that the movement trajectory X=<x1,x2,...,xm> and Y=<y1,y2,...,yn> a longest common subsequence Z=<z1,z2,...,zk>, then the LCSS algorithm will There are the following recursive definitions:
若xm=yn,则zk=xm=yn且Zk-1是Xm-1和Yn-1的最长公共子序列;If xm=yn, then zk=xm=yn and Zk-1 is the longest common subsequence of Xm-1 and Yn-1;
若xm≠yn且zk≠xm,则Z是Xm-1和Y的最长公共子序列;If xm≠yn and zk≠xm, then Z is the longest common subsequence of Xm-1 and Y;
若xm≠yn且zk≠yn,则Z是X和Yn-1的最长公共子序列。If xm≠yn and zk≠yn, then Z is the longest common subsequence of X and Yn-1.
其中,m为X的长度,n为Y的长度,k为Z的长度。Among them, m is the length of X, n is the length of Y, and k is the length of Z.
xm=yn表示xm与yn相似,xm≠yn表示xm与yn不相似,其他类似情况也是同理。本实施例中,自定义了LCSS算法中n什么情况下xm与yn相似,什么情况下xm与yn不相似。xm=yn means that xm is similar to yn, xm≠yn means that xm and yn are not similar, and the same is true for other similar situations. In this embodiment, in the LCSS algorithm, under which conditions xm and yn are similar, and under which conditions xm and yn are not similar, are customized.
以X中的位置信息xm、与Y中的位置信息yn为例来说,如果xm对应的区域标识与yn对应的区域标识相同,并且xm对应的时间信息与yn对应的时间信息相差不大于指定时间信息,那么xm与yn相似,即xm=yn,否则xm≠yn。指定时间信息比如是3分钟、5分钟等,当然具体取值并不限于此。Taking the position information xm in X and the position information yn in Y as an example, if the area identifier corresponding to xm is the same as the area identifier corresponding to yn, and the time information corresponding to xm and the time information corresponding to yn differ by no more than specified time information, then xm is similar to yn, that is, xm=yn, otherwise xm≠yn. The specified time information is, for example, 3 minutes, 5 minutes, etc., of course, the specific value is not limited to this.
区域标识也可以是从数据源中提取的,并被包含于数据属性中。每个数据源中可以预先配置有其所处区域的区域标识,处于同一区域的数据源的区域标识相同,比如在园区同一食堂中的数据源的区域标识相同。如果两个位置信息对应的区域标识相同,说明两个对象在同一块区域比如食堂出现过。The area identifier can also be extracted from the data source and included in the data attribute. Each data source may be pre-configured with the area identifier of the area where it is located, and the area identifiers of the data sources in the same area are the same, for example, the area identifiers of the data sources in the same canteen in the park are the same. If the area identifiers corresponding to the two location information are the same, it means that the two objects have appeared in the same area, such as a cafeteria.
基于以上定义,可以将问题视为动态规划类问题,构造一个矩阵C[m,n],并建立如下递归关系进行求解该矩阵:Based on the above definition, the problem can be regarded as a dynamic programming problem, a matrix C[m,n] is constructed, and the following recursive relationship is established to solve the matrix:
其中,i小于等于m,j小于等于n。Among them, i is less than or equal to m, and j is less than or equal to n.
根据上述递归关系求解出的C[m,n],X和Y的最长公共子序列的长度记录元素c[m,n]中,c[m,n]是矩阵C[m,n]中第m行第n列的元素。According to C[m,n] solved according to the above recursive relationship, the length of the longest common subsequence of X and Y is recorded in the element c[m,n], c[m,n] is the matrix C[m,n] in the length record element c[m,n] The element at row m and column n.
得到的X与Y的最长公共子序列的长度,即为依据该移动轨迹与参考移动轨迹确定出的数据属性对的数量。长度越长,则移动轨迹与参考移动轨迹的相似度越高。The obtained length of the longest common subsequence of X and Y is the number of data attribute pairs determined according to the movement track and the reference movement track. The longer the length, the higher the similarity between the movement trajectory and the reference movement trajectory.
本实施例中,考虑了采集设备采集到对象信息在时间上的间隔和各采集设备在空间上的距离,xm与yn对应的区域标识相同、且对应的时间信息相差不大时,xm与yn才相似,提高相似轨迹的查全率。In this embodiment, considering the time interval between the object information collected by the collection device and the spatial distance of each collection device, when the area identifiers corresponding to xm and yn are the same and the corresponding time information is not much different, xm and yn Only similar, improve the recall rate of similar trajectories.
接着,可计算数据属性对的数量与所述N的比值,依据所述比值确定该移动轨迹与所述参考移动轨迹之间的相似度,比如,可以将所述比值与预设值的乘积作为相似度。Next, the ratio of the number of data attribute pairs to the N can be calculated, and the similarity between the movement trajectory and the reference movement trajectory can be determined according to the ratio. For example, the product of the ratio and the preset value can be used as similarity.
以预设值为2为例,相似度的计算公式为:Taking the default value of 2 as an example, the calculation formula of similarity is:
S=2*(c[m,n])/(m+n)S=2*(c[m,n])/(m+n)
m为移动轨迹中各数据源位置信息所处的数据属性的数量,n为参考移动轨迹中每一数据源位置信息所处的数据属性的数量,m+n即为所述N。m is the number of data attributes where each data source location information is located in the movement track, n is the number of data attributes where each data source location information is located in the reference movement track, and m+n is the N.
下面通过一个具体的例子,来说明一下移动轨迹与参考移动轨迹之间的相似度的计算方式,假设指定时间信息为5分钟,移动轨迹X中,第一对象出现的时间信息及位置信息为:The following is a specific example to illustrate the calculation method of the similarity between the movement trajectory and the reference movement trajectory. Assuming that the specified time information is 5 minutes, in the movement trajectory X, the time information and position information of the first object appearing are:
2018-09-28 12:00:00 A,2018-09-28 12:00:00 A,
2018-09-28 12:10:00 B,2018-09-28 12:10:00 B,
2018-09-28 12:20:00 C;2018-09-28 12:20:00 C;
2018-09-28 12:30:00 E;2018-09-28 12:30:00 E;
参考移动轨迹Y中,参考对象出现的时间信息及位置信息为:In the reference movement track Y, the time information and position information of the reference object appearing are:
2018-09-28 12:00:00 A,2018-09-28 12:00:00 A,
2018-09-28 12:16:00 B,2018-09-28 12:16:00 B,
2018-09-28 12:20:00 D;2018-09-28 12:20:00 D;
2018-09-28 12:30:00 E;2018-09-28 12:30:00 E;
其中,A、B、C、D、E为位置信息,相似的位置信息为A与E,并且对应的时间信息是相同的,相应的,相似度为2*2/(3+3)=66%。Among them, A, B, C, D, E are location information, similar location information is A and E, and the corresponding time information is the same, correspondingly, the similarity is 2*2/(3+3)=66 %.
本发明还提供一种轨迹确定装置,参看图2,在一个实施例中,轨迹确定装置100包括:The present invention also provides a trajectory determination apparatus, referring to FIG. 2 , in one embodiment, the
数据属性提取模块101,用于从不同数据源提取数据属性,所述数据属性至少包括:对象的对象标识ID、采集到该对象的时间信息、数据源的位置信息;The data attribute
数据属性存储模块102,用于将提取的每一数据属性存储至指定数据存储系统;a data
移动轨迹生成模块103,用于接收外部输入的查询条件,依据所述查询条件从所述指定数据存储系统中查询满足所述查询条件的目标数据属性,按照包括同一对象ID的目标数据属性中的时间信息将所述包括同一对象ID的目标数据属性中的数据源位置信息进行排序得到与该对象ID对应的移动轨迹。The movement
在一个实施例中,所述指定数据存储系统中存储的每一数据属性具有对应的索引,数据属性对应的索引包括数据属性包含的时间信息;In one embodiment, each data attribute stored in the specified data storage system has a corresponding index, and the index corresponding to the data attribute includes time information contained in the data attribute;
所述查询条件包括:目标时间段;所述移动轨迹生成模块包括:The query conditions include: target time period; the movement trajectory generation module includes:
目标索引查询单元,用于依据所述目标时间段在指定数据存储系统中查询目标索引,所述目标索引中的时间信息处于所述目标时间段内;a target index query unit, configured to query a target index in a specified data storage system according to the target time period, and the time information in the target index is within the target time period;
参考数据属性确定单元,用于将所述目标索引对应的数据属性确定为参考数据属性;a reference data attribute determining unit, configured to determine the data attribute corresponding to the target index as a reference data attribute;
目标数据属性确定单元,用于从各参考数据属性中确定出目标数据属性。The target data attribute determining unit is used for determining the target data attribute from each reference data attribute.
在一个实施例中,所述目标数据属性确定单元包括:In one embodiment, the target data attribute determination unit includes:
选择子单元,用于从各参考数据属性包含的对象ID中选择目标对象ID,其中,所有参考数据属性中包含所述目标对象ID的参考数据属性的数量大于预设数量;A selection subunit for selecting a target object ID from the object IDs included in each reference data attribute, wherein the number of reference data attributes that include the target object ID in all reference data attributes is greater than a preset number;
拉取子单元,用于采用Scroll方式从所述指定数据存储系统拉取包含所述目标对象ID的参考数据属性作为所述目标数据属性。The pulling subunit is used for pulling the reference data attribute including the target object ID from the designated data storage system in the scroll mode as the target data attribute.
在一个实施例中,所述指定数据存储系统中包括至少两个索引存储段,每个索引存储段具有对应的时间段,每个索引存储段用于存储时间信息处于对应时间段内的索引;In one embodiment, the designated data storage system includes at least two index storage segments, each index storage segment has a corresponding time segment, and each index storage segment is used to store an index whose time information is within the corresponding time segment;
所述目标索引查询单元包括:The target index query unit includes:
索引存储段确定子单元,用于从所述指定数据存储系统中确定目标索引存储段,所述目标索引存储段对应的时间段与所述目标时间段存在交集;an index storage segment determination subunit, configured to determine a target index storage segment from the specified data storage system, and the time segment corresponding to the target index storage segment has an intersection with the target time segment;
目标索引查询子单元,用于从所述目标索引存储段中查询所述目标索引。A target index query subunit, configured to query the target index from the target index storage segment.
在一个实施例中,In one embodiment,
该装置还进一步包括:The device further includes:
相似度计算模块,用于获取外部输入的参考对象ID,确定所述参考对象ID对应的参考移动轨迹,计算各对象ID对应的移动轨迹与所述参考移动轨迹之间的相似度;A similarity calculation module, used to obtain the reference object ID input from the outside, determine the reference movement track corresponding to the reference object ID, and calculate the similarity between the movement track corresponding to each object ID and the reference movement track;
移动轨迹选取模块,用于从各对象ID对应的移动轨迹中选取与所述参考移动轨迹的相似度最大的至少一个移动轨迹。A movement trajectory selection module, configured to select at least one movement trajectory with the greatest similarity to the reference movement trajectory from the movement trajectories corresponding to each object ID.
在一个实施例中,所述相似度计算模块包括:In one embodiment, the similarity calculation module includes:
相似度计算单元,用于针对每一对象ID对应的移动轨迹,依据该移动轨迹与参考移动轨迹确定数据属性对和数据属性总和N,计算数据属性对的数量与所述N的比值,依据所述比值确定该移动轨迹与参考移动轨迹之间的相似度;The similarity calculation unit is used to determine the data attribute pair and the data attribute sum N according to the movement trajectory and the reference movement trajectory for the movement trajectory corresponding to each object ID, calculate the ratio of the number of data attribute pairs and the N, according to the The ratio determines the similarity between the movement trajectory and the reference movement trajectory;
其中,每对数据属性对中的一个数据属性所包括的数据源位置信息处于该移动轨迹中,另一数据属性所包括的数据源位置信息处于参考移动轨迹中,每对数据属性对中的时间信息的差值小于等于指定时间信息,每对数据属性对中的数据源位置信息对应的区域标识相同;所述数据属性总和为移动轨迹、参考移动轨迹中每一数据源位置信息所处的数据属性的数量之和。Wherein, the data source location information included in one data attribute in each pair of data attributes is in the movement track, the data source location information included in the other data attribute is in the reference movement track, and the time of each pair of data attributes is in the movement track. The difference value of the information is less than or equal to the specified time information, and the region identifiers corresponding to the data source location information in each pair of data attribute pairs are the same; the sum of the data attributes is the movement track and the data where the position information of each data source in the reference movement track is located. The sum of the number of attributes.
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For details of the implementation process of the functions and functions of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method, which will not be repeated here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元。For the apparatus embodiments, since they basically correspond to the method embodiments, reference may be made to the partial descriptions of the method embodiments for related parts. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units.
本发明还提供一种电子设备,包括处理器及存储器;所述存储器存储有可被处理器调用的程序;其中,所述处理器执行所述程序时,实现如前述实施例中所述的轨迹确定方法。The present invention also provides an electronic device, including a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the trajectory described in the foregoing embodiments is implemented Determine the method.
本发明轨迹确定装置的实施例可以应用在电子设备上。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,图3是本发明根据一示例性实施例示出的轨迹确定装置100所在电子设备的一种硬件结构图,除了图3所示的处理器510、内存530、接口520、以及非易失性存储器540之外,实施例中装置100所在的电子设备通常根据该电子采集设备的实际功能,还可以包括其他硬件,对此不再赘述。The embodiments of the trajectory determination apparatus of the present invention can be applied to electronic equipment. Taking software implementation as an example, a device in a logical sense is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the processor of the electronic device where the device is located. From the perspective of hardware, as shown in FIG. 3 , FIG. 3 is a hardware structure diagram of the electronic device where the
本发明还提供一种机器可读存储介质,其上存储有程序,该程序被处理器执行时,实现如前述实施例中任意一项所述的轨迹确定方法。The present invention also provides a machine-readable storage medium on which a program is stored, and when the program is executed by a processor, implements the trajectory determination method described in any one of the foregoing embodiments.
本发明可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。机器可读存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。机器可读存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。The present invention may take the form of a computer program product embodied on one or more storage media having program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like. Machine-readable storage media includes both persistent and non-permanent, removable and non-removable media, and storage of information can be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of machine-readable storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage , magnetic tape cartridges, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910555349.4A CN112131325A (en) | 2019-06-25 | 2019-06-25 | Track determination method, device and equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910555349.4A CN112131325A (en) | 2019-06-25 | 2019-06-25 | Track determination method, device and equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN112131325A true CN112131325A (en) | 2020-12-25 |
Family
ID=73849566
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910555349.4A Pending CN112131325A (en) | 2019-06-25 | 2019-06-25 | Track determination method, device and equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112131325A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112925948A (en) * | 2021-02-05 | 2021-06-08 | 上海依图网络科技有限公司 | Video processing method and device, medium, chip and electronic equipment thereof |
| CN112948531A (en) * | 2021-04-02 | 2021-06-11 | 方正国际软件(北京)有限公司 | Massive track query method, retrieval server and system |
| CN113312360A (en) * | 2021-07-28 | 2021-08-27 | 阿里云计算有限公司 | Index establishing method, device, equipment, storage medium and computer program product |
| CN113421064A (en) * | 2021-06-30 | 2021-09-21 | 中国航空油料有限责任公司 | Control method, device, equipment and medium for aircraft refueling truck |
| CN115795115A (en) * | 2023-02-11 | 2023-03-14 | 云南师范大学 | Multi-track set similarity searching method based on graph storage |
| WO2023050785A1 (en) * | 2021-09-30 | 2023-04-06 | 京东城市(北京)数字科技有限公司 | Trajectory data processing method and apparatus, and computer device and storage medium |
| CN116824866A (en) * | 2023-08-29 | 2023-09-29 | 武汉中科通达高新技术股份有限公司 | Analysis methods, systems and media for accompanying vehicles based on time and geographical factors |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105006031A (en) * | 2015-06-18 | 2015-10-28 | 深圳市润安科技发展有限公司 | Supervisor motion trail inquiry method and system |
| CN105242882A (en) * | 2015-10-13 | 2016-01-13 | 东方网力科技股份有限公司 | Frame storage method and apparatus for timing data and query method and apparatus for timing data |
| CN109165215A (en) * | 2018-07-27 | 2019-01-08 | 苏州视锐信息科技有限公司 | Construction method, device and the electronic equipment of temporal index under a kind of cloud environment |
| CN109542997A (en) * | 2018-11-23 | 2019-03-29 | 成都四方伟业软件股份有限公司 | Motion profile display methods and device |
-
2019
- 2019-06-25 CN CN201910555349.4A patent/CN112131325A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105006031A (en) * | 2015-06-18 | 2015-10-28 | 深圳市润安科技发展有限公司 | Supervisor motion trail inquiry method and system |
| CN105242882A (en) * | 2015-10-13 | 2016-01-13 | 东方网力科技股份有限公司 | Frame storage method and apparatus for timing data and query method and apparatus for timing data |
| CN109165215A (en) * | 2018-07-27 | 2019-01-08 | 苏州视锐信息科技有限公司 | Construction method, device and the electronic equipment of temporal index under a kind of cloud environment |
| CN109542997A (en) * | 2018-11-23 | 2019-03-29 | 成都四方伟业软件股份有限公司 | Motion profile display methods and device |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112925948A (en) * | 2021-02-05 | 2021-06-08 | 上海依图网络科技有限公司 | Video processing method and device, medium, chip and electronic equipment thereof |
| CN112948531A (en) * | 2021-04-02 | 2021-06-11 | 方正国际软件(北京)有限公司 | Massive track query method, retrieval server and system |
| CN112948531B (en) * | 2021-04-02 | 2023-12-15 | 方正国际软件(北京)有限公司 | Massive track query method, retrieval server and system |
| CN113421064A (en) * | 2021-06-30 | 2021-09-21 | 中国航空油料有限责任公司 | Control method, device, equipment and medium for aircraft refueling truck |
| CN113312360A (en) * | 2021-07-28 | 2021-08-27 | 阿里云计算有限公司 | Index establishing method, device, equipment, storage medium and computer program product |
| CN113312360B (en) * | 2021-07-28 | 2022-01-04 | 阿里云计算有限公司 | Index establishing method, device, equipment, storage medium and computer program product |
| WO2023050785A1 (en) * | 2021-09-30 | 2023-04-06 | 京东城市(北京)数字科技有限公司 | Trajectory data processing method and apparatus, and computer device and storage medium |
| CN115795115A (en) * | 2023-02-11 | 2023-03-14 | 云南师范大学 | Multi-track set similarity searching method based on graph storage |
| CN115795115B (en) * | 2023-02-11 | 2023-05-02 | 云南师范大学 | Multi-track set similarity searching method based on graph storage |
| CN116824866A (en) * | 2023-08-29 | 2023-09-29 | 武汉中科通达高新技术股份有限公司 | Analysis methods, systems and media for accompanying vehicles based on time and geographical factors |
| CN116824866B (en) * | 2023-08-29 | 2024-01-02 | 武汉中科通达高新技术股份有限公司 | Analysis methods, systems and media for accompanying vehicles based on time and geographical factors |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112131325A (en) | Track determination method, device and equipment and storage medium | |
| US9542620B1 (en) | Locating persons of interest based on license plate recognition information | |
| US10446028B2 (en) | Parking identification and availability prediction | |
| US9542653B1 (en) | Vehicle prediction and association tool based on license plate recognition | |
| Zheng et al. | Detecting collective anomalies from multiple spatio-temporal datasets across different domains | |
| CN110334111B (en) | Multidimensional track analysis method and device | |
| CN103984710B (en) | Video interactive querying method and system based on mass data | |
| WO2021114615A1 (en) | Method, apparatus, and device for visualization of behavior risk identification, and storage medium | |
| CN111367956B (en) | Data statistics methods and devices | |
| CN107636649A (en) | The region analyzed by geographical photo tag models | |
| CN112925899A (en) | Ranking model establishing method, case clue recommending device and medium | |
| CN116483822A (en) | Service data early warning method, device, computer equipment and storage medium | |
| CN107749164B (en) | Vehicle aggregation analysis method and device | |
| CN112733049A (en) | Vehicle information display method and device | |
| US20180349496A1 (en) | Method for indexing of videodata for faceted classification | |
| CN112328649A (en) | Multi-track data similarity calculation method and storage device | |
| CN110322688A (en) | A kind of method of data processing, the method for data query and relevant device | |
| Wu et al. | GLUE: a parameter-tuning-free map updating system | |
| CN108804507A (en) | The address location determining method and system of user | |
| Bakkal et al. | Modeling and querying trajectories using Neo4j spatial and TimeTree for carpool matching | |
| US8849844B1 (en) | Image reacquisition | |
| CN112632058A (en) | Track determination method, device and equipment and storage medium | |
| CN106682168A (en) | Construction method of visual cross-region urban data query system | |
| CN116703132B (en) | Management method and device for dynamic scheduling of shared vehicles and computer equipment | |
| US20230306545A1 (en) | Predictive case solvability score system with action recommendations based on detected trends |
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 |