Data processing method, device, electronic device and machine-readable storage medium
By analyzing the trajectory sequence and public subsequent sequence of the object, other objects that have the same relationship with the specified object have been effectively determined, and the efficiency and accuracy of the determination of the peer relationship is improved.
Patent Information
- Application Number
- CN202011281663.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-16
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-11-16
AI Technical Summary
How to effectively determine other objects that have peer relationships with designated objects, especially in big data analysis.
By determining the trajectory sequence of each object, and based on the public sub -sequence between the trajectory sequence of the specified object and the trajectory sequence of other objects, other objects that exist with the specified objects are determined.
The efficiency and accuracy of peer relationship determination are improved, and misjudgments are reduced by eliminating objects that do not have common subsequences between trajectory sequences.
Smart Images

Figure CN114511816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a data processing method, device, electronic device and machine-readable storage medium. Background Art
[0002] Based on the image acquisition data of the designated person and the image acquisition data of other persons, the persons who have a peer relationship with the designated person are determined, which can assist in effective analysis of the movement trajectories of other persons who have a certain relationship with the designated person and the designated person from the perspective of big data.
[0003] How to determine other objects that have a peer relationship with a specified object has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the present application provides a data processing method, device, electronic device and machine-readable storage medium.
[0005] According to a first aspect of an embodiment of the present application, there is provided a data processing method, including:
[0006] Determine a trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of the image acquisition time;
[0007] Based on the trajectory sequence of the specified object and the trajectory sequences of other objects, respectively determining common subsequences of the trajectory sequence of the specified object and the trajectory sequences of each of the other objects;
[0008] Based on the common subsequences between the trajectory sequence of the specified object and the trajectory sequences of each other object, other objects that have a peer relationship with the specified object are determined.
[0009] According to a second aspect of an embodiment of the present application, there is provided a data processing device, including:
[0010] A first determining unit is configured to determine a trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of the image acquisition time;
[0011] A second determining unit is configured to determine, based on the trajectory sequence of the designated object and the trajectory sequences of the other objects, common subsequences of the trajectory sequence of the designated object and the trajectory sequences of the other objects respectively;
[0012] The third determining unit is configured to determine other objects that have a peer relationship with the designated object based on a common subsequence between the trajectory sequence of the designated object and the trajectory sequences of other objects.
[0013] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0014] Memory, used to store computer programs;
[0015] The processor is used to implement the data processing method of the first aspect when executing the program stored in the memory.
[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the data processing method of the first aspect is implemented.
[0017] According to a fifth aspect of an embodiment of the present application, a computer program is provided. The computer program is stored in a machine-readable storage medium, and when a processor executes the computer program, the processor is prompted to execute the data processing method of the first aspect.
[0018] The data processing method of the embodiment of the present application determines the trajectory sequence of each object, and based on the trajectory sequence of the specified object and the trajectory sequences of other objects, respectively determines the common subsequences of the trajectory sequence of the specified object and the trajectory sequences of each other object, and then, based on the common subsequences between the trajectory sequence of the specified object and the trajectory sequences of each other object, determines other objects that have a peer relationship with the specified object. By determining the common subsequences between the trajectory sequences of different objects and performing peer relationship determination based on the common subsequences between the trajectory sequences of different objects, objects that do not have a common subsequence between the trajectory sequences are eliminated when performing peer relationship determination, thereby improving the efficiency and accuracy of peer relationship determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a data processing method provided by an exemplary embodiment of the present application;
[0020] Figure 2 is a schematic diagram of an application scenario provided by an exemplary embodiment of the present application;
[0021] Figure 3 It is a flowchart of determining a common subsequence of a trajectory sequence of a specified object and a trajectory sequence of another object provided by an exemplary embodiment of the present application;
[0022] Figure 4A is a schematic diagram of a repeated acquisition scenario provided by an exemplary embodiment of the present application;
[0023] Figure 4Bis a schematic diagram of an overlapping acquisition scenario provided by an exemplary embodiment of the present application;
[0024] Figure 5 is a schematic diagram of a flow chart of determining a trajectory sequence of each object provided by an exemplary embodiment of the present application;
[0025] Figure 6 is a structural schematic diagram of a data processing device provided by an exemplary embodiment of the present application;
[0026] Figure 7 It is a schematic diagram of the hardware structure of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0028] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0029] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0030] See also Figure 1 , is a flow chart of a data processing method provided in an embodiment of the present application, such as Figure 1 As shown, the data processing method may include the following steps:
[0031] It should be noted that the serial numbers of the steps in the embodiments of the present application do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0032] Step S100, determining the trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, and the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of the image acquisition time.
[0033] In the embodiment of the present application, the object may include but is not limited to a person or a vehicle.
[0034] In the embodiments of the present application, unless otherwise specified, the image acquisition data mentioned refers to pictures that can be used to identify the identity information of the acquired object. For example, for a vehicle, the identity information may be the license plate number; for a person, the identity information may be the person information obtained through facial analysis, etc.
[0035] In an embodiment of the present application, considering that two objects with a peer relationship are usually captured by the same monitoring device at the same or similar time, therefore, in order to improve the efficiency and accuracy of determining a peer relationship, the peer relationship of the two objects can be determined based on the situation where the two objects are captured by the same monitoring device at the same or similar time.
[0036] In order to determine whether there are images of two objects captured by the same monitoring device at the same or similar time, the trajectory sequence of each object may be determined first.
[0037] Exemplarily, the trajectory sequence of each object may be determined based on the image acquisition data of each object.
[0038] For example, the trajectory sequence may represent that an image of a specific object is captured by a specific monitoring device at a specific time.
[0039] Exemplarily, a trajectory sequence may include one or more trajectory points, and any trajectory point includes a monitoring device identifier (the identifier of the monitoring device that captures the image of the corresponding object) and an image capture time (the time when the monitoring device captures the image of the object). The trajectory points in any trajectory sequence are arranged in order of image capture time, for example, in ascending or descending order of image capture time.
[0040] It should be noted that in an embodiment of the present application, when the number of trajectory points of an object determined based on the image acquisition data of the object is one, the trajectory sequence may not be determined, and the image acquisition data of the object may be filtered out when determining the peer relationship.
[0041] Step S110 : based on the trajectory sequence of the designated object and the trajectory sequences of other objects, respectively determine common subsequences of the trajectory sequence of the designated object and the trajectory sequences of other objects.
[0042] In the embodiment of the present application, the designated object does not specifically refer to a fixed object, but may refer to any object that has a trajectory sequence and requires peer relationship analysis, which will not be repeated later in the embodiment of the present application.
[0043] In an embodiment of the present application, when it is necessary to determine the peer relationship for a specified object, the common subsequences of the trajectory sequence of the specified object and the trajectory sequences of other objects (objects with trajectory sequences other than the specified object) can be determined respectively.
[0044] In one example, for any trajectory sequence of other objects, a common subsequence between the trajectory sequence of the other object and the trajectory sequence of the specified object may be determined based on an LCS (Longest Common Subsequence) algorithm.
[0045] Step S120: Determine other objects that have a peer relationship with the designated object based on the common subsequences between the trajectory sequence of the designated object and the trajectory sequences of other objects.
[0046] In an embodiment of the present application, when the common subsequence between the trajectory sequence of the specified object and the trajectory sequences of other objects is determined in the above manner, other objects that have a peer relationship with the specified object can be determined based on the determined common subsequence between the trajectory sequence of the specified object and the trajectory sequences of other objects.
[0047] For example, the trajectory sequences of other objects whose common subsequence lengths with the trajectory sequence of the specified object exceed a preset length threshold can be determined as the trajectory sequences of other objects that have a peer relationship with the specified object, and the other objects are peer objects of the specified object.
[0048] It can be seen that in Figure 1 In the illustrated method embodiment, by determining the trajectory sequence of each object, and based on the trajectory sequence of the designated object and the trajectory sequences of other objects, respectively determining the common subsequences of the trajectory sequence of the designated object and the trajectory sequences of each other object, and then based on the common subsequences between the trajectory sequence of the designated object and the trajectory sequences of each other object, by determining the common subsequences between the trajectory sequences of different objects, and performing peer relationship determination based on the common subsequences between the trajectory sequences of different objects, objects for which no common subsequences exist between the trajectory sequences are eliminated when performing peer relationship determination, thereby improving the efficiency and accuracy of peer relationship determination.
[0049] In one embodiment, for the trajectory sequence of any other object, the common trajectory points contained in the common subsequence of the other object and the specified object are the trajectory points shared by the trajectory sequence of the other object and the trajectory sequence of the specified object, and the order of the common trajectory points in the common subsequence is the same as the order of the common trajectory points in any original trajectory sequence.
[0050] Exemplarily, for any other object, the trajectory points in the common subsequence of the trajectory sequence of the other object and the trajectory sequence of the specified object should be trajectory points that both the other object and the specified object have passed through (i.e., images have been captured by the monitoring equipment contained in the trajectory points) and that have passed through in the same order (time order). Therefore, the common trajectory points contained in the common subsequence between the trajectory sequence of any other object and the trajectory sequence of the specified object are the trajectory points that are shared by the trajectory sequence of the other object and the trajectory sequence of the specified object, and the order of the common trajectory points in the common subsequence is the same as the order of the common trajectory points in any original trajectory sequence.
[0051] Among them, the common trajectory point may include two trajectory points with the same monitoring device identification and the same image acquisition time (including the same, or the difference does not exceed the preset time interval), and the two trajectory points exist in the trajectory sequence of the specified object and the trajectory sequence of the other object. In addition, considering that there may be a common sequence between two trajectory sequences in an actual scene, but the two common trajectory points with adjacent image acquisition times in the common sequence are separated by too many other trajectory points in a certain original trajectory sequence, the original trajectory sequence is the trajectory sequence of the other object or the trajectory sequence of the specified object; this situation means that among the other object and the specified object, the trajectory distance between the two common trajectory points of one object is relatively large, and the trajectory distance between the two common trajectory points of the other object is relatively small, but the image acquisition time of the two common trajectory points for the other object and the specified object is similar or the same, this situation does not belong to the same line, and may lead to misjudgment of the same line status.
[0052] For example, if Figure 2 As shown, P1 walks in a straight line and passes through devices D1 and D3 respectively; P2 rides a bicycle along a curved route and passes through D1, D2, D3, and D4 respectively; however, when P1 and P2 pass through devices D1 and D3, the image acquisition time is similar. Although there are common subsequences D1 and D3, they are not in the same line.
[0053] Accordingly, in order to improve the accuracy of peer status determination, for a common subsequence of the trajectory sequence of any other object and the trajectory sequence of a specified object, it is possible to determine whether the two common trajectory points adjacent in image acquisition time belong to the same common subsequence based on the distance between the two common trajectory points adjacent in image acquisition time.
[0054] Exemplarily, the distance between two common trajectory points in the common subsequence that are adjacent in image acquisition time needs to be less than a preset distance threshold (which can be set according to actual scenarios).
[0055] In one example, the distance between two common trajectory points may be determined based on the number of trajectory points between the two common trajectory points in the original trajectory sequence, and the distance between the two common trajectory points is positively correlated with the number of trajectory points between the two common trajectory points in any original trajectory sequence.
[0056] Exemplarily, the distance between two common trajectory points may be determined based on the number of trajectory points between the two common trajectory points in an original trajectory sequence; the original trajectory sequence is a trajectory sequence of the other object or a trajectory sequence of the specified object.
[0057] For example, assuming that trajectory sequence A and trajectory sequence B include adjacent common trajectory point 1 and common trajectory point 2, in trajectory sequence A, there are 3 trajectory points between common trajectory point 1 and common trajectory point 2, and in trajectory sequence B, there are 4 trajectory points between common trajectory point 1 and common trajectory point 2. Then, the distance between common trajectory point 1 and common trajectory point 2 can be determined based on the number of trajectory points between common trajectory point 1 and common trajectory point 2 in trajectory sequence A (3) and the number of trajectory points between common trajectory point 1 and common trajectory point 2 in trajectory sequence B (4).
[0058] Exemplarily, the number of trajectory points between two common trajectory points in the original trajectory sequence may be determined based on the positions of the two common trajectory points in the original trajectory sequence.
[0059] The position of the trajectory point in the trajectory sequence may be determined based on the order of the trajectory points in the trajectory sequence.
[0060] For example, the position of the first trajectory point in the trajectory sequence is 0, the position of the second trajectory point in the trajectory sequence is 1, and so on.
[0061] For example, assuming that trajectory sequence A and trajectory sequence B include adjacent common trajectory point 1 and common trajectory point 2, the position of common trajectory point 1 in trajectory sequence A and trajectory sequence B is 0, the position of common trajectory point 2 in trajectory sequence A is 3, and the position of common trajectory point 2 in trajectory sequence B is 4, then the distance between common trajectory point 1 and common trajectory point 2 can be a distance between (0, 0) and (3, 4).
[0062] In one example, for any other object, when the number of trajectory points in the longest common subsequence of the trajectory sequence of the other object and the trajectory sequence of the specified object exceeds a preset number threshold, it is determined that the other object has a peer relationship with the specified object.
[0063] It should be noted that in the embodiment of the present application, the common trajectory points of the trajectory sequences of two objects can also be added to the same common subsequence, and the common trajectory points in the common subsequence can be divided into subsets based on the distance between two common trajectory points adjacent to each other in image acquisition time.
[0064] In one example, if Figure 3 As shown, in step S110, based on the trajectory sequence of the specified object and the trajectory sequences of other objects, respectively determining the common subsequences of the trajectory sequence of the specified object and the trajectory sequences of each other object can be achieved by the following steps:
[0065] Step S111 : for any trajectory sequence of other objects, determine the common trajectory points in the trajectory sequence of the other objects and the trajectory sequence of the specified object, and sort the common trajectory points according to the order of the common trajectory points in the original trajectory sequence.
[0066] Step S112: when the distance between two common trajectory points adjacent in image acquisition time is greater than a preset distance threshold, the two common trajectory points are added to different subsets of the common subsequence of the specified object and the other object.
[0067] Step S113: when the distance between two common trajectory points adjacent in image acquisition time is less than or equal to a preset distance threshold, the two common trajectory points are added to the same subset of the common subsequences of the specified object and the other objects.
[0068] Exemplarily, for any other object, the common subsequence of the trajectory sequence of the other object and the trajectory sequence of the specified object is a set, which includes the common trajectory points between the trajectory sequence of the other object and the trajectory sequence of the specified object, and the order of the common trajectory points in the set is the same as the order of the common trajectory points in any original trajectory sequence.
[0069] Therefore, for any trajectory sequence of other objects, common trajectory points in the trajectory sequence of the other objects and the trajectory sequence of the specified object may be determined, and the common trajectory points may be sorted according to the order of the common trajectory points in the original trajectory sequence.
[0070] For any two common trajectory points whose image acquisition times are adjacent among the determined common trajectory points, the distance between the two common trajectory points may be determined.
[0071] When the distance between two common trajectory points adjacent in image acquisition time is determined, the distance may be compared with a preset distance threshold.
[0072] When the distance between two common trajectory points adjacent in image acquisition time is greater than a preset distance threshold, the two common trajectory points are added to different subsets of the common subsequences of the specified object and the other objects.
[0073] When the distance between two common trajectory points adjacent to each other in image acquisition time is less than or equal to a preset distance threshold, the two common trajectory points are added to the same subset of the common subsequence of the designated object and the object.
[0074] In one example, in step S120, based on the common subsequences between the trajectory sequence of the specified object and the trajectory sequences of other objects, determining other objects that have a peer relationship with the specified object may include:
[0075] For any other object, when the number of trajectory points in the largest subset of the common subsequence between the trajectory sequence of the other object and the trajectory sequence of the specified object exceeds a preset number threshold, it is determined that the other object has a peer relationship with the specified object.
[0076] Exemplarily, when a common subsequence between the trajectory sequence of a specified object and the trajectory sequence of any other object is determined, the number of trajectory points in the maximum subset of the common subsequence between the trajectory sequence of the other object and the trajectory sequence of the specified object can be compared with a preset number threshold (which can be set according to the actual scenario, such as 3), and when the number of trajectory points in the maximum subset exceeds the preset number threshold, it is determined that the other object has a peer relationship with the specified object.
[0077] It should be noted that, in the embodiment of the present application, other objects that are determined to be in a peer relationship with the specified object may also be sorted based on the common subsequence determined in the above manner.
[0078] Exemplarily, the common subsequences may be sorted based on the number of subsets included in the common subsequences. For example, the more subsets there are in the common subsequence (the number of subsets can be used to characterize the number of times two objects have been in the same line, and the more subsets there are, the more times the two objects have been in the same line), the higher the sorting.
[0079] In addition, a scoring value for scoring can be determined based on the number of subsets included in the common subsequence and the number of common trajectory points included in each subset, and the common subsequences can be sorted based on the scoring value. The higher the scoring value of the common subsequence, the higher the ranking. The specific implementation will not be described in detail here.
[0080] In one embodiment, in any trajectory sequence, two trajectory points with adjacent image acquisition times include different monitoring device identifiers, and a difference in image acquisition times between two trajectory points with adjacent image acquisition times is greater than a preset time threshold.
[0081] Considering the repeated acquisition of image acquisition data (see Figure 4A ) and / or overlapping acquisition (see Figure 4B ) will result in poor efficiency and accuracy in determining peer relationships. Therefore, in order to improve the efficiency and accuracy of determining peer relationships, the repeated and / or overlapping acquired data in the image acquisition data acquired by the monitoring device can be filtered, and peer relationship determination can be performed based on the filtered image acquisition data.
[0082] like Figure 4A As shown, it is a schematic diagram of a repeated acquisition scenario provided in an embodiment of the present application, in which the same object (the object in the figure is a person as an example) is captured by the same monitoring device multiple times in succession, generating image acquisition data with the same image acquisition time for multiple monitoring devices.
[0083] like Figure 4B As shown, it is a schematic diagram of an overlapping acquisition scenario provided in an embodiment of the present application, where the monitoring areas of two different monitoring devices overlap, and the same object (taking a person as an example in the figure) is captured by different monitoring devices at a similar time or at the same time.
[0084] Accordingly, in the embodiment of the present application, based on the image acquisition data of different objects by the monitoring device, the trajectory sequence of each object can be determined respectively, and the filtering of repeated and / or overlapping acquisition data can be achieved in the process of determining the trajectory sequence.
[0085] Since the repeated acquisition data is the image acquisition data generated by the same monitoring device performing image acquisition on the same object multiple times in a continuous time, and the overlapping acquisition data is the image acquisition data generated by different monitoring devices performing image acquisition on the same object at similar or the same time, therefore, in order to filter the repeated acquisition data and / or overlapping acquisition data in the image acquisition data, when filtering the data, it is necessary to ensure that in the filtered data, image acquisition data of the same object by multiple monitoring devices will not be saved in an independent time period, and the number of image acquisition data of the same object by the same monitoring device is only one.
[0086] That is, for repeated acquisition data, after the image acquisition data of a certain object are arranged in the order of image acquisition time, when the monitoring devices of two image acquisition data with adjacent image acquisition times are the same,
[0087] When there are multiple consecutive image acquisition data with the same monitoring device, the multiple image acquisition data are filtered to one (that is, one of the multiple image acquisition data is retained and the rest are deleted) to ensure that the monitoring devices corresponding to two image acquisition data with adjacent image acquisition times are different, thereby realizing the filtering of duplicate acquisition data.
[0088] For overlapping acquisition data, after the image acquisition data of a certain object are arranged in order according to the image acquisition time, if there are two image acquisition data with adjacent image acquisition times but from different monitoring devices, and the difference in image acquisition time is less than or equal to the preset time threshold, one of the two image acquisition data is deleted to ensure that the difference in image acquisition time of two image acquisition data with adjacent image acquisition times but from different monitoring devices is greater than the preset time threshold, thereby achieving filtering of overlapping acquisition data.
[0089] Furthermore, in the trajectory sequence of any object, the monitoring device identifiers included in two trajectory points with adjacent image acquisition times are different, and the difference in the image acquisition times included is greater than a preset time threshold (which can be determined according to the actual scenario, such as 2 minutes).
[0090] In one example, the preset time threshold may be determined based on an average distance between monitoring devices in an actual scenario and a moving speed of an object (which may be an empirical value).
[0091] In one embodiment, Figure 5 As shown, in step S100, determining the trajectory sequence of each object can be achieved by the following steps:
[0092] Step S101: for any object, based on the image acquisition data of the object within a preset statistical period, determine the first image acquisition data with the shortest image acquisition time.
[0093] Step S102: Determine, from the image acquisition data of the object within a preset statistical period, second image acquisition data to which the monitoring device to which the first image acquisition data belongs is different and whose image acquisition time is closest to that of the first image acquisition data.
[0094] Step S103: When the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is greater than a preset time threshold, a trajectory point is generated based on the first image acquisition data, and image acquisition data whose belonging to the same monitoring device as the monitoring device belonging to the first image acquisition data and whose image acquisition time is less than the image acquisition time of the second image acquisition data are eliminated from the image acquisition data of the object within a preset statistical period, and the second image acquisition data is determined as the new first image acquisition data.
[0095] Step S104: when the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is less than or equal to a preset time threshold, the second image acquisition data is discarded, and new second image acquisition data is re-determined from the image acquisition data of the object within a preset statistical period.
[0096] Exemplarily, in order to filter out repeated acquisition data and / or overlapping acquisition data in image acquisition data, for any object, when determining the trajectory sequence of the object, the image acquisition data (referred to as the first image acquisition data in this article) with the shortest image acquisition time (the earlier the image acquisition, the shorter the image acquisition time) can be determined based on the image acquisition data of the object within a preset statistical period.
[0097] In an example, the preset statistical period may be a natural day or other time period (such as 8:00 am to 12:00 pm on a natural day).
[0098] After determining the first image acquisition data, image acquisition data (referred to as second image acquisition data in this article) can be determined from the image acquisition data of the object within a preset statistical period, the image acquisition data belonging to a monitoring device that is different from the monitoring device to which the first image acquisition data belongs and whose image acquisition time is closest to the image acquisition time of the first image acquisition data.
[0099] When the first image acquisition data and the second image acquisition data are determined, the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data (the difference obtained by subtracting the smaller value from the larger value) can be calculated and compared with the preset time threshold.
[0100] When the difference is greater than a preset time threshold, a trajectory point can be generated based on the first image acquisition data (the trajectory point includes the monitoring device identifier of the monitoring device to which the first image acquisition data belongs and the image acquisition time of the first image acquisition data), and image acquisition data whose belonging monitoring device is the same as the monitoring device to which the first image acquisition data belongs and whose image acquisition time is less than the image acquisition time of the second image acquisition data (these data belong to repeated acquisition data) are eliminated, and the second image acquisition data is determined as the new first image acquisition data.
[0101] It should be noted that in order to reduce computing memory, a unique number can be configured for the monitoring device identification. For the image acquisition time, when performing trajectory sequence statistics with natural days as the statistical period, the image acquisition time can be subtracted from the current time origin (for example: 2019-09-29 00:00:00), and the result can be stored in minutes as the image acquisition time.
[0102] Exemplarily, when the difference is less than or equal to a preset time threshold, the second image acquisition data (which are overlapping acquisition data) can be eliminated, and new second image acquisition data can be re-determined from the image acquisition data of the object within a preset statistical period.
[0103] It should be noted that in this embodiment, when new first image acquisition data or second image acquisition data is determined, trajectory points can continue to be generated according to the above strategy until there is no new second image acquisition data, and a trajectory sequence is generated based on the determined trajectory points.
[0104] In one example, when new first image acquisition data is determined in the above manner, if there is no second image acquisition data whose image acquisition time has an image acquisition time difference with the image acquisition time of the first image acquisition data that is greater than a preset time threshold, a trajectory point can be generated based on the first image acquisition data, and the trajectory sequence determination process of the object is terminated.
[0105] In order to enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application are described below with reference to specific examples.
[0106] In this embodiment, it is taken that the object of image acquisition is a person as an example.
[0107] In this embodiment, in order to improve data reading efficiency and calculation speed, the image acquisition data of the monitoring device can be recorded according to the following data structure:
[0108] 1. Use the spatial point, i.e. the monitoring device, as the key.
[0109] 2. The image acquisition time series of the image captured by the monitoring device (key) with the human_id (unique identifier of the person) is used as the value.
[0110] The number of monitoring devices that collect images of a certain human_id in one day is limited, and the length of the spatial sequence they form is much smaller than the length of the time series composed of the image collection time.
[0111] A certain human_id is repeatedly and continuously captured by a monitoring device, which causes the image capture time sequence under a single monitoring device to be too long. The current data structure can avoid this problem when calculating the trajectory sequence to reduce the amount of calculation.
[0112] Data structure:
[0113] [d1, <t 11 , t 12 , t 13 ……t 1n >]
[0114] [d2, <t 21 , t 22 , t 23 ……t 2n >]
[0115] …
[0116] [d m , <t m1 , t m2 , t m3 ……t mn >]
[0117] Among them, d i is the device identifier of monitoring device i, t ij is the image acquisition time when monitoring device i acquires the image of the human for the jth time.
[0118] 1. Personnel Trajectory Sequence Calculation
[0119] Based on the abnormal data source (see Figure 4A and Figure 4B ), we can develop targeted data cleaning algorithms based on the characteristics of abnormal data, clean up as much abnormal data as possible, and ensure that there is no risk of correct data being cleaned up.
[0120] In this embodiment, in order to achieve abnormal data filtering, it is necessary to ensure that within an independent period of time (until the image is captured by other monitoring devices), a person can only be captured by one monitoring device and the image is only captured once.
[0121] Based on the above data structure, the personnel trajectory sequence calculation algorithm is as follows:
[0122] 1) Find the minimum time (t min ), and record t min The device to which it belongs key );
[0123] 2) From non-device key Among the other equipment sequences, find the minimum time (t temp ) and record the device to which it belongs (device temp );
[0124] 3) Determine t temp -t min >Whether the threshold (threshold, 2 minutes by default) is met;
[0125] For example, if the threshold is too large, the trajectory points may be lost, and if the threshold is too small, the amount of dirty data will increase. The threshold is set according to the actual situation (the minimum distance interval of the monitoring device).
[0126] 4) If the above expression is true, then <device key ,t min >As a trajectory point, and remove the devicekey All the time series less than t temp At the time point t temp Assign to t min , device temp Assign value to device key Proceed to the next cycle.
[0127] 5) If the above expression does not hold, remove the device temp t in time series temp Enter the next cycle.
[0128] 6) Until t temp When no result is found, the loop ends.
[0129] The data calculated by the above-mentioned personnel trajectory sequence calculation algorithm will form a clear trajectory, which is composed of the device identification of the monitoring device and the image acquisition time, and is a trajectory sequence sorted according to the image acquisition time.
[0130] form:
[0131] [<device1,time1> ,<device2,time2> … <device x ,time x >…… <deivce n ,time n >]
[0132] In order to further reduce the computing memory, the monitoring devices can be stored in the cache and assigned a unique number. The trajectory sequence can be recorded in days. The time can be stored in minutes by subtracting the origin of the day from the image acquisition time (for example: 2019-09-29 00:00:00).
[0133] The trajectory sequence is in the form of:
[0134] [<1,23>,<3,45>…… <x,t x >…… <n,t n >]
[0135] The above trajectory sequence means: at the 23rd minute of the day, it was collected by monitoring device 1; at the 45th minute of the current day, it was collected by monitoring device 3...
[0136] At this point, the trajectory analysis function of human_id is completed.
[0137] The trajectory corresponding to human_id is stored in HBase with a rowKey consisting of time (accurate to the day) and human_id to facilitate subsequent analysis of other judgment functions based on trajectory sequences.
[0138] 2. Face Companion Analysis Based on LCS Improved Algorithm
[0139] After completing the trajectory analysis of human_id, you can further analyze the companions based on the trajectory sequence. A companion refers to a person who moves with the person to be analyzed over a period of time. The companion must have the same movement trajectory as the person to be analyzed, which is reflected in the trajectory sequence as a common subsequence. Therefore, the LCS algorithm can be used to calculate the companions of the person to be analyzed based on the trajectory sequence.
[0140] However, it is necessary to eliminate the situation where there are common subsequences between two trajectory sequences, but there are too many other trajectory points between the same trajectory points.
[0141] In this embodiment, for the trajectory sequence of the person to be analyzed and the trajectory sequence of any person to be compared, a common subsequence can be determined based on the LCS improved algorithm, and the distance between the trajectory points in the same subset of the same common subsequence is ensured to be no greater than a preset distance threshold, so as to eliminate the influence of oscillating dirty data on the trajectory results and ensure the similarity of the trajectories (that is, image acquisition records of different monitoring devices are allowed between people traveling together, but the amount of records is less than the threshold, thereby eliminating the above-mentioned cross-travel situation).
[0142] The optimal sub-problem solution process based on dynamic programming:
[0143] Let X = <x1,x2,...,x m > and Y= <y1,y2,...,y n > are two sequences, Z= <z1,z2,z3,...,z k > is any common subsequence of X and Y.
[0144] 1) If X m =Y n , then Z k =X m =Y n , and Z k-1 For X m-1 and Y n-1 The common subsequence of
[0145] 2) If X m ≠Y n And Z k ≠X m , then Z is X m-1 and Y n The common subsequence of
[0146] 3) If X m ≠Y n And Z k ≠Yn , then Z is X m and Y n-1 The common subsequence of
[0147] The formula for calculating the length of the common subsequence is:
[0148] Let C[i][j] represent the sequence X m and Y n The length of the longest common subsequence is calculated as:
[0149]
[0150] Where, i=m+1, j=n+1;
[0151] Calculation process:
[0152] It should be noted that: X and Y represent sequences, and the subscript represents the length; x and y represent elements, and the subscript represents the position.
[0153] 1. Input trajectory sequence X (length m) and trajectory sequence Y (length n), and initialize the stack (used to store common trajectory points) and the marking character flag;
[0154] 2. Generate a two-dimensional Integer array (C[i][j]) based on the length of the trajectory sequences X and Y, with the length and width being the length of X and Y plus 1, i.e., i=m+1, j=n+1;
[0155] 3. Initialize the first row and first column of C[i][j] to 0 elements;
[0156] 4. Calculate the values of other elements in C[i][j] according to the C[i][j] formula;
[0157] 5. Backtrack the C[i][j] element. When C[i][j] = C[i-1][j-1] + 1, and C[i][j]>Max(C[i][j-1], C[i-1][j]), determine whether the distance between the element corresponding to C[i][j] (i.e., the common trajectory point) and the last element pushed into the stack (calculated by the subscript) exceeds the threshold. If so, push the flag into the stack, that is, divide the elements before and after the flag into different subsets;
[0158] 6. The corresponding element of C[i][j] (i.e. x i-1 or j-1 , where x i-1 =y j-1 ) is pushed onto the stack;
[0159] 7. Update the current horizontal index i and vertical index j;
[0160] 8. End of backtracking. Split the elements in the stack according to the flag character, and the longest sub-segment is the largest subset in the improved common subsequence.
[0161] Based on the above strategy, it is not only possible to find out whether two trajectory sequences have a peer relationship, but also to return the peer points and time if there is a peer relationship between the two trajectory sequences.
[0162] The method provided by the present application is described above. The device provided by the present application is described below:
[0163] See also Figure 6 , is a structural diagram of a data processing device provided in an embodiment of the present application, such as Figure 6 As shown, the data processing device may include:
[0164] The first determining unit 610 is configured to determine a trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, and the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of the image acquisition time;
[0165] A second determining unit 620 is configured to determine, based on the trajectory sequence of the designated object and the trajectory sequences of the other objects, common subsequences of the trajectory sequence of the designated object and the trajectory sequences of the other objects respectively;
[0166] The third determining unit 630 is configured to determine other objects that have a peer relationship with the designated object based on a common subsequence between the trajectory sequence of the designated object and the trajectory sequences of other objects.
[0167] In a possible embodiment, for the trajectory sequence of any other object, the common trajectory points contained in the common subsequence of the trajectory sequence of the other object and the trajectory sequence of the specified object are shared by the trajectory sequence of the other object and the trajectory sequence of the specified object, the order of the common trajectory points in the common subsequence is the same as the order of the common trajectory points in any original trajectory sequence, and the distance between two common trajectory points adjacent in image acquisition time is less than a preset distance threshold.
[0168] In a possible embodiment, the distance between two common trajectory points is determined based on the number of trajectory points between the two common trajectory points in the original trajectory sequence, and the distance between the two common trajectory points is positively correlated with the number of trajectory points between the two common trajectory points in any original trajectory sequence.
[0169] In a possible embodiment, two trajectory points with adjacent image acquisition times in any trajectory sequence include different monitoring device identifiers, and a difference in image acquisition times between two trajectory points with adjacent image acquisition times is greater than a preset time threshold.
[0170] In a possible embodiment, the first determining unit 610 is specifically configured to determine, for any object, first image acquisition data having a minimum image acquisition time based on image acquisition data of the object within a preset statistical period;
[0171] Determine, from the image acquisition data of the object within a preset statistical period, second image acquisition data to which a monitoring device is different from the monitoring device to which the first image acquisition data belongs and whose image acquisition time is closest to the image acquisition time of the first image acquisition data;
[0172] When the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is greater than a preset time threshold, a trajectory point is generated based on the first image acquisition data, image acquisition data to which the monitoring device is the same as the monitoring device to which the first image acquisition data belongs and whose image acquisition time is less than the image acquisition time of the second image acquisition data is eliminated, and the second image acquisition data is determined as the new first image acquisition data;
[0173] When the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is less than or equal to a preset time threshold, the second image acquisition data is discarded, and new second image acquisition data is re-determined from the image acquisition data of the object within a preset statistical period.
[0174] See also Figure 7 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 701, a communication interface 702, a memory 703 and a communication bus 704. The processor 701, the communication interface 702 and the memory 703 communicate with each other through the communication bus 704. Among them, the memory 703 stores a computer program; the processor 701 can execute the data processing method described above by executing the program stored in the memory 703.
[0175] The memory 703 mentioned herein may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the memory 702 may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage media, or a combination thereof.
[0176] The present application also provides a machine-readable storage medium storing a computer program, such as Figure 7 The computer program may be stored in the memory 703. Figure 7 The processor 701 in the electronic device shown executes to implement the data processing method described above.
[0177] The present application also provides a computer program stored in a machine-readable storage medium, such as Figure 7 The memory 703 in the memory 703, and when the processor executes the computer program, it prompts the processor 701 to execute the data processing method described above.
[0178] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0179] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: include: Determine a trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of image acquisition time; wherein in any trajectory sequence, two trajectory points with adjacent image acquisition times include different monitoring device identifiers, and the difference in image acquisition time between two trajectory points with adjacent image acquisition times is greater than a preset time threshold; Based on the trajectory sequence of the designated object and the trajectory sequences of other objects, a common subsequence of the trajectory sequence of the designated object and the trajectory sequences of each other object is determined respectively; wherein, for any trajectory sequence of other objects, the common trajectory points contained in the common subsequence are trajectory points shared by the trajectory sequence of the other object and the trajectory sequence of the designated object, and the order of each of the common trajectory points in the common subsequence is the same as the order of each of the common trajectory points in any original trajectory sequence; the distance between two common trajectory points adjacent in image acquisition time in the common subsequence is less than a preset distance threshold, the distance between the two common trajectory points is determined based on the number of trajectory points between the two common trajectory points in the original trajectory sequence, and the distance between the two common trajectory points is positively correlated with the number of trajectory points between the two common trajectory points in any original trajectory sequence; the original trajectory sequence is the trajectory sequence of the other object or the trajectory sequence of the designated object; Based on the common subsequences between the trajectory sequence of the designated object and the trajectory sequences of other objects, other objects that have a peer relationship with the designated object are determined.
2. The method according to claim 1, characterized in that The step of determining the trajectory sequence of each object comprises: For any object, based on the image acquisition data of the object within a preset statistical period, determine the first image acquisition data with the minimum image acquisition time; Determine, from the image acquisition data of the object within a preset statistical period, second image acquisition data to which a monitoring device is different from the monitoring device to which the first image acquisition data belongs and whose image acquisition time is closest to the image acquisition time of the first image acquisition data; When the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is greater than the preset time threshold, a trajectory point is generated based on the first image acquisition data, image acquisition data to which the monitoring device is the same as the monitoring device to which the first image acquisition data belongs and whose image acquisition time is less than the image acquisition time of the second image acquisition data is eliminated, and the second image acquisition data is determined as the new first image acquisition data; When the difference between the image acquisition time of the second image acquisition data and the image acquisition time of the first image acquisition data is less than or equal to the preset time threshold, the second image acquisition data is discarded, and new second image acquisition data is re-determined from the image acquisition data of the object within a preset statistical period.
3. A data processing device, characterized in that: include: A first determining unit is configured to determine a trajectory sequence of each object; wherein the trajectory sequence includes a plurality of trajectory points, the trajectory points include a monitoring device identifier and an image acquisition time, and the trajectory points in any trajectory sequence are arranged in the order of image acquisition time; wherein in any trajectory sequence, two trajectory points with adjacent image acquisition times include different monitoring device identifiers, and a difference in image acquisition time between two trajectory points with adjacent image acquisition times is greater than a preset time threshold; The second determining unit is configured to determine, based on the trajectory sequence of the designated object and the trajectory sequences of other objects, a common subsequence of the trajectory sequence of the designated object and the trajectory sequences of the other objects, respectively; wherein, for any trajectory sequence of the other object, the common trajectory points contained in the common subsequence are trajectory points shared by the trajectory sequence of the other object and the trajectory sequence of the designated object, and the order of the common trajectory points in the common subsequence is the same as the order of the common trajectory points in any original trajectory sequence; the distance between two common trajectory points adjacent in image acquisition time in the common subsequence is less than a preset distance threshold, the distance between the two common trajectory points is determined based on the number of trajectory points between the two common trajectory points in the original trajectory sequence, and the distance between the two common trajectory points is positively correlated with the number of trajectory points between the two common trajectory points in any original trajectory sequence; the original trajectory sequence is the trajectory sequence of the other object or the trajectory sequence of the designated object; The third determining unit is configured to determine other objects that have a peer relationship with the designated object based on a common subsequence between the trajectory sequence of the designated object and the trajectory sequences of other objects.
4. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method of claim 1 or 2 when executing a program stored in a memory.
5. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to claim 1 or 2 is implemented.
Citation Information
Patent Citations
Gang mining method, device and equipment and storage medium
CN111090681A
Pedestrian duplicate removal method and device, gang analysis method and device and electronic equipment
CN111563479A