Data cycle mining methods and related products
By filtering the candidate periods in the time set of the target object accessing the target position, and periodic mining is performed using periodic offsets and missing parameters, the problem of inefficiency in the existing technology is solved, and efficient and accurate periodic sequence mining is achieved.
Patent Information
- Application Number
- CN202210013469.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-01-06
AI Technical Summary
In the prior art, when mining periodic sequences of object trajectory data, it is necessary to determine a large number of candidate periods, resulting in inefficient periodic sequence mining.
By obtaining the time set of the target object accesses the target position, the candidate periods that meet the period length conditions and the occurrence threshold are selected, and period offset parameters and period missing parameters are used for periodic mining to reduce unnecessary periodic mining work.
The efficiency of periodic sequence mining is improved, and periodic sequences can be accurately mined in the presence of periodic offsets and missing.
Smart Images

Figure CN116450957B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, in particular to the field of data mining technology, and specifically to a data cycle mining method and related products. Background Art
[0002] With the development of internet technology, mining periodic patterns in object trajectory data can reveal changes in the object's trajectory, thereby predicting its development trend. However, in the process of mining periodic sequences in object trajectory data, the period length must be known in order to perform periodic mining on the object trajectory data. Currently, the main approach is to obtain a time set from the object trajectory data, and the difference between each time point in the time set is used as a candidate period. Then, based on all candidate periods, the object trajectory data is periodically mined to obtain a periodic sequence. This method will identify a large number of candidate periods, and mining periodic sequences based on a large number of candidate periods will result in low efficiency. Summary of the Invention
[0003] The embodiments of the present application provide a data cycle mining method and related products, which can improve the efficiency of period sequence mining.
[0004] In one aspect, an embodiment of the present application provides a data cycle mining method, the method comprising:
[0005] Obtaining a time set of a target object visiting a target location, the time set including an initial time point and multiple reference time points, the initial time point being the time when the target object first visits the target location, and the reference time point being the time when the target object does not visit the target location for the first time;
[0006] Acquire a cycle candidate set corresponding to the time set, where the cycle candidate set includes one or more candidate cycles, the candidate cycles satisfy a cycle length condition, and / or the number of occurrences of the candidate cycles in the time set is greater than a number threshold;
[0007] Acquire cycle mining parameters, where the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter;
[0008] Based on the period mining parameters and the period candidate set, periodic mining is performed on the time set to obtain a period sequence of the target object visiting the target location.
[0009] In one aspect, an embodiment of the present application provides a data cycle mining device, the device comprising:
[0010] An acquiring unit, configured to acquire a time set of a target object visiting a target location, wherein the time set includes an initial time point and a plurality of reference time points, wherein the initial time point refers to a time when the target object visits the target location for the first time, and the reference time point refers to a time when the target object visits the target location for a non-first time;
[0011] The acquisition unit is further configured to acquire a candidate period set corresponding to the time set, where the candidate period set includes one or more candidate periods, the candidate periods satisfying a period length condition, and / or the number of occurrences of the candidate periods in the time set being greater than a threshold number;
[0012] The acquisition unit is further configured to acquire cycle mining parameters, wherein the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter;
[0013] The processing unit is configured to perform periodic mining on the time set based on the period mining parameters and the period candidate set to obtain a period sequence of the target object visiting the target location.
[0014] On the one hand, an embodiment of the application provides a data mining device, which includes an input device, an output device, a processor and a computer storage medium, wherein the processor and the computer storage medium are interconnected, wherein the computer storage medium is used to store a computer program, and the processor is configured to call the computer program to execute the above-mentioned data cycle mining method.
[0015] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it is used to implement the above-mentioned data cycle mining method.
[0016] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program; the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor of a data mining device, the above-mentioned data cycle mining method is executed.
[0017] In an embodiment of the present application, a time set of the target object accessing the target location is obtained; and a period candidate set corresponding to the time set is obtained, the period candidate set including one or more candidate periods, the candidate periods satisfying a period length condition, and / or the number of occurrences of the candidate periods in the time set being greater than a number threshold; period mining parameters are obtained, the period mining parameters including one or more of the following: a period offset parameter and a period missing parameter; based on the period mining parameters and the period candidate set, periodic mining is performed on the time set to obtain a period sequence of the target object accessing the target location. The period length condition and the number threshold can be used to screen out a suitable candidate period set, without having to obtain all candidate periods for periodic mining of the time set, thereby reducing the workload of period mining and improving the efficiency of period sequence mining. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1a This is a schematic diagram of a trajectory data with periodic offset and missing data provided by an embodiment of the present application;
[0020] Figure 1b This is a schematic diagram of the architecture of a data recommendation system provided in an embodiment of the present application;
[0021] Figure 2 This is a flow chart of a data cycle mining method provided by an embodiment of the present application;
[0022] Figure 3a is a schematic diagram of a reference dwell position detection provided in an embodiment of the present application;
[0023] Figure 3b This is a schematic diagram of clustering based on reference stay locations provided in an embodiment of the present application;
[0024] Figure 3c is a schematic diagram of trajectory data denoising provided by an embodiment of the present application;
[0025] Figure 4 This is a flow chart of another data cycle mining method provided by an embodiment of the present application;
[0026] Figure 5 This is a flow chart of another data cycle mining method provided by an embodiment of the present application;
[0027] Figure 6a-6eThis is a flow chart of periodic mining of a time set provided by an embodiment of the present application;
[0028] Figure 6f This is a schematic diagram of a continuous missing period provided by an embodiment of the present application;
[0029] Figure 6g This is a schematic diagram of adding a stop mining mark when the number of consecutive cycle loss is greater than the consecutive cycle loss threshold, provided by an embodiment of the present application;
[0030] Figure 6h This is a schematic diagram of stopping mining when the total number of cycle missing is greater than the total cycle missing threshold provided by an embodiment of the present application;
[0031] Figure 7 This is a schematic diagram of a trajectory data with periodic offset provided by an embodiment of the present application;
[0032] Figure 8 This is a structural diagram of a data cycle mining device provided by an embodiment of the present application;
[0033] Figure 9 This is a structural diagram of a data mining device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0035] It should be understood that in the specific implementation of this application, when user trajectory data, user trajectory location and other related data are involved, when the embodiments of this application are applied to specific products or technologies, user permission or consent must be obtained, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0036] Big data refers to collections of data that cannot be captured, managed, and processed within a specific timeframe using conventional software tools. These massive, rapidly growing, and diverse information assets require new processing models to enhance decision-making, insight discovery, and process optimization. With the advent of the cloud era, big data has attracted increasing attention. Big data requires specialized technologies to efficiently process large amounts of time-sensitive data. Technologies suitable for big data include massively parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the internet, and scalable storage systems.
[0037] The embodiment of the present application provides a data cycle mining solution, which utilizes big data technology. The general principle of the data cycle mining solution is as follows: when you want to mine the periodic sequence of an object visiting a certain location (such as a target location), you can obtain the trajectory data of the object with the authorization or permission of the object, wherein the trajectory data may include multiple trajectory locations visited by the object and the time corresponding to the visit to each trajectory location; then, you can obtain the time set of the object visiting the target location from the trajectory data. Since the acquired trajectory data may have offset or missing problems, the acquired time set may also have a lot of offset and missing problems. For example, Figure 1a The period axis formed by the time set of the object accessing the target location, when there is no period offset or period missing, the normal period sequence included in the period axis is (0→5→10→15→20), and the period length is 5 days; when there is a period sequence offset, such as Figure 1a As shown in 31 in , a normal periodic sequence should include time point 10, but time point 10 cannot be found on the periodic axis formed by the time set. Finally, an offset time point 9 can be found on the periodic axis formed by the time set, indicating that a periodic offset has occurred. When a period is missing, as shown in 32 in 1a, a normal periodic sequence should include time point 15, but time point 15 and an offset time point cannot be found on the periodic axis formed by the time set. In this case, a periodic offset is considered to have occurred. When a periodic offset or periodic offset occurs, it is impossible to directly mine the periodic sequence of the object access target location from the time set.
[0038] Therefore, in order to solve the possible problems of cycle missing and cycle offset in this application, after obtaining the time set of the exclusive access target location, cycle mining parameters such as cycle offset parameters and cycle missing parameters are introduced. Then, one or more cycle candidates corresponding to the time set that meet the preset conditions are obtained. The preset conditions may include one or more of the following: the candidate cycle meets the cycle length condition and the number of occurrences of the candidate cycle in the time set is greater than the number threshold. The cycle length condition and the number threshold can be used to screen out a suitable candidate cycle set. There is no need to obtain all candidate cycles for periodic mining of the time set, which reduces the workload of cycle mining and improves the efficiency of cycle sequence mining. Then, based on the cycle mining parameters and the cycle candidate set, the time set is periodically mined to obtain the cycle sequence of the object access target location. Among them, the cycle offset parameter can be used to solve the problem of cycle offset (or cycle disturbance) in cycle mining, and the cycle missing parameter can be used to solve the problem of cycle missing in cycle mining.
[0039] In one embodiment, in the process of periodically mining a time set based on a periodic mining parameter and a periodic candidate set to obtain a periodic sequence of the object's access to the target location, the periodic position under normal circumstances (or a fixed periodic time search box) can be fixed based on each period candidate in the periodic candidate set. For example, the periodic candidate set includes a target candidate period T, and the periodic positions (or periodic time points) under normal circumstances can be fixed as follows: t1, t1+T, t1+2T...; then, the periodic mining parameter is introduced, and the time set is periodically mined based on the periodic mining parameter and the target candidate period, ultimately obtaining a periodic sequence of the object's access to the target location. By introducing periodic mining parameters such as a periodic offset parameter and a periodic missing parameter, the effects of periodic deviation and periodic missing on periodic exploration can be eliminated.
[0040] In one embodiment, the cycle mining scheme provided in the embodiments of the present application can be applied to mining trajectory data. That is, the cycle mining scheme can be applied to mining the travel habits of the target object, predicting the future trends of the target object, compressing trajectory data, and other scenarios. For example, the cycle mining scheme can be used to mine the target object's travel cycle information and accurately recommend corresponding information to the target object before his next trip. In some embodiments, in addition to being applied to mining trajectory data, the cycle mining scheme can also be used to mine periodic patterns of other types of data, such as mining weather data in a certain area, for example, mining information about the period of rain in a certain area, and providing timely warnings.
[0041] The data cycle mining solution provided in the embodiments of the present application, on the one hand, can screen out a suitable candidate cycle set by using the cycle length condition and the number threshold, without having to obtain all candidate cycles for periodic mining of the time set, thereby reducing the workload of cycle mining and improving the efficiency of period sequence mining. On the other hand, the introduction of one or more of the cycle deviation parameters and the cycle missing parameters can eliminate the impact of the cycle deviation or cycle missing on the periodic exploration in the presence of cycle offset and / or cycle missing, thereby accurately and efficiently mining the period sequence (or period pattern) in the time set.
[0042] Based on the data cycle mining solution provided above, this embodiment of the application provides a data recommendation system. Figure 1b The data recommendation system may include a data collection device 101, a data mining device 102, a data recommendation device 103, and at least one terminal device 104; wherein the data collection device 101 and the data mining device 102 may be directly or indirectly connected via wired or wireless communication; the data mining device 102 and the data recommendation device 103 may be directly or indirectly connected via wired or wireless communication; and the data recommendation device 103 and the terminal device 104 may be directly or indirectly connected via wired or wireless communication. The data collection device 101, the data mining device 102, and the data recommendation device 103 may be terminal devices or servers. The above-mentioned terminal devices can be smart devices such as mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices, etc.; the server can include multiple servers (also called nodes), which can be independent physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0043] The data collection device 101 can collect trajectory data of a target object. When the target object is a user, the trajectory data is collected with the user's authorization. The data mining device 102 can be used to obtain the time series of the target object's visits to a certain location from the target object's trajectory data and periodically mine the time series to obtain a periodic sequence of the target object's visits to the location. The data recommendation device 103 can recommend data to the target object based on the periodic sequence of the target object's visits to the location mined by the data mining device 102. The terminal device 104 can be used to display the data recommended by the data recommendation device 103.
[0044] In one embodiment, the data collection device 101 can collect trajectory data of a target object, where the target object can be a user or weather, etc. The data mining device 102 can obtain the trajectory data from the data collection device 101, obtain the target location and the time set corresponding to the target location from the trajectory data, obtain the period mining parameters and the period candidate set corresponding to the time set, and then perform periodic mining on the time set based on the candidate period set and the period mining parameters to obtain a period sequence of the target object visiting the target location. The period sequence of the target object visiting the target location is then sent to the data recommendation device 103. The data recommendation device 103 can analyze the period sequence of the target object visiting the target location and recommend corresponding data to the terminal device 104 where the target object is located based on the analysis results.
[0045] In one embodiment, when the target object is a user, when the data acquisition device 101 is collecting the trajectory data of the target object, the data acquisition device 101 can output a data acquisition prompt interface, which includes a prompt message, a cancel button, and a confirmation button. The prompt message is used to prompt the user that the trajectory data of the user's movement needs to be obtained, and / or the related processing to be performed after the trajectory data is collected. If the user agrees to collect the trajectory data, the confirmation button can be triggered to authorize the collection of the trajectory data. Then the data acquisition device 101 can collect the user's trajectory data; if the user does not agree to collect the user's trajectory data, the cancel button can be triggered. At this time, the data acquisition device 101 cannot collect the user's trajectory data.
[0046] Based on the above data cycle mining solution, please see Figure 2 , Figure 2 This is a flow chart of a data cycle mining method provided in an embodiment of the present application. The data cycle mining method can be executed by the data mining device in the above-mentioned data recommendation system. The data cycle mining method may include the following steps S201-S204:
[0047] S201: Obtain a time set when a target object visits a target location. The time set may include an initial time point and multiple reference time points. The initial time point refers to the time when the target object first visits the target location, and the reference time points refer to times when the target object does not visit the target location for the first time. The target object may be a user, a typhoon, an earthquake, or the like.
[0048] In a specific implementation, when you want to periodically mine the target object's visits to a certain location and the target object is a user, you can directly obtain the time set of the target object's visits to the target location with the user's authorization. At this time, the time set includes the time when the target object first visits the target location and the time when it is not the first visit to the target location. For example, with the user's authorization, obtain the time when the user first visits the supermarket and the time of other visits to the supermarket except the first time. For example, if the user first visits the supermarket at 10 o'clock, the initial time is 10 o'clock. The user visits the supermarket again at 11 o'clock, and the reference time point is 11 o'clock. When the target object is weather or typhoon, the time set of the target object's first visit to the target location can be directly obtained from the weather broadcast platform.
[0049] In one embodiment, the target object's access to the target location can be understood as the target object's motion trajectory. The specific implementation method for the data mining device to obtain the time set of the target object's access to the target location can be: obtaining the target object's trajectory data, the trajectory data including multiple trajectory locations; for the target object (such as a user), the trajectory location (or the area formed by the trajectory location) that the user is interested in is usually a place where the user stays for a long time. Therefore, in order to simplify the difficulty of analyzing the periodic sequence, the data mining device can first determine the target object's stay location from the trajectory data. If the target object does not exceed the neighborhood range of a certain trajectory location within a continuous period of time, then the trajectory location can be regarded as a reference stay location and the time of entering the reference stay location range or leaving the reference stay location range can be recorded. Based on this, after acquiring trajectory data, the data mining device uses a dwell detection algorithm to determine one or more reference dwell locations from multiple trajectory locations. Specifically, the data mining device can determine whether each trajectory location meets a location dwell screening condition. Then, the data mining device can obtain one or more reference dwell locations that meet the location dwell screening condition from the multiple trajectory locations. The location dwell screening condition includes: the target object stays in a preset area formed by a target trajectory location for a period of time greater than a preset time length. The target trajectory location is any one of the multiple trajectory locations. The preset area formed by the target trajectory location can be a circular area, a rectangular area, a square area, or an irregular area centered on the target trajectory location. The preset area and preset time length can be set as required.
[0050] The specific implementation method of the data mining device for obtaining one or more reference stay positions that meet the position stay screening conditions from multiple trajectory positions is as follows: the data mining device can obtain the time length that the target object is in the preset area formed by each trajectory position, and determine whether the time length that the target object is in the preset area formed by each trajectory position is greater than the preset time length, and determine the trajectory position with a time length greater than the preset time length as the reference stay position. The time length that the target object is in the preset area formed by each trajectory position is determined based on the time point of entering the preset area formed by each trajectory position and the time point of leaving the preset area formed by each trajectory position. For example, Figure 3a It can be seen that the time length of the target object in the preset area 41 formed by the trajectory position a is greater than the preset time length, and the time length of the target object in the preset area 42 formed by the trajectory position b is greater than the preset time length. The data mining device can determine the trajectory position a and the trajectory position b as reference stay positions.
[0051] After determining the target object's stay location, according to the characteristics of the spatiotemporal trajectory data, there may be reference stay locations that belong to the same reference location. For example, one or more reference stay locations include the north gate of the supermarket and the south gate of the supermarket. These two reference stay locations belong to the same reference location supermarket. Therefore, one or more reference stay locations can be clustered and analyzed to obtain multiple cluster sets. Each cluster set corresponds to a reference location. At this time, a cluster set corresponding to a reference location can be understood as the cluster center of the cluster set being the corresponding reference location. Optionally, a cluster label can be added to each cluster set, and the cluster label can be a reference location label. For example, the north gate and the south gate of the supermarket are clustered and analyzed to obtain a cluster set. The reference location corresponding to the cluster set is the supermarket. Among them, the characteristics of the spatiotemporal trajectory data may include trajectory location, trajectory time, and the like. For another example, Figure 3b In the process of clustering one or more dwell locations, cluster sets A and B are obtained. After the dwell locations are clustered, the cluster sets may include reference dwell locations and the time points corresponding to the reference dwell locations. The trajectory data of the target object can be converted into cluster sets (or cluster center sequences) through cluster analysis.
[0052] Then, the data mining device matches the target location with multiple reference locations and uses the cluster set corresponding to the reference configuration matching the target location as the target cluster set corresponding to the target location; obtains the time corresponding to each reference dwell location, where the time corresponding to each reference dwell location may refer to the time of entering or leaving the preset area formed by the reference dwell location. Based on the time points corresponding to the reference dwell locations included in the target cluster set, an initial time point and multiple reference time points are determined, and the initial time point and multiple reference time points are added to the time set of the target object's visit to the target location. The time points corresponding to the reference dwell locations included in the target cluster set may be repeated, for example, reference dwell location 1 and the time point corresponding to reference dwell location 1 are recorded repeatedly. In this case, determining the initial time point and multiple reference time points based on the time points corresponding to the reference dwell locations included in the target cluster set may include: performing a deduplication process (unique operation) on the time points corresponding to the reference dwell locations included in the target cluster set to obtain a deduplicated target cluster set, and determining the initial time point and multiple reference time points from the time points corresponding to the reference dwell locations included in the deduplicated target cluster set.
[0053] In one embodiment, a specific implementation method of performing cluster analysis on one or more reference stay locations to obtain multiple cluster sets may be: performing cluster analysis on one or more reference stay locations using a density-based clustering method DBSCAN to obtain multiple cluster sets.
[0054] In one embodiment, the specific implementation method for determining the initial time point and multiple reference time points based on the time points corresponding to the reference stay positions included in the target cluster set can be: the data mining device can arrange the time points corresponding to the reference stay positions included in the target cluster set in order of precedence to obtain an arrangement result, and determine the time point corresponding to the first position in the arrangement result as the initial time point, and determine all time points except the time point corresponding to the first position as reference time points. For example, the target cluster set includes the reference stay position "supermarket snack area" and the reference stay position "supermarket north gate". The time point corresponding to the "supermarket snack area" is 10 o'clock, and the time point corresponding to the "supermarket north gate" is 12 o'clock. The data mining device can arrange the time points corresponding to the "supermarket snack area" and the time points corresponding to the "supermarket north gate" in order of precedence to obtain an arrangement result (10 o'clock, 12 o'clock), and then use 10 o'clock in the arrangement result as the initial time point and 12 o'clock as the reference time point.
[0055] In another embodiment, since the object may visit the target location in dimensions such as days, weeks, or hours, the specific implementation method of determining the initial time point and multiple reference time points based on the time points corresponding to the reference stay positions included in the target cluster set can also be: arrange the time points corresponding to the reference stay positions included in the target cluster set in order to obtain the arrangement result, and obtain the time point corresponding to the reference stay position ranked first from the arrangement result as the conversion time point, and then subtract the time points corresponding to the remaining reference stay positions from the conversion time point to obtain the relative time between the time points corresponding to the remaining reference stay positions and the conversion time point; set the conversion time point corresponding to the reference stay position at the first position to the preset time point, and use it as the initial time point, and then determine the new time points corresponding to the remaining reference time positions as reference time points based on the relative time between the preset time point, the time points corresponding to the remaining reference stay positions, and the conversion time point.
[0056] For example, if time point 1 corresponding to reference stay location 1 is 2021 / 10 / 21 10:00; time point 2 corresponding to reference stay location 2 is 2021 / 10 / 26 5:00; and time point 3 corresponding to reference stay location 3 is 2021 / 10 / 31 10:00, the data mining device arranges the time points corresponding to the reference stay locations included in the target cluster set in order of precedence, then performs a difference operation on time point 1 ranked first and time point 3, obtaining a relative time of 5 between time point 1 and time point 2. Similarly, the relative time of 10 between time point 1 and time point 3 is then obtained as 10. Time point 1 is then set to preset time point 0 as the initial time point. Based on the relative time of 5 between time point 1 and time point 2 and the preset time point 0, time point 2 can be determined to be 5, and based on the relative time of 10 between time point 1 and time point 3 and the preset time point 0, time point 2 can be determined to be 10. In this way, the time points corresponding to the reference stay locations can be converted into time points of different dimensions. For example, in this example, the time points corresponding to the reference stay locations are converted into time points with a day dimension.
[0057] In another embodiment, each cluster set corresponds to a reference position, which can be understood as the cluster center of the cluster set. The specific implementation method of determining the initial time point and multiple reference time points based on the time points corresponding to the reference stay positions included in the target cluster set can also be: setting the time point corresponding to the cluster center as a preset time point, and then calculating the relative time between the time points corresponding to the reference stay positions included in the target cluster set and the time points of the cluster center in sequence, and then converting the relative time between the time points corresponding to each reference stay position and the time points of the cluster center to obtain the conversion time points corresponding to each reference stay position. Then, the initial time point and the reference time point are determined from the conversion time points corresponding to each reference stay location. For example, time point 1 corresponding to reference stay location 1 is 2021 / 10 / 21 10:00; time point 2 corresponding to reference stay location 2 is 2021 / 10 / 26 5:00; time point 3 corresponding to reference stay location 3 is 2021 / 10 / 31 10:00; and the time point corresponding to the cluster center is 2021 / 10 / 21 10:00. The data mining device then calculates the relative time between time point 1 and the time point corresponding to the cluster center as 0; the relative time between time point 2 and the time point corresponding to the cluster center is 5; and the relative time between time point 3 and the time point corresponding to the cluster center is 10. The relative time between the time point corresponding to each reference stay location and the time point of the cluster center is then converted to obtain the conversion time point corresponding to each reference stay location. The conversion time point corresponding to time point 1 is 0, the conversion time point corresponding to time point 2 is 5, and the conversion time point corresponding to time point 3 is 10. Then, the initial time point and multiple reference time points are determined from the conversion time points corresponding to each reference stay position, that is, the initial time is 0, and the multiple reference time points are time point 5 and time point 10. It should be noted that the time point corresponding to the cluster center can be set as required. For example, the time point corresponding to the cluster center can be set to time point 1 corresponding to reference stay position 1.
[0058] Among them, the specific implementation method of obtaining the trajectory data of the target object can be: using a data acquisition device equipped with GPS (Global Positioning System) positioning technology to collect the initial trajectory data of the target object. Among them, when the target object is a user, the initial trajectory data is obtained with the user's authorization. As an implementation method, the initial trajectory data can be used to directly determine the trajectory data of the target object. As another implementation method, considering that the initial trajectory data is collected by the device, noise points may be caused to a certain extent due to device reasons. As for the noise points in the initial trajectory data caused by device reasons, they are often quite different from the position of the last recorded trajectory position, for example Figure 3cIn the figure on the left, a noise point 43 appears. Therefore, the speed between two adjacent trajectory positions can be used to determine whether the trajectory position is a noise point. In an embodiment of the present application, the initial trajectory data includes multiple initial trajectory positions. For a target initial trajectory position among the multiple initial trajectory positions, an adjacent initial trajectory position adjacent to the target initial trajectory position can be determined from the multiple initial trajectory positions, and a time difference is determined based on the time point corresponding to the target initial trajectory position and the time point of the adjacent initial trajectory position. Then, the speed of the target initial trajectory position is obtained based on the time difference and the distance between the target initial trajectory position and the adjacent initial trajectory position. The number of adjacent initial trajectory positions adjacent to the target initial trajectory position can be one or more. When there are multiple adjacent initial trajectory positions, one adjacent initial trajectory position can be determined from the multiple adjacent initial trajectory positions. Optionally, the speed of the target initial trajectory position can be calculated using each adjacent initial trajectory position in the above method. After each initial trajectory position is calculated according to the above method for calculating the speed of the target initial trajectory position, the initial trajectory position corresponding to the speed less than or equal to the set speed threshold can be retained, and then the retained initial trajectory positions are connected to generate the trajectory data of the target object. In some embodiments, when the speed of a certain trajectory position is greater than a set speed threshold, the trajectory position is marked as a noise point and the noise point is removed from the initial trajectory data to obtain the trajectory data of the target object. Figure 3c In the figure, the initial trajectory data includes a noise point 43. The data mining device can remove the noise point 43 and connect the retained initial trajectory positions to generate the trajectory data of the target object. That is, the trajectory data of the target object is the trajectory data shown in the right figure.
[0059] S202: Obtain a candidate set of cycles corresponding to the time set. The candidate set of cycles includes one or more candidate cycles. The candidate cycles meet a cycle length condition and / or the number of occurrences of the candidate cycles in the time set exceeds a threshold. The cycle length condition and the threshold can be set as required.
[0060] In one embodiment, the cycle candidate set may be one or more candidate cycles set according to preset conditions. The preset conditions may include that the candidate cycle satisfies a cycle length condition and / or that the number of occurrences of the candidate cycle in the time set exceeds a threshold. The data mining device can then directly obtain the cycle candidate set corresponding to the time set. That is, any candidate cycle in the cycle candidate set satisfies the cycle length condition and / or the number of occurrences of any candidate cycle in the time set exceeds the threshold.
[0061] In another embodiment, since the time set is subsequently subjected to periodic mining, in order to reduce the complexity of the mining cycle, the data mining device can determine a set of period candidates based on the difference between any two time points in the time set and preset conditions. The data mining device can use the difference between any two time points in the time set as the initial candidate period. For example, the time set includes time point 1, time point 2, and time point 3, the difference between time point 1 and time point 2 is 5, the difference between time point 2 and time point 3 is 5, and the difference between time point 3 and time point 1 is 10. The initial candidate periods are 5, 5, and 10. Then, based on the preset conditions, multiple initial candidate periods are screened to obtain candidate periods, and the candidate periods are added to the candidate period set.
[0062] As an implementation method, the preset condition is that the candidate cycle satisfies the cycle length condition. Based on the preset condition, multiple initial candidate cycles are screened to obtain the candidate cycles. Specifically, the data mining device can determine whether the initial candidate cycles meet the cycle length condition. If the initial candidate cycles meet the cycle length condition, the initial candidate cycles that meet the cycle length condition are selected as candidate cycles. For example, if the initial candidate cycle is 7 and the cycle length condition is a cycle length of 6-8, and the data mining device determines that initial candidate cycle 7 meets the cycle length of 6-8, then initial candidate cycle 7 is selected as the candidate cycle.
[0063] As another implementation, the preset condition is that the number of occurrences of a candidate cycle in the time set is greater than a threshold number of occurrences. A specific implementation method for screening multiple initial candidate cycles based on the preset condition to obtain candidate cycles is as follows: the data mining device can count the number of occurrences of each initial candidate cycle in the time set, determine whether the number of occurrences of each initial candidate cycle in the time set is greater than the threshold number of occurrences, and then determine the initial candidate cycles whose number of occurrences is greater than the threshold number of occurrences as candidate cycles. For example, if the initial candidate cycles are 5, 5, and 10, the data mining device can count the number of occurrences of initial candidate cycle 5 in the time set as 2, and the number of occurrences of initial candidate cycle 10 in the time set as 1. The data mining device determines that the number of occurrences of initial candidate cycle 5 in the time set is greater than the threshold number of occurrences 1, and selects initial candidate cycle 5 as a candidate cycle.
[0064] As another implementation method, in order to screen accurate candidate cycles, the preset condition may be that the candidate cycle meets the cycle length condition, and when the number of occurrences of the candidate cycle in the time set is greater than the number threshold, multiple initial candidate cycles are screened based on the preset condition, and the specific implementation method for obtaining the candidate cycle is: all initial candidate cycles that meet the cycle length condition are used as reference candidate cycles; the number of occurrences of each reference candidate cycle in the time set is counted, and the reference candidate cycle whose number of occurrences is greater than the number threshold is used as the candidate cycle.
[0065] S203: Obtaining period mining parameters. The period mining parameters include one or more of the following: a period offset parameter and a period missing parameter. The period offset parameter is used to address period offset issues during periodic mining of time sets; the period missing parameter is used to address period missing issues during periodic mining of time sets. The period missing parameters may include a continuous period missing threshold and a total period missing threshold. Introducing the continuous period missing threshold and the total period missing threshold facilitates periodic mining of time sets and the generation of periodic sequences.
[0066] S204: Based on the period mining parameters and the period candidate set, period mining is performed on the time set to obtain a period sequence of the target object visiting the target location. The number of the period sequence of the target object visiting the target location can be one or more.
[0067] In a specific implementation, after obtaining the cycle candidate set, periodic mining can be performed on the time set based on the cycle mining parameters and each candidate cycle in the cycle candidate set to obtain the cycle sequence of the target object visiting the target location under each candidate cycle.
[0068] In one embodiment, a specific implementation method for periodically mining a time set based on period mining parameters and a cycle candidate set to obtain a periodic sequence of target objects accessing a target location can be: first, select a target candidate period for polling from the cycle candidate set; then, periodically mine the time set based on the target candidate period and the period mining parameters to obtain a periodic sequence of target objects accessing a target location; and then continue to select the next target candidate period for polling from the cycle candidate set. When a preset number of candidate periods in the cycle candidate set are determined as target candidate periods, polling is stopped. The data mining device can randomly select target candidate periods for polling from the cycle candidate set, or sequentially select candidate periods with the shortest period length that have not been used for polling from the cycle candidate set as target candidate periods. The preset number can be set as needed. The preset number of candidate periods can be part of the candidate periods in the cycle candidate set, or the preset number of candidate periods can be all of the candidate periods in the cycle candidate set. For example, if the cycle candidate set includes five candidate periods, when the preset number is two, any two candidate periods in the cycle candidate set are determined as target candidate periods, and polling is stopped. For another example, when the preset number is 5, all 5 candidate cycles in the cycle candidate set are determined as target candidate cycles, and polling is stopped at this time.
[0069] In one embodiment, a specific implementation method for periodically mining a time set based on target candidate cycles and cycle mining parameters to obtain a periodic sequence of target objects accessing a target location is as follows: a data mining device may determine a mining start time point from the time set, and starting from the mining start time point, determine one or more target mining time points from the time set based on the target candidate cycles and cycle mining parameters. When periodic mining of the time set based on the target candidate cycles and cycle mining parameters is stopped, the mining start time point and the one or more target mining time points may be combined into a periodic sequence of target objects accessing a target location. For example, if the mining start time point is 0 and the target mining time points are 5 and 10, the data mining device may combine the mining start time point and the one or more target mining time points into a periodic sequence of target objects accessing a target location, "0-5-10."
[0070] Among them, starting from the mining start time point, a specific implementation method for determining one or more target mining time points from the time set based on the target candidate cycle and the cycle mining parameters can be: fixing the mining time point (or cycle position or cycle time point) under normal circumstances based on the target candidate cycle and the mining start time point, for example, the mining start time point is 0, the target candidate cycle is 5, and the cycle time points under normal circumstances are determined to be 0, 5, 10, etc. based on the target candidate cycle and the mining start time point. Then, the data mining device searches for the first mining time point (i.e., the cycle time point under normal circumstances) and the mining offset time point from the time set based on the target candidate cycle, the cycle missing parameter, and / or the cycle offset parameter, and uses the first mining time point and the mining offset time point successfully found under normal circumstances from the time set as the target mining time point. For example, if the data mining device successfully finds the first mining time point 5 from the time set based on the target candidate cycle, the cycle missing parameter, and / or the cycle offset parameter, and successfully finds the offset mining time point 9 from the time set, the first mining time point 5 and the offset mining time point 9 can be used as the target mining time point. Normal means that the difference between the mining time points in the mined period sequence meets the target candidate period. By fixing the mining time points under normal circumstances, the problem of overall deviation of the period sequence obtained by period mining can be solved.
[0071] In one embodiment, after obtaining the mining start time point and one or more target mining time points, to ensure the length and quality of the periodic sequence, the data mining device may determine the number of time points in the periodic sequence based on the mining start time point and the one or more target mining time points. If the number of time points is greater than or equal to a threshold, the mining start time point and the one or more target mining time points may be combined into a periodic sequence of the target object accessing the target location. If the number of time points is less than the threshold, the mining start time point and the one or more target mining time points are discarded, and the next target candidate period for polling is selected from the period candidate set.
[0072] In one embodiment, after obtaining a periodic sequence of a target object visiting a target location, the data mining device may analyze the periodic sequence and determine data associated with the target location and / or target object based on the analysis results, and output the data associated with the target location based on the period length in the periodic sequence. For example, the target object is a typhoon, the target location is Shenzhen, and the periodic sequence of a typhoon visiting the target location is 0-10-19. The data mining device analyzes the periodic sequence and determines that a typhoon visits Shenzhen every 9.5 days. The data mining device may then obtain information related to the typhoon and output the information related to the typhoon with a period length of 9.5 days, i.e., outputting information related to the typhoon every 9.5 days. The information related to the typhoon may be typhoon precautions. Alternatively, the information related to the typhoon may be output every 10 days.
[0073] In an embodiment of the present application, a data mining device can obtain a time set in which a target object visits a target location; and obtain a period candidate set corresponding to the time set, wherein the period candidate set includes one or more candidate periods, the candidate periods satisfy a period length condition, and / or the number of occurrences of the candidate periods in the time set is greater than a number threshold; obtain period mining parameters, wherein the period mining parameters include one or more of the following: a period offset parameter and a period missing parameter; based on the period mining parameters and the period candidate set, periodic mining is performed on the time set to obtain a period sequence in which the target object visits the target location. The period length condition and the number threshold can be used to screen out a suitable candidate period set, without having to obtain all candidate periods for periodic mining of the time set, thereby reducing the workload of period mining and improving the efficiency of period sequence mining.
[0074] Based on the above data cycle mining solution, please refer to Figure 4 , Figure 4 The following is a flow chart of a data cycle mining method provided in an embodiment of the present application. The data cycle mining method can be executed by a data mining device. The data cycle mining method can include the following steps S401-S406:
[0075] S401: Obtain a time set when a target object visits a target location.
[0076] S402: Acquire a cycle candidate set corresponding to the time set, where the cycle candidate set includes one or more candidate cycles, the candidate cycles satisfying a cycle length condition, and / or the number of occurrences of the candidate cycles in the time set is greater than a number threshold.
[0077] S403: Obtain cycle mining parameters, which include one or more of the following: a cycle offset parameter and a cycle missing parameter, wherein the cycle missing parameter may include a cycle continuous missing threshold and a total missing threshold.
[0078] The specific implementation of the above steps S401-S403 can be found in Figure 2 The specific implementation of steps S201-S203 will not be repeated here.
[0079] S404: Select a target candidate cycle for polling from the cycle candidate set.
[0080] In one embodiment, a target candidate cycle for polling may be randomly selected from the cycle candidate set, or a candidate cycle with the shortest cycle length that has not been used for polling may be sequentially selected from the cycle candidate set as a target candidate cycle. In another embodiment, one or more candidate cycles included in the cycle candidate set may be sorted from short to long or from long to short according to cycle length, and the target candidate cycles for polling may be selected sequentially according to the sorting results. Each candidate cycle included in the cycle candidate set will be used as a target candidate cycle.
[0081] S405 , based on the target candidate cycle and the cycle mining parameters, periodically mining the time set to obtain a cycle sequence of the target object accessing the target location, and continuously selecting the next target candidate cycle for polling from the cycle candidate set.
[0082] In one embodiment, step S405 may be implemented by traversing the time set in chronological order to obtain a mining start time point; and starting from the mining start time point, determining one or more target mining time points from the time set based on the periodic mining parameters and the target candidate period; when periodic mining of the time set based on the target candidate period and the periodic mining parameters is stopped, the mining start time point and the one or more target mining time points may be combined into a periodic sequence of the target object visiting the target location. In a specific implementation, the mining start time point and the one or more target mining time points may be arranged and combined in chronological order to obtain a periodic sequence of the target object visiting the target location.
[0083] In which, the data mining device can add identification information to all time points included in the time set before performing periodic mining on the time set based on the target candidate cycle and the periodic mining parameters to obtain the periodic sequence of the target object visiting the target location. The identification information can include any one of a first identifier and a second identifier, the first identifier is used to indicate a time point that has been mined, and the second identifier is used to indicate a time point that has not been mined. By adding identification information to the time points included in the time set, repeated mining of time points that have already been mined can be avoided. On the one hand, it can prevent the mining of periodic patterns with extremely high similarity, and on the other hand, it can greatly reduce the amount of calculation, reduce the time complexity of pattern mining by an exponential, and accelerate the mining of periodic sequences. In which, the first identifier and the second identifier can be numbers, for example, the first identifier is 0 and the second identifier is 1; or the first identifier and the second identifier can be letters, such as the first identifier is A and the second identifier is B, or for example, the first identifier is True and the second identifier is Fasle. This application is not limited to this.
[0084] At this time, the data mining device traverses the time set in the order of the time points to obtain the mining start time point. The specific implementation method can be: traverse the time set in the order of the time points to obtain the currently traversed time point; if the identification information corresponding to the currently traversed time point is the second identification, then the currently traversed time point is determined as the mining start time point, and the identification information corresponding to the currently traversed time point is updated from the second identification to the first identification. In an embodiment of the present application, before periodically mining the time set, all time points included in the time set can be marked with the second identification, that is, the time points included in the time set have not been mined.
[0085] The specific implementation method of the data mining device starting from the mining start time point and determining one or more target mining time points from the time set based on the period mining parameters and the target candidate period may include steps s11-s13:
[0086] s11. Determine a first mining time point based on the mining start time point and the target candidate period.
[0087] In a specific implementation, the data mining device can determine the first mining time point under normal circumstances based on the mining start time point and the target candidate period. That is, the data mining device can sum the mining start time point and the target candidate period to obtain the first mining time point. For example, if the mining start time point is 0, the target candidate period is 5, and the time set is [0, 5, 9, 20], the data mining device can sum the mining start time point 0 and the target candidate period 5 to obtain the first mining time point as 5.
[0088] s12. Search for the first mining time point from the time set. In one embodiment, the data mining device can directly search for the first mining time point from the time set. In another embodiment, the time point in the time set can be passed into the dictionary as a key value, and the value corresponding to the key can be a first identifier or a second identifier, and the value corresponding to the key indicates whether the time point at the location has been mined. The data mining device can then search for the first mining time point in the dictionary with a complexity of O(1). Storing the time set in the form of a dictionary allows for quick search, thereby reducing the search time.
[0089] In a specific implementation, the data mining device can search for a first mining time point in the time set. If the first mining time point is successfully found in the time set, the first mining time point can be determined as the target mining time point, and the next first mining time point can be determined based on the mining start time point and the target candidate period. Specifically, determining the next first mining time point based on the mining start time point and the target candidate period can be achieved by summing the mining start time point and the two target candidate periods to obtain the next first mining time point. For example, if the mining start time point is 0 and the target candidate period is 5, then the data mining device sums the mining start time point and the two target candidate periods to obtain the next first mining time point as 10, i.e., 0+2*5=10. Alternatively, the data mining device can determine the next first mining time point as 10 based on the current first mining time point and the target candidate period, i.e., 5+5=10. If the data mining device does not find the first mining time point in the time set, step s13 is executed.
[0090] In one embodiment, as can be seen from the above, the time points included in the time set all correspond to identification information; if the first mining time point is successfully found in the time set, the specific implementation method of determining the first mining time point as the target mining time point can be: if the first mining time point is successfully found in the time set, and the identification information corresponding to the first mining time point is the second identification, the identification information corresponding to the first mining time point is the second identification, which means that the first mining time point has not been mined, then the data mining device can use the first mining time point as the target mining time point.
[0091] If the first mining time point is successfully found in the time set, and the identification information of the first mining time point is the first identification, which means that the first mining time point has been mined, the data mining device skips the first mining time point and determines the next first mining time point based on the mining start time point and the target candidate period.
[0092] s13. If the first mining time point is not found, one or more target mining time points are determined from the time set based on the first mining time point, the period mining parameters, and the target candidate period. The period mining parameters include one or more of the following: a period offset parameter and a period missing parameter.
[0093] In a specific implementation, if the first mining time point is not found in the time set, it is considered that the time set has period offset and / or period missing problems. The data mining device can determine one or more target mining time points from the time set based on the first mining time point, the target candidate period and the period mining parameters.
[0094] In one embodiment, the periodic mining parameters include periodic offset parameters. A specific implementation method for determining one or more target mining time points from a time set based on a first mining time point, periodic mining parameters, and a target candidate period may be: a data mining device may determine a periodic offset time length based on the periodic offset parameters and the target candidate period, and then determine an offset mining time point based on the periodic offset time length and the first mining time point, and search for the offset mining time point from the time set: (1) if an offset mining time point is found from the time set, the offset mining time point is used as the target mining time point, and the next first mining time point is determined based on the mining start time point and the target candidate period. (2) If no offset mining time point is found from the time set, it is considered that there is a cycle missing problem. At this time, the cycle mining parameters may also include cycle missing parameters, which may include: a cycle continuous missing threshold and a cycle total missing threshold, wherein the number of consecutive cycle missing times is used to record the number of consecutive cycle missing times of the current cycle, and the cycle continuous missing threshold and the comparison can be used to control together so that when the number of consecutive cycle missing times is greater than the cycle continuous missing threshold, the time set is stopped from being periodically mined based on the target candidate cycle and the cycle mining parameters, and it can also be used as a stop sign for cycle sequence mining. The total number of cycle missing times records the total number of missing times of the current cycle, and is controlled together with the cycle total missing threshold comparison so that when the total number of cycle missing times is greater than the cycle total missing threshold, the time set is stopped from being periodically mined based on the target candidate cycle and the cycle mining parameters.
[0095] If the offset mining time point is not found in the time set, the number of consecutive cycle missing times and the total number of cycle missing times are updated, and it is determined whether the updated number of consecutive cycle missing times is greater than the consecutive cycle missing threshold, and whether the updated total number of cycle missing times is greater than the total cycle missing threshold. If the updated number of consecutive cycle missing times is less than or equal to the consecutive cycle missing threshold, and the updated total number of cycle missing times is less than or equal to the total cycle missing threshold, the data mining device can determine a second mining time point based on the first mining time point and the target candidate cycle, and use the second mining time point as the first mining time point to continue searching for the target mining time point. Specifically, the data mining device can perform a sum operation on the first mining time point and the target candidate cycle to obtain the second mining time point, and use the second mining time point as the first mining time point to execute steps s12 and s13.
[0096] If the updated number of consecutive missing cycles is greater than the consecutive missing cycle threshold and / or the updated total number of missing cycles is greater than the total missing cycle threshold, the periodic mining of the time set based on the target candidate cycle and the mining start time point is stopped. In some embodiments, when the updated number of consecutive missing cycles is greater than the consecutive missing cycle threshold and / or the updated total number of missing cycles is greater than the total missing cycle threshold, it can be used as a stop sign for period sequence mining. By introducing the consecutive missing cycle threshold δ l and the total missing cycle threshold δ t The missing position (or missing time) is skipped, so as to conduct subsequent periodic mining of the time set. l Limit the length of continuous missing to not be too large, and the total missing threshold of period δ t The overall missing length is restricted to not be too large, so as to ensure the quality of the mined period sequence in the presence of period missing.
[0097] Among them, the above-mentioned cycle offset time length is positively correlated with the candidate cycle. That is, the larger the candidate cycle, the longer the cycle offset time length. In the embodiment of the present application, a cycle offset time length can be calculated for each candidate cycle in the cycle candidate set. The specific implementation method of determining the cycle offset time length based on the cycle offset parameter and the target candidate cycle can be to multiply the cycle offset parameter and the target candidate cycle to obtain the cycle offset time length. The cycle offset time length calculation formula is as follows: δ d =period*tolerance ratio , where the periodic offset time length is δ dThe period offset parameter is tolerance_ratio, and the target candidate period is period. For example, the candidate period set includes candidate periods 5 and 6, and the period offset coefficient is 0.2. The data mining device can multiply candidate period 5 by the period offset coefficient to obtain a period offset length of 1 for candidate period 5. Similarly, the period offset length for candidate period 6 can be calculated to be 1.2. By setting the period offset time to be positively correlated with the candidate period, which is in line with normal logic, a wider fluctuation range can be allowed when detecting longer candidate periods.
[0098] The specific implementation method of determining the offset mining time point based on the period offset time length and the first mining time point can be: summing the period offset time length and the first mining time point to obtain a sum value; performing a difference operation between the period offset time difference length and the first mining time point to obtain a difference value; determining the offset mining time point from the time point range formed by the sum value and the difference value, that is, in t∈x±δ d Determine the offset excavation time point within the range, where the offset excavation time point is t, the first excavation time point is x, and δ d is the period offset time length. For example, if the period offset time length is 1 and the first mining time point is 5, the data mining device can sum the period offset time length and the first mining time point to obtain a sum of 6, and subtract the period offset time length from the first mining time point to obtain a difference of 4. The data mining device then determines the offset mining time point from the time point range of 4-6.
[0099] It should be noted that the offset mining time point does not belong to the first mining time point under normal circumstances. For example, the target candidate period is 5, and the first mining time point under normal circumstances can be 0, 5, 10, 15, etc. The offset mining time point is 9, and the offset time point 9 does not belong to the first mining time point under normal circumstances. Therefore, after the offset mining time point is determined as the target mining time point, there is no need to update the identification information corresponding to the offset mining time point. When the time set can be mined with other candidate periods in the future, mining t=9 can just be the first mining time point under normal circumstances.
[0100] In one embodiment, as can be seen from the above, the number of consecutive cycle missings is used to record the number of consecutive cycle missings in the current cycle. Therefore, when steps s12 and s13 are executed after the second mining time point is used as the first mining time point to successfully find the first mining time point or successfully find the offset mining time point, it means that there is no problem of consecutive cycle missing at this time, and the data mining device can reset the updated number of consecutive cycle missings to 0.
[0101] In one embodiment, as can be seen from the above, the time points included in the time set all correspond to identification information. When the identification information corresponding to the time points in the time set are all first identifications, it means that the time points in the time set have all been mined, and the data mining device can stop periodically mining the time set based on the target candidate period and period mining parameters. In summary, if the updated number of consecutive missing cycles is greater than the consecutive missing cycle threshold, and / or the updated total number of missing cycles is greater than the total missing cycle threshold, and / or the identification information corresponding to the time points in the time set are all first identifications, then the data mining device can stop periodically mining the time set based on the target candidate period and period mining parameters.
[0102] In one embodiment, when the periodic mining parameters include a period missing parameter, if the first mining time point is not found in the time set, the first mining time point is directly determined to be missing, without searching for an offset mining time point. If the first mining time point is not found, determining one or more target mining time points from the time set based on the first mining time point, the periodic mining parameters, and the target candidate period can also be specifically implemented by: updating the number of consecutive period missing times and the total number of period missing times; if the updated number of consecutive period missing times is less than or equal to a consecutive period missing threshold and the updated total number of period missing times is less than or equal to a total period missing threshold, determining a third mining time point based on the first mining time point and the target candidate period; and determining one or more target mining time points from the time set based on the third mining time point, the periodic mining parameters, and the target candidate period. In this case, the third mining time point can be considered the new first mining time point. The specific implementation of determining one or more target mining time points from the time set based on the third mining time point, the periodic mining parameters, and the target candidate period can be found in the specific implementation of steps s12 and s13 above and will not be repeated here.
[0103] S406. When a preset number of candidate cycles in the cycle candidate set are determined as target candidate cycles, polling is stopped. The preset number can be set as needed. The preset number of candidate cycles can be part of the candidate cycles in the cycle candidate set, or the preset number of candidate cycles can be all the candidate cycles in the cycle candidate set. For example, the cycle candidate set includes 5 candidate cycles. When the preset number is 2, any 2 candidate cycles in the cycle candidate set are determined as target candidate cycles, and polling is stopped at this time. For another example, when the preset number is 5, all 5 candidate cycles in the cycle candidate set are determined as target candidate cycles, and polling is stopped at this time.
[0104] In an embodiment of the present application, a data mining device can obtain a time set of a target object accessing a target location, obtain a period candidate set corresponding to the time set, the period candidate set including one or more candidate periods, the candidate period meeting a period length condition, and / or the number of occurrences of the candidate period in the time set being greater than a number threshold; obtain period mining parameters, the period mining parameters including one or more of the following: a period offset parameter and a period missing parameter; select a target candidate period for polling from the period candidate set; based on the target candidate period and the period mining parameters, perform periodic mining on the time set to obtain a period sequence of the target object accessing the target location, and continue to select the next target candidate period for polling from the period candidate set; when all candidate periods in the period candidate set are determined to be target candidate periods, stop polling. Using the period length condition and the number threshold, a suitable candidate period can be obtained, without obtaining all candidate periods for periodic mining of the time set, which can improve the efficiency and accuracy of periodic mining of the time set. At the same time, introducing one or more of the period offset parameter and the period missing parameter included in the period mining parameters can overcome the problem of period offset or period missing in the time set, thereby improving the accuracy of period sequence mining. And by polling, we can get the periodic sequence of the target object accessing the target location in each candidate period.
[0105] Based on the data cycle mining method provided in the embodiment of the present application, the embodiment of the present application also provides a more specific data cycle mining method, see Figure 5 , Figure 5 The process of the data cycle mining method shown mainly includes: trajectory data denoising, stay point detection, stay point clustering, statistical time set, generation of cycle candidate set, and mining cycle sequence (or cycle pattern).
[0106] (1) The initial trajectory data of the target object is collected by a data acquisition device, and the initial trajectory data is denoised, that is, the noise points caused by the data acquisition device are removed to obtain the trajectory data of the target object. The initial trajectory data includes multiple initial trajectory positions. Specifically, the speed between two adjacent trajectory positions can be used to determine whether a certain initial trajectory position is a noise point. For the target initial trajectory position in the trajectory data, the adjacent initial trajectory positions adjacent to the target initial trajectory position can be determined in the initial trajectory data, and the speed of the target initial trajectory position can be calculated based on the distance and time difference between the target initial trajectory position and the adjacent initial trajectory position. According to the calculation method of the speed of the target initial trajectory position, the speed of each initial trajectory position can be determined, and the initial trajectory position corresponding to the speed greater than the speed threshold is marked as a noise point and removed from the initial trajectory data. The initial trajectory positions retained in the initial trajectory data are used to generate the trajectory data of the target object.
[0107] (2) After the initial trajectory data is denoised and the trajectory data of the target object is obtained, the trajectory position included in the trajectory data can be detected as a stay point. The stay position refers to: the time spent at a certain position is relatively long, or the target object does not exceed the neighborhood range of the entry position within a continuous period of time. In an embodiment of the present application, a position stay screening condition is introduced to screen out reference stay positions from the trajectory positions included in the trajectory data. The position stay screening condition is that the time length of the target object in the preset area formed by the target trajectory position is greater than the preset time length. The data mining device can obtain one or more reference stay positions that meet the position stay screening condition from the multiple trajectory positions included in the trajectory data. For example, the time length of the target object at the north gate of the supermarket is 1 hour, which is greater than the preset time length. The north gate of the supermarket can be determined as a reference stay position. The specific implementation method of the data mining device to obtain one or more reference stay positions that meet the position stay screening condition from the multiple trajectory positions included in the trajectory data can refer to the specific implementation method of the corresponding part above, which will not be repeated here.
[0108] (3) After obtaining one or more reference stay locations, according to the characteristics of the spatiotemporal trajectory data, one or more reference stay locations may belong to the same reference stay location. For example, the reference stay locations of the south gate of the store and the north gate of the store both belong to the store. The data mining device can select the density-based clustering method DBSCAN to perform cluster analysis on one or more reference stay locations according to the characteristics of the spatiotemporal trajectory data to obtain multiple cluster sets, each cluster set corresponding to a reference location, and assign a corresponding cluster label to the reference stay locations included in each cluster set, which can be a reference location. For example, cluster analysis is performed on the reference stay locations of the south gate of the store and the north gate of the store to obtain a cluster set, which corresponds to the store. The cluster label "store" is added to the south gate of the store and the north gate of the store included in the cluster set. Through clustering, the trajectory data of the object can be converted into a sequence of cluster centers.
[0109] (4) Obtaining the time set corresponding to each cluster set: For a target cluster set among multiple cluster sets, the time point of the cluster center corresponding to the target cluster set can be determined (i.e., a preset time point), and the relative time between the time point of the cluster center and the time point of the reference stay position included in the target cluster set is calculated. The relative time between the time point of the cluster center and the time point of the reference stay position is converted to obtain the conversion time point corresponding to the reference stay position, and added to the time set corresponding to the target cluster set. The time set corresponding to each cluster set can be determined in the same manner as that of obtaining the time set corresponding to the target cluster set. Optionally, after converting the relative time between the time point of the cluster center and the time point of the reference stay position to obtain the conversion time point corresponding to the reference stay position, the conversion time point corresponding to the reference stay position can be deduplicated, and the deduplicated conversion time point is added to the time set. By deduplicating, it can be better ensured that the time points included in the time set reach the cluster center of the cluster set at most once. For example, among the conversion time points corresponding to the reference stay position, there are two time points 1 corresponding to the reference stay position 1. In this case, the two time points 1 corresponding to the reference stay position 1 are deduplicated. It should be noted that the specific implementation method for obtaining the time set corresponding to each cluster set can be referred to the above method for obtaining the time set corresponding to the target cluster set. The time set corresponding to each cluster set can be understood as the time set of the target object accessing each reference location. For example, if cluster set 1 corresponds to reference location 1, the time set corresponding to cluster set 1 can be understood as the time set of the target object accessing reference location 1.
[0110] (5) Determine the candidate period set corresponding to each time set. From (4), we can see that each cluster set corresponds to a time set. You can select a specified cluster set and obtain the time set corresponding to the cluster set. Then, the time points included in the time set are relative_time_set. The differences between any two time points in the time set are traversed and used as initial candidate periods. For example, time point 1 is time_1 and time point 2 is time_2. If the initial candidate period time_interval = time_2 – time_1 satisfies the preset period length range (i.e., satisfies the above-mentioned period length condition), the initial candidate period time_interval is used as a reference candidate period, and the number of occurrences of the reference candidate period in the time set, rep(time_interval), is incremented by 1. In this manner, one or more reference candidate periods and the number of occurrences of each reference candidate period in the time set can be obtained. The data mining device can filter out reference candidate periods time_intervals whose number of occurrences rep(time_interval) is less than or equal to the number threshold min_sup, and treat the reference candidate periods time_intervals that are not filtered out as candidate periods and add them to the period candidate set period_candidates. Each candidate period in the period candidate set period_candidates corresponds to two pieces of information: a cluster center and a period length. By traversing the time set corresponding to each cluster set, the period candidate set corresponding to each time set can be obtained.
[0111] (6) Mining period sequences: Through step (5), multiple period candidate sets period_candidates can be obtained. For the target period candidate set in the multiple period candidate sets, the time set relative_time_set corresponding to the target candidate period period_candidates is obtained, and a target candidate period period_candidate is selected from the target period candidate set. For ease of understanding, the following example mines period sequences using the time set [0, 5, 9, 20]:
[0112] a. First, pass the time points in the time set [0, 5, 9, 20] as key values into the dictionary time_visited. The value corresponding to the key indicates whether the time point has been mined as a time point on the period axis. This value can be a flag, which can include a first flag, True, or a second flag, False. When the value is True, it indicates that the time point has been mined as a time point on the period axis. When the value is False, it indicates that the time point has not been mined as a time point on the period axis. Then, initialize the value corresponding to each key in the time set to False, that is, {0: False, 5: False, 9: False, 20: False}.
[0113] b. Traverse each time point in the time set to obtain the current traversal time point t0; if the current traversal time point t0 has not been mined before at a time point on the period axis, then the current traversal time point t0 is determined as the mining start time point t0, for example, Figure 6a As shown, the current traversal time point t0 = 0, which has not been mined before at a time point on the period axis. The current traversal time point t0 = 0 is used as the mining start time point. The identification information corresponding to t0 = 0 is then updated from the second identification False to the first identification True. Mining then begins from the mining start time point t0. If the current traversal time point t0 has already been mined at a time point on the period axis, the current traversal time point t0 is skipped to avoid repeated mining. Then, the traversal continues to other time points in the time set and determines whether they have been mined at a time point on the period axis in the same manner as described above.
[0114] c. Get the target candidate period from the candidate period set and start mining from the mining start time point t0. Assume t0 = 0 and period = 5 as an example. In a normal period sequence, the time when the next event occurs should be t = t0 + period = 5. Then, in the dictionary time_visited, use the event complexity of O(1) to find whether there is a time point t = 5. If it exists and t = 5 has not been mined before on the period axis, such as Figure 6b As shown, t=5 is selected as the target mining time point and added to the period sequence time_seq. At this time, the identification information corresponding to t=5 is updated from the second identification False to the first identification True. And backward mining is continued, that is, the time set is mined backward with t=5 and period=5.
[0115] d. In the normal cycle sequence, the time point at which the next event occurs should be t = t + period = 10. Look in the dictionary time_visited to see if there is a time point t = 10. If it does not exist in the dictionary time_visited, then the offset mining time length δ can be determined based on the cycle offset parameter and the target candidate cycle. d , that is, δ d =period*δ d_tolerance_ratio =5*0.2=1. The offset mining time point is determined based on the offset mining time length and the offset mining time length, that is, the offset mining time point is t∈10±δ d time point in the range. Then according to t∈10±δ d Look up the dictionary time_visited to see if there is an offset mining time point. If there is an offset mining time point 9∈[10-δ d ,10+δ d ], then add t=9 as the target mining time point to the periodic sequence time_seq, such as Figure 6c As shown, in this case, the identification information corresponding to t = 9 is not updated. This allows the mining of period sequences with other candidate period lengths to find the period sequence exactly on the period axis. Mining is then continued on the time set with t = 10 and period = 5. By introducing the period offset parameter, the effect of the period offset can be resolved, allowing the correct detection of t = 9 in the period sequence.
[0116] e. After processing in step d, the time when the next event occurs in the normal periodic sequence should be t=t+period=15. Check whether there is a time point of t=15 in the dictionary time_visited. If there is no time point of t=15 in the dictionary time_visited, continue based on t∈15±δ d The range is to find out whether there is an offset mining time point from the dictionary time_visited. If it is based on t∈15±δ d The range does not exist in the dictionary time_visited offset mining time point, such as Figure 6d As shown, the value of the number of consecutive periodic missing times num_consecutive_gap and the total number of periodic missing times num_total_gap is recorded plus 1, and it is determined whether the number of consecutive periodic missing times num_consecutive_gap is less than or equal to the consecutive periodic missing threshold δ l And whether the total number of cycle gaps num_total_gap is less than or equal to the total cycle gap threshold δ t ; If the number of consecutive missing cycles num_consecutive_gap≤δ lAnd the total number of cycle gaps num_total_gap≤δ t , then skip t=15 and continue to mine the time set backward. In a normal periodic sequence, the time when the next event occurs should be t=t+period=20. Look in the dictionary time_visited to see if there is a time point t=20. If there is a time point t=20 in the dictionary time_visited and the identification information corresponding to t=20 is the second identification, such as Figure 6e As shown, t = 20 is added as the target mining time point to the period sequence time_seq, and the identification information corresponding to t = 20 is updated from the second identification False to the first identification True. By introducing the period continuous missing parameters and the total missing parameters, the impact of period missing can be resolved, so that t = 20 after the missing period is detected.
[0117] Among them, num_consecutive_gap records the number of consecutive gaps in the current cycle, which can be combined with δ l The contrasting common control stops mining when the number of consecutive missing cycles is greater than the cycle consecutive missing threshold and can be used as a stop sign for period sequence mining. For example, when the cycle consecutive missing parameter δ is set l When num_consecutive_gap>δ l Stop digging when Figure 6f and Figure 6g As shown, in Figure 6f In the example, when mining the time set, the number of consecutive missing cycles is found to be 2. This means that time points 10 and 15 do not exist at the normal time points 10 and 15, nor do they exist at the offset mining time points. At this point, the number of consecutive missing cycles exceeds the consecutive missing cycle threshold, so mining the time set based on the target candidate cycle and cycle mining parameters is stopped. Figure 6g When the number of consecutive missing cycles is greater than the consecutive missing cycle threshold, the final target mining time point (such as Figure 6g t=15) is used as the stop sign of period sequence mining. When the time point of the period sequence is successfully mined in the dictionary next time, num_consecutive_gap will be reset to 0. num_total_gap records the total number of missing cycles in the current period, and the total number of missing cycles and the total missing cycle threshold δ t Contrast the common control so that when the total number of missing times is greater than the total missing period threshold, the mining of the time set based on the target candidate period and period mining parameters is stopped. When the total missing number parameter δ t When set to 2, Figure 6h If the total number of missing cycles is 3, the mining of the time set based on the target candidate cycle and cycle mining parameters is stopped.
[0118] f. After stopping the periodic mining of the time set based on the target candidate cycle and the periodic mining parameters, count the number of time points included in the periodic sequence time_seq of the current record. If the number of time points included in the periodic sequence time_seq of the current record is greater than the number threshold min_sup, the periodic sequence time_seq of the current record is determined to be a periodic sequence. If the number of time points included in the periodic sequence time_seq of the current record is greater than the number threshold min_sup, the periodic sequence time_seq of the current record is discarded. It should be noted that the specific implementation method of periodically mining the time set based on the target candidate cycle to obtain the periodic sequence can be to periodically mine the time set based on each candidate cycle in the periodic candidate set to obtain the periodic sequence. At this time, the number of periodic sequences can be one or more. The events involved above can be the target object visiting the target location, etc. It should be noted that, Figure 6a-6h In the example, "T" represents the first flag True. Figure 6a-6h “F” is used to represent the second identifier Flase.
[0119] The above steps af can use the following pseudo code to obtain the periodic sequence of the time set.
[0120]
[0121]
[0122] In one embodiment, in addition to the following examples, Figure 5 The data cycle mining method shown in the figure realizes period sequence mining. It can also include the following two methods: SMCA algorithm and MBPM algorithm.
[0123] The SMCA algorithm first calculates the time interval information (time_interval) between all event occurrences. From this interval information, intervals with a frequency greater than a threshold are counted as a candidate set of potential cycle lengths. Then, possible cycle lengths p are selected one by one from the candidate set. Time points are selected from all event occurrences as the starting point t0 for periodic pattern mining. Starting from t0, the algorithm searches for subsequent time points that meet the conditions t = t0 + np, n = 1, 2, 3, etc., where n must be a continuous value. This results in a periodic pattern of {t, t+p, t+2p, …, t+np}. The mined pattern strictly follows the periodic law.
[0124] Using the SMCA algorithm, for example, in the above Figure 1aIn , with t0=0 as the mining start time point, only the sequence (0→5) can be mined, and since the length of the sequence is only 2, it does not meet the condition of being greater than the quantity threshold min_sup, so no periodic sequence or periodic pattern can be mined. Figure 7 middle, Figure 7 For example, in the case of offsets in the trajectory data, since there is no corresponding time point at t = 10, only the sequence (0 → 5) can be mined starting from t0 = 0. Although the periodic sequence (11 → 16 → 21) can be mined starting from t0 = 11, the correct periodic sequence (0 → 5 → 11 → 16 → 21) cannot be obtained. Therefore, the SMCA algorithm cannot handle data offsets and missing data.
[0125] MBPM algorithm: First, calculate the interval information time_interval between the event occurrence times, and record the first and last time points corresponding to the time interval together into PLC i =(time_interval,time1,time2), the intervals between all time points are combined into PLC = {PLC i ,PLC j ,PLC k …}, as a candidate set of period lengths.
[0126] Then, traverse each interval combination in the candidate set as the starting point PLC0 to mine the periodic pattern. First, select all interval combinations with a time interval of PLC0.time_interval in the candidate set, and search for interval combinations with a time interval of PLC0.time_interval. i .The most recent PLC after time2 j .time1, if PLC i .time2≠PLC j .time1, then insert Finally, we get a series of PLC temp Make the sequence start with PLC0. Then judge one by one Is it less than the variance 3δ of time_intercal in the list? If it meets the requirements, continue to judge; if it does not meet the requirements and if this If the length of the previous sequence satisfies the condition of being greater than min_sup, the previous sequence is recorded as a periodic pattern. To alleviate.
[0127] We can count {(5,0,5),(9,0,9),(20,0,20),(4,5,9),(15,5,20)…} as the period candidate set, but only (5,0,5) is an interval combination with a period of 5, so we cannot accurately mine the periodic pattern. Figure 7 The MBPM algorithm may also misjudge the cycle length if the trajectory only contains offset data. For this case, the MBPM algorithm can first obtain three combinations with a time interval of 5 days: {(5,0,5), (5,8,13), (5,11,16), (5,16,21)}, and then obtain two PLCs: {(3,5,8), (3,13,16)} based on the offset of the intermediate data. temp , we get the period candidate sequence {(5,0,5),(3,5,8),(5,8,13),(3,13,16),(5,16,21)} containing the filling time interval. The variance of the statistical time interval set [5,3,5,3,5] is 3*δ=2.88. temp All meet |PLC temp .time_interval - PLC0.time_interval | < 3*δ, resulting in the periodic pattern {(5,0,5),(5,8,13),(5,16,21)}. However, the average time interval of the time series [0,5,8,13,16,21] is 4.2 days, meaning its period is closer to 4 days than 5 days. Therefore, the mined pattern in this case is assigned an incorrect period length. This incorrect period length is caused by the allowed deviation in the algorithm. Therefore, while the MBPM algorithm can alleviate the problem caused by data drift to a certain extent, it also introduces another problem and does not completely solve the problem introduced by data drift. In addition, when (5, 0, 5) and (5, 8, 13) are used as PLC0 for periodic pattern mining, a considerable portion of the mined periodic patterns are repeated. Since we usually only focus on the periodic sequence with the largest length, mining the periodic pattern mined by (5, 8, 13) as PLC0 is invalid. Moreover, mining periodic sequences with high repetition will introduce a very large amount of computation when the periodic sequence is long.
[0128] By comparing the data cycle mining method provided in the embodiment of the present application with the SMCA algorithm and the MBPM algorithm respectively, the data cycle mining method provided in the embodiment of the present application has the following beneficial effects:
[0129] (1) First, the period position under normal circumstances is fixed. That is, when mining the time set, the period time point under normal circumstances (such as the first mining time point in this application) can be determined according to the mining start time point and the target candidate period. The period disturbance tolerance parameter δ, which is positively correlated with the period length, is introduced. d =period*tolerance_ratio. This can be used to mine periodic sequences under normal cycle conditions, address cycle offset issues, and address the overall offset of subsequent data in the MBPM algorithm, thereby more accurately detecting periodic information. Furthermore, setting the period offset parameter to be positively correlated with the period length aligns with normal logic, allowing for a wider range of fluctuations when detecting long periods.
[0130] (2) In the processing of period missing, since the period time point under normal circumstances has been fixed, if there is no corresponding recorded data within the normal time point and the time point range determined based on the period offset parameter, it is considered that there is a period missing (or data missing) at this point. In this case, by introducing the period continuous missing threshold δ l and the total missing threshold δ t This time point is skipped to mine the periodic sequence of the subsequent time set. The continuous missing threshold of the period δ l The length of the continuous missing period cannot be too large, and the total missing threshold δ t The overall cycle missing is limited to not be too large, so as to ensure the quality of the mined cycle sequence in the case of cycle missing.
[0131] To accelerate periodic sequence mining, all event time points are first recorded in a dictionary. The dictionary value indicates whether a particular event has been previously mined within a given period. This prevents duplicate mining, preventing the mining of highly similar periodic sequences while significantly reducing computational effort and lowering the complexity of periodic sequence mining by a factor of two. Storing time points in a dictionary allows for rapid lookup, reducing retrieval time.
[0132] For further information, see Figure 8 , which is a structural diagram of a data cycle mining device provided by an embodiment of the present application. Figure 8 As shown, the data cycle mining device can be applied to the above Figure 2 or Figure 4 The data mining device in the corresponding embodiment, specifically, the data cycle mining device can be a computer program (including program code) running in the data mining device, for example, the data cycle mining device is an application software; the data cycle mining device can be used to execute the corresponding steps in the method provided in the embodiment of the present application.
[0133] An acquiring unit 801 is configured to acquire a time set of a target object visiting a target location, wherein the time set includes an initial time point and multiple reference time points. The initial time point refers to the time when the target object first visits the target location, and the reference time point refers to the time when the target object does not visit the target location for the first time.
[0134] The acquiring unit 801 is further configured to acquire a candidate period set corresponding to the time set, where the candidate period set includes one or more candidate periods, where the candidate periods meet a period length condition, and / or the number of occurrences of the candidate periods in the time set is greater than a threshold number;
[0135] The acquisition unit 801 is further configured to acquire cycle mining parameters, wherein the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter;
[0136] The processing unit 802 is configured to perform periodic mining on the time set based on the period mining parameters and the period candidate set to obtain a period sequence of the target object visiting the target location.
[0137] In one embodiment, when the candidate period satisfies the period length condition and the number of occurrences of the candidate period in the time set is greater than the number threshold, the acquisition unit 801, when acquiring the period candidate set corresponding to the time set, may be specifically configured to:
[0138] Taking the difference between any two time points in the time set as an initial candidate period;
[0139] All initial candidate cycles that meet the cycle length conditions are used as reference candidate cycles;
[0140] The number of occurrences of each reference candidate cycle in the time set is counted, and the reference candidate cycles whose number of occurrences is greater than a threshold are taken as candidate cycles and added to the cycle candidate set.
[0141] In one embodiment, when the processing unit 802 performs periodic mining on the time set based on the period mining parameters and the period candidate set to obtain the period sequence of the target object visiting the target location, it can be specifically configured to:
[0142] Selecting a target candidate cycle for polling from the cycle candidate set;
[0143] Based on the target candidate cycle and the cycle mining parameters, periodic mining is performed on the time set to obtain a cycle sequence of the target object visiting the target location, and the next target candidate cycle for polling is continuously selected from the cycle candidate set;
[0144] When a preset number of candidate cycles in the cycle candidate set are determined as target candidate cycles, polling is stopped.
[0145] In one embodiment, when the processing unit 802 performs periodic mining on the time set based on the target candidate period and the period mining parameter to obtain the period sequence of the target object visiting the target location, it can be specifically configured to:
[0146] Traverse the time set in chronological order to obtain the mining start time point;
[0147] Starting from the mining start time point, determining one or more target mining time points from the time set based on the period mining parameter and the target candidate period;
[0148] When periodic mining of the time set based on the target candidate period and the periodic mining parameter is stopped, the mining start time point and the one or more target mining time points are combined into a periodic sequence of the target object visiting the target location.
[0149] In one embodiment, when determining one or more target mining time points from the time set based on the period mining parameters and the target candidate period starting from the mining start time point, the processing unit 802 may be specifically configured to:
[0150] determining a first mining time point based on the mining start time point and the target candidate period;
[0151] Searching for the first mining time point from the time set;
[0152] If the first mining time point is not found, one or more target mining time points are determined from a time set based on the first mining time point, the cycle mining parameter, and the target candidate cycle.
[0153] In one embodiment, the period mining parameters include a period offset parameter; when determining one or more target mining time points from a time set based on the first mining time point, the period mining parameters, and the target candidate period, the processing unit 802 may be specifically configured to:
[0154] determining a cycle offset time length based on the cycle offset parameter and the target candidate cycle;
[0155] determining an offset excavation time point based on the periodic offset time length and the first excavation time point;
[0156] If the offset mining time point is found from the time set, the offset mining time point is used as the target mining time point, and the next first mining time point is determined based on the mining start time point and the target candidate period.
[0157] In one embodiment, the cycle mining parameters further include a cycle missing parameter, and the cycle missing parameter includes a cycle continuous missing threshold and a cycle total missing threshold; the processing unit 802 is further configured to:
[0158] If the offset mining time point is not found in the time set, the number of consecutive cycle missing times and the total number of cycle missing times are updated;
[0159] If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a second mining time point according to the first mining time point and the target candidate cycle;
[0160] The second mining time point is used as the first mining time point, and the target mining time point is continued to be searched.
[0161] In one embodiment, the cycle mining parameters include a cycle missing parameter, which includes a cycle continuous missing threshold and a cycle total missing threshold. When determining one or more target mining time points from a time set based on the first mining time point, the cycle mining parameters, and the target candidate cycle, the processing unit 802 may be specifically configured to:
[0162] Update the number of consecutive missing cycles and the total number of missing cycles;
[0163] If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a third mining time point according to the first mining time point and the target candidate cycle;
[0164] One or more target mining time points are determined from a time set according to the third mining time point, the cycle mining parameter, and the target candidate cycle.
[0165] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The processing unit 802 is further used to:
[0166] If the first mining time point is found from the time set, and the identification information corresponding to the first mining time point is the second identification, the first mining time point is used as the target mining time point, and the identification information corresponding to the first mining time point in the time set is updated from the second identification to the first identification, and the next first mining time point is determined based on the mining start time point and the target candidate period.
[0167] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes either a first identification or a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined; when the processing unit 802 traverses the time set in chronological order of the time points and obtains the mining start time point, it can be specifically used to:
[0168] Traverse the time set in the order of time points to obtain the currently traversed time point;
[0169] If the identification information corresponding to the current traversal time point is the second identification, the current traversal time point is determined as the mining start time point, and the identification information corresponding to the current traversal time point is updated from the second identification to the first identification.
[0170] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The processing unit 802 is further used to:
[0171] If the updated number of consecutive cycle missing times is greater than the cycle consecutive missing threshold, and / or the updated total number of cycle missing times is greater than the cycle total missing threshold, and / or the identification information corresponding to the time points in the time set are all first identifications, then stop periodic mining of the time set based on the target candidate cycle and the cycle mining parameters.
[0172] In one embodiment, when acquiring the time set of the target object visiting the target location, the acquiring unit 801 may be specifically configured to:
[0173] Acquiring trajectory data of a target object, wherein the trajectory data includes a plurality of trajectory positions;
[0174] Acquire one or more reference stay positions that meet a position stay screening condition from the multiple track positions, the position stay screening condition including: a time length during which the target object is in a preset area formed by a target track position is greater than a preset time length, and the target track position is any track position from the multiple track positions;
[0175] Get the time point corresponding to each reference stop position;
[0176] Performing cluster analysis on the one or more reference stay locations to obtain a plurality of cluster sets, each cluster set corresponding to a reference location;
[0177] Matching a target location with a plurality of reference locations, and using a cluster set corresponding to a reference configuration matching the target location as a target cluster set corresponding to the target location;
[0178] An initial time point and multiple reference time points are determined according to the time points corresponding to the reference stay locations included in the target cluster set, and the initial time point and the multiple reference time points are added to the time set when the target object visits the target location.
[0179] It is understandable that the functions of the functional units of the data cycle mining device of this embodiment can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the above method embodiment. Figure 2 or Figure 4 The relevant description will not be repeated here.
[0180] Further, see Figure 9 , Figure 9 This is a structural diagram of a data mining device provided by an embodiment of the present application. Figure 2 or Figure 4 The data mining device in the corresponding embodiment can be Figure 9 The data mining equipment shown, such as Figure 9 As shown, the data mining device may include: a processor 901, an input device 902, an output device 903, and a memory 904. The processor 901, input device 902, output device 903, and memory 904 are connected via a bus 905. The memory 904 is used to store a computer program, which includes program instructions. The processor 901 is used to execute the program instructions stored in the memory 904.
[0181] In the embodiment of the present application, the processor 901 performs the following operations by running the executable program code in the memory 904:
[0182] Obtaining a time set of a target object visiting a target location, the time set including an initial time point and multiple reference time points, the initial time point being the time when the target object first visits the target location, and the reference time point being the time when the target object does not visit the target location for the first time;
[0183] Acquire a cycle candidate set corresponding to the time set, where the cycle candidate set includes one or more candidate cycles, the candidate cycles satisfy a cycle length condition, and / or the number of occurrences of the candidate cycles in the time set is greater than a number threshold;
[0184] Acquire cycle mining parameters, where the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter;
[0185] Based on the period mining parameters and the period candidate set, periodic mining is performed on the time set to obtain a period sequence of the target object visiting the target location.
[0186] In one embodiment, when the candidate period satisfies the period length condition and the number of occurrences of the candidate period in the time set is greater than the number threshold, the processor 901, when obtaining the period candidate set corresponding to the time set, may be specifically configured to:
[0187] Taking the difference between any two time points in the time set as an initial candidate period;
[0188] All initial candidate cycles that meet the cycle length conditions are used as reference candidate cycles;
[0189] The number of occurrences of each reference candidate cycle in the time set is counted, and the reference candidate cycles whose number of occurrences is greater than a threshold are taken as candidate cycles and added to the cycle candidate set.
[0190] In one embodiment, when the processor 901 performs periodic mining on the time set based on the period mining parameter and the period candidate set to obtain a period sequence of the target object visiting the target location, it may be specifically configured to:
[0191] Selecting a target candidate cycle for polling from the cycle candidate set;
[0192] Based on the target candidate cycle and the cycle mining parameters, periodic mining is performed on the time set to obtain a cycle sequence of the target object visiting the target location, and the next target candidate cycle for polling is continuously selected from the cycle candidate set;
[0193] When a preset number of candidate cycles in the cycle candidate set are determined as target candidate cycles, polling is stopped.
[0194] In one embodiment, when the processor 901 performs periodic mining on the time set based on the target candidate period and the period mining parameter to obtain the period sequence of the target object accessing the target location, it can be specifically configured to:
[0195] Traverse the time set in chronological order to obtain the mining start time point;
[0196] Starting from the mining start time point, determining one or more target mining time points from the time set based on the period mining parameter and the target candidate period;
[0197] When periodic mining of the time set based on the target candidate period and the periodic mining parameter is stopped, the mining start time point and the one or more target mining time points are combined into a periodic sequence of the target object visiting the target location.
[0198] In one embodiment, when the processor 901 determines one or more target mining time points from the time set based on the period mining parameters and the target candidate period starting from the mining start time point, it may be specifically configured to:
[0199] determining a first mining time point based on the mining start time point and the target candidate period;
[0200] Searching for the first mining time point from the time set;
[0201] If the first mining time point is not found, one or more target mining time points are determined from a time set based on the first mining time point, the cycle mining parameter, and the target candidate cycle.
[0202] In one embodiment, the cycle mining parameters include: a cycle offset parameter; when the processor 901 determines one or more target mining time points from a time set based on the first mining time point, the cycle mining parameters, and the target candidate cycle, it can be specifically configured to:
[0203] determining a cycle offset time length based on the cycle offset parameter and the target candidate cycle;
[0204] determining an offset excavation time point based on the periodic offset time length and the first excavation time point;
[0205] If the offset mining time point is found from the time set, the offset mining time point is used as the target mining time point, and the next first mining time point is determined based on the mining start time point and the target candidate period.
[0206] In one embodiment, the cycle mining parameters further include a cycle missing parameter, and the cycle missing parameter includes a cycle continuous missing threshold and a cycle total missing threshold; the processor 901 is further configured to:
[0207] If the offset mining time point is not found in the time set, the number of consecutive cycle missing times and the total number of cycle missing times are updated;
[0208] If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a second mining time point according to the first mining time point and the target candidate cycle;
[0209] The second mining time point is used as the first mining time point, and the target mining time point is continued to be searched.
[0210] In one embodiment, the cycle mining parameters include a cycle missing parameter, which includes a cycle continuous missing threshold and a cycle total missing threshold. When the processor 901 determines one or more target mining time points from a time set based on the first mining time point, the cycle mining parameters, and the target candidate cycle, it can be specifically configured to:
[0211] Update the number of consecutive missing cycles and the total number of missing cycles;
[0212] If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a third mining time point according to the first mining time point and the target candidate cycle;
[0213] One or more target mining time points are determined from a time set according to the third mining time point, the cycle mining parameter, and the target candidate cycle.
[0214] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The processor 901 is further configured to:
[0215] If the first mining time point is found from the time set, and the identification information corresponding to the first mining time point is the second identification, the first mining time point is used as the target mining time point, and the identification information corresponding to the first mining time point in the time set is updated from the second identification to the first identification, and the next first mining time point is determined based on the mining start time point and the target candidate period.
[0216] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined; when the processor 901 traverses the time set in chronological order of the time points and obtains the mining start time point, it can be specifically used to:
[0217] Traverse the time set in the order of time points to obtain the currently traversed time point;
[0218] If the identification information corresponding to the current traversal time point is the second identification, the current traversal time point is determined as the mining start time point, and the identification information corresponding to the current traversal time point is updated from the second identification to the first identification.
[0219] In one embodiment, each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The processor 901 is further configured to:
[0220] If the updated number of consecutive cycle missing times is greater than the cycle consecutive missing threshold, and / or the updated total number of cycle missing times is greater than the cycle total missing threshold, and / or the identification information corresponding to the time points in the time set are all first identifications, then stop periodic mining of the time set based on the target candidate cycle and the cycle mining parameters.
[0221] In one embodiment, when acquiring the time set of the target object accessing the target location, the processor 901 may be specifically configured to:
[0222] Acquiring trajectory data of a target object, wherein the trajectory data includes a plurality of trajectory positions;
[0223] Acquire one or more reference stay positions that meet a position stay screening condition from the multiple track positions, the position stay screening condition including: a time length during which the target object is in a preset area formed by a target track position is greater than a preset time length, and the target track position is any track position from the multiple track positions;
[0224] Get the time point corresponding to each reference stop position;
[0225] Performing cluster analysis on the one or more reference stay locations to obtain a plurality of cluster sets, each cluster set corresponding to a reference location;
[0226] Matching a target location with a plurality of reference locations, and using a cluster set corresponding to a reference configuration matching the target location as a target cluster set corresponding to the target location;
[0227] An initial time point and multiple reference time points are determined according to the time points corresponding to the reference stay locations included in the target cluster set, and the initial time point and the multiple reference time points are added to the time set when the target object visits the target location.
[0228] It should be understood that in the embodiment of the present application, the processor 901 may be a central processing unit (CPU), and the processor 901 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0229] The memory 904 may include a read-only memory and a random access memory, and provides instructions and data to the processor 901. A portion of the memory 904 may also include a nonvolatile random access memory.
[0230] The input device 902 may include a keyboard, etc., and inputs trajectory data to the processor 901 ; the output device 903 may include a display, etc.
[0231] In a specific implementation, the processor 901, input device 902, output device 903 and memory 904 described in the embodiments of the present application can execute the implementation methods described in all the above embodiments, and can also execute the implementation methods described in the above apparatus, which will not be repeated here.
[0232] In an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the steps performed in all the above embodiments can be executed.
[0233] An embodiment of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a data mining device, the methods in all the above embodiments are executed.
[0234] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0235] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that implementing all or part of the processes of the above embodiment and making equivalent changes in accordance with the claims of this application still fall within the scope of the invention.
Claims
1. A data period mining method, characterized in that: include: Obtaining a time set of a target object visiting a target location, the time set including an initial time point and multiple reference time points, the initial time point being the time when the target object first visits the target location, and the reference time point being the time when the target object does not visit the target location for the first time; Acquire a cycle candidate set corresponding to the time set, where the cycle candidate set includes one or more candidate cycles; the candidate cycles meet a cycle length condition, and / or the number of occurrences of the candidate cycles in the time set is greater than a number threshold; Acquire cycle mining parameters, where the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter; Based on the period mining parameters and the period candidate set, periodic mining is performed on the time set to obtain a period sequence of the target object visiting the target location.
2. The method according to claim 1, wherein When the candidate period satisfies a period length condition and the number of occurrences of the candidate period in the time set is greater than a number threshold, obtaining a period candidate set corresponding to the time set includes: Taking the difference between any two time points in the time set as an initial candidate period; All initial candidate cycles that meet the cycle length conditions are used as reference candidate cycles; The number of occurrences of each reference candidate cycle in the time set is counted, and the reference candidate cycles whose number of occurrences is greater than a threshold are taken as candidate cycles and added to the cycle candidate set.
3. The method according to claim 1 or 2, wherein: The periodic mining of the time set based on the periodic mining parameter and the periodic candidate set to obtain a periodic sequence of the target object visiting the target location includes: Selecting a target candidate cycle for polling from the cycle candidate set; Based on the target candidate cycle and the cycle mining parameters, periodic mining is performed on the time set to obtain a cycle sequence of the target object visiting the target location, and the next target candidate cycle for polling is continuously selected from the cycle candidate set; When a preset number of candidate cycles in the cycle candidate set are determined as target candidate cycles, polling is stopped.
4. The method according to claim 3, wherein The periodic mining of the time set based on the target candidate period and the period mining parameter to obtain a period sequence of the target object visiting the target location includes: Traverse the time set in chronological order to obtain the mining start time point; Starting from the mining start time point, determining one or more target mining time points from the time set based on the period mining parameter and the target candidate period; When periodic mining of the time set based on the target candidate period and the periodic mining parameter is stopped, the mining start time point and the one or more target mining time points are combined into a periodic sequence of the target object visiting the target location.
5. The method according to claim 4, wherein The step of determining one or more target mining time points from the time set based on the period mining parameter and the target candidate period starting from the mining start time point includes: determining a first mining time point based on the mining start time point and the target candidate period; Searching for the first mining time point from the time set; If the first mining time point is not found, one or more target mining time points are determined from a time set based on the first mining time point, the cycle mining parameter, and the target candidate cycle.
6. The method according to claim 5, wherein The period mining parameters include: a period offset parameter; and determining one or more target mining time points from a time set based on the first mining time point, the period mining parameters, and the target candidate period includes: determining a cycle offset time length based on the cycle offset parameter and the target candidate cycle; determining an offset excavation time point based on the periodic offset time length and the first excavation time point; If the offset mining time point is found from the time set, the offset mining time point is used as the target mining time point, and the next first mining time point is determined based on the mining start time point and the target candidate period.
7. The method according to claim 5 or 6, wherein: The cycle mining parameters further include a cycle missing parameter, which includes a cycle continuous missing threshold and a cycle total missing threshold; the method further includes: If the offset mining time point is not found in the time set, the number of consecutive cycle missing times and the total number of cycle missing times are updated; If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a second mining time point according to the first mining time point and the target candidate cycle; The second mining time point is used as the first mining time point, and the target mining time point is continued to be searched.
8. The method according to claim 5, wherein The cycle mining parameters include a cycle missing parameter, which includes a cycle continuous missing threshold and a cycle total missing threshold; and determining one or more target mining time points from a time set based on the first mining time point, the cycle mining parameters, and the target candidate cycle, including: Update the number of consecutive missing cycles and the total number of missing cycles; If the updated number of consecutive cycle missing times is less than or equal to the cycle consecutive missing threshold and the updated total number of cycle missing times is less than or equal to the cycle total missing threshold, determining a third mining time point according to the first mining time point and the target candidate cycle; One or more target mining time points are determined from a time set according to the third mining time point, the cycle mining parameter, and the target candidate cycle.
9. The method according to claim 5, wherein Each time point in the time set is associated with identification information, the identification information including either a first identification or a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The method further includes: If the first mining time point is found from the time set, and the identification information corresponding to the first mining time point is the second identification, the first mining time point is used as the target mining time point, and the identification information corresponding to the first mining time point in the time set is updated from the second identification to the first identification, and the next first mining time point is determined based on the mining start time point and the target candidate period.
10. The method according to claim 4, wherein Each time point in the time set corresponds to identification information, and the identification information includes any one of a first identification and a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined; The step of traversing the time set in order of time points to obtain the mining start time point includes: Traverse the time set in the order of time points to obtain the currently traversed time point; If the identification information corresponding to the current traversal time point is the second identification, the current traversal time point is determined as the mining start time point, and the identification information corresponding to the current traversal time point is updated from the second identification to the first identification.
11. The method according to claim 7, wherein Each time point in the time set is associated with identification information, the identification information including either a first identification or a second identification; the first identification is used to indicate a time point that has been mined, and the second identification is used to indicate a time point that has not been mined. The method further includes: If the updated number of consecutive cycle missing times is greater than the cycle consecutive missing threshold, and / or the updated total number of cycle missing times is greater than the cycle total missing threshold, and / or the identification information corresponding to the time points in the time set are all first identifications, then stop periodic mining of the time set based on the target candidate cycle and the cycle mining parameters.
12. The method according to claim 1, wherein The step of obtaining a time set of a target object visiting a target location includes: Acquiring trajectory data of a target object, wherein the trajectory data includes a plurality of trajectory positions; Acquire one or more reference stay positions that meet a position stay screening condition from the multiple track positions, the position stay screening condition including: a time length during which the target object is in a preset area formed by a target track position is greater than a preset time length, and the target track position is any track position from the multiple track positions; Get the time point corresponding to each reference stop position; Performing cluster analysis on the one or more reference stay locations to obtain a plurality of cluster sets, each cluster set corresponding to a reference location; Matching a target location with a plurality of reference locations, and using a cluster set corresponding to a reference configuration matching the target location as a target cluster set corresponding to the target location; An initial time point and multiple reference time points are determined according to the time points corresponding to the reference stay locations included in the target cluster set, and the initial time point and the multiple reference time points are added to the time set when the target object visits the target location.
13. A data cycle mining device, characterized in that: include: An acquiring unit, configured to acquire a time set of a target object visiting a target location, wherein the time set includes an initial time point and a plurality of reference time points, wherein the initial time point refers to a time when the target object visits the target location for the first time, and the reference time point refers to a time when the target object visits the target location for a non-first time; The acquisition unit is further configured to acquire a candidate period set corresponding to the time set, where the candidate period set includes one or more candidate periods, the candidate periods satisfying a period length condition, and / or the number of occurrences of the candidate periods in the time set being greater than a threshold number; The acquisition unit is further configured to acquire cycle mining parameters, wherein the cycle mining parameters include one or more of the following: a cycle offset parameter and a cycle missing parameter; A processing unit is configured to perform periodic mining on the time set based on the period mining parameters and the period candidate set to obtain a period sequence of the target object visiting the target location.
14. A data mining device, characterized in that: include: Memory for storing computer programs; The processor runs the computer program stored in the memory to implement the data cycle mining method according to any one of claims 1 to 12.
15. A computer storage medium, characterized in that The computer storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the data cycle mining method according to any one of claims 1 to 12.
Citation Information
Patent Citations
System and method for excavating user period mode
CN105224685A
Mode mining method and apparatus
CN107870939A