Time sequence clustering method and device

By using subsequences as clustering centers in time series clustering and clustering based on greedy strategies and effective boundaries, the problem of high complexity in long-term time series calculations is solved, and efficient time series clustering is achieved.

CN119862431APending Publication Date: 2025-04-22TSINGHUA UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411802330.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art has too much computational complexity when processing long time series, making it difficult to meet the requirements of real-time and efficient.

Method used

By obtaining the subsequences of the time series to be clustered, the m subsequences are combined as m cluster centers, and the cluster center set is constructed with the objective function, the approximate solution is performed based on the greedy strategy, and the preset effective boundaries are accelerated.

Benefits of technology

It significantly reduces the time complexity, improves the clustering efficiency of long-time series, and meets the requirements of real-time and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862431A_ABST
    Figure CN119862431A_ABST
Patent Text Reader

Abstract

The invention provides a time sequence clustering method and device, and the method comprises the steps: obtaining subsequences of a to-be-clustered time sequence, taking m subsequences as m clustering centers, and combining the m clustering centers into a clustering center set of the to-be-clustered time sequence; a target function is constructed with the purpose of maximizing the sum of the shape similarities of all the subsequences and the corresponding clustering centers, and one subsequence corresponds to one clustering center; and performing approximate solution on the target function based on a greedy strategy, and accelerating the solution process through a preset effective boundary to determine an approximate optimal subsequence combination in the clustering center set. According to the invention, the time complexity is significantly reduced by selecting the subsequences as the clustering center; a greedy strategy is introduced to enable a suboptimal solution to quickly approach a globally optimal solution, the solving process is accelerated by setting an effective boundary, and the clustering efficiency of a long-time sequence is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data clustering, and in particular to a time series clustering method and device. Background Art

[0002] With the rapid development of Internet of Things (IoT) technology, a large number of sensors and devices have generated massive amounts of information time series data containing rich patterns. These data can be used to mine subsequence patterns in different time periods through cluster analysis, providing support for downstream applications such as anomaly detection, pattern recognition, and prediction. In this context, time series clustering has become an important task in data analysis, among which advanced methods can efficiently cluster according to the shape of time series and are applicable to a variety of IoT scenarios.

[0003] However, there are many special challenges in the IoT scenario, making time series clustering more complicated. First, due to the large number of devices in the IoT and the frequent data flow, time series data is usually stored in the database in a disordered manner. This disordered storage is mostly caused by the LSM tree structure supporting high-intensity writing. Second, time series clustering often requires repeated analysis for different time ranges or time filtering conditions. The frequent computing requirements put higher requirements on the efficiency of existing methods.

[0004] The length of time series in the Internet of Things scenario is long and the complexity between subsequences is high, which makes the traditional methods too computationally complex when processing long time series and difficult to meet the real-time and high efficiency requirements. Summary of the invention

[0005] The present invention provides a time series clustering method and device to solve the defects of the time series clustering algorithm in the prior art that the computational complexity is too high when processing long time series and it is difficult to meet the real-time and high efficiency requirements, and realize an efficient time series clustering method in the database.

[0006] The present invention provides a time series clustering method, comprising the following steps.

[0007] Obtain subsequences of the time series to be clustered, and use m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; An objective function is constructed with the goal of maximizing the sum of shape similarities between each of the subsequences and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; The objective function is approximately solved based on a greedy strategy, and the solution process is accelerated by a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

[0008] According to the time series clustering method provided by the present invention, the constructing of the objective function specifically includes: Constructing a shape similarity function between each subsequence and the corresponding cluster center ; Based on the similarity function , calculate the sum of the shape similarities between each subsequence and the corresponding cluster center in the current cluster center set , the size of the sum is used to characterize the clustering effect of the current cluster center set; The objective function is constructed with the goal of maximizing the sum of the shape similarities between each subsequence and the corresponding cluster center. .

[0009] According to the time series clustering method provided by the present invention, subsequences are defined With cluster center The shape similarity function is The calculation formula is: , in, represents the weight, represents the i-th subsequence; is the jth cluster center; Defining functions is the clustering effect of the current cluster center set, and the calculation formula is: , in, is the length of the time series T to be clustered l The subsequence set of , C is the cluster center set; Define the objective function The calculation formula is: .

[0010] According to the time series clustering method provided by the present invention, the objective function is approximately solved based on the greedy strategy, and the solution process is accelerated by a preset effective limit, which specifically includes: S41, initializing each subsequence; S42, initializing an empty cluster center set C, wherein the cluster center set C is composed of m subsequences, and when initialized to be empty, m=0; S43, repeat S44-S48, m=1,…k take values ​​in turn, until k subsequences are found, k is the number of target cluster centers; S44. From the subsequence set Remove the cluster centers in the current cluster center set C, and then perform subsequence sampling; S45, executing S46 for each subsequence X in the sample; S46. Calculate the objective function after adding X , and the objective function is Speed ​​up the solution process; S47, choose The subsequence with the largest value is denoted by ; S48, select Add to the set of cluster centers obtained in the previous round; S49. Return the final set of cluster centers.

[0011] According to the time series clustering method provided by the present invention, the speeding up of the solution process by using a preset effective limit specifically includes: Set validity bounds to estimate the i-th subsequence and the found cluster centers The shape distance between them, the effective limit is expressed as: , in, for An approximate representation of = - , is the cluster center found.

[0012] According to the time series clustering method provided by the present invention, the objective function is The solution process is accelerated, including: S61, check whether approximate clustering has been performed currently, if it has been performed, jump to step S64; if it has not been performed, execute step S62; S62, using an approximate clustering algorithm for each subsequence to find r approximate clustering centers; S63, calculating the weight of each approximate cluster center, wherein the specific value of the weight is the number of subsequences in the cluster; S64. Initialize the objective function value is 0; S65, traverse each approximate cluster center and execute S66; S66, update the current objective function value, for each approximate cluster center, calculate the increment w of the objective function after adding X, and the cluster center set Each cluster center The maximum similarity , the increment Add to the current objective function value; S67. Return the updated objective function.

[0013] The present invention also provides a time series clustering device, comprising the following modules: An acquisition module, used for acquiring subsequences of the time series to be clustered, and taking m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; An objective function construction module, used to construct an objective function with the goal of maximizing the sum of shape similarities between each subsequence and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; The accelerated approximate solution module is used to perform an approximate solution to the objective function based on a greedy strategy, and speed up the solution process through a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the time series clustering method described above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the time series clustering method described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the time series clustering method described above is implemented.

[0017] The time series clustering method and device provided by the present invention obtain subsequences of the time series to be clustered, and combine m subsequences as m cluster centers to form a cluster center set of the time series to be clustered; construct an objective function with the goal of maximizing the sum of shape similarities between each subsequence and the cluster center, wherein one subsequence corresponds to one cluster center; set an effective limit for estimating the shape distance between the subsequence and the corresponding cluster center; approximate the objective function based on a greedy strategy, and speed up the solution process through a preset effective limit to obtain the final cluster center set. The present invention clusters long subsequences in a time series based on center points and shapes, selects a subset of all subsequences as cluster centers, and sets an effective limit to speed up the solution process, thereby solving the efficiency bottleneck of existing methods in long time series processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a schematic diagram of the flow of the time series clustering method provided by the present invention.

[0020] Figure 2 It is the execution program of the greedy algorithm provided by the present invention.

[0021] Figure 3 This is the accelerated approximate calculation process of the objective function provided by the present invention.

[0022] Figure 4 It is the execution program of the acceleration algorithm provided by the present invention.

[0023] Figure 5 It is a structural schematic diagram of the time series clustering device provided by the present invention.

[0024] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] The present invention is described in detail below in conjunction with the accompanying drawings of the specification. The specific operating method in the method embodiment can also be applied to the device embodiment or the system embodiment. In the description of the present invention, unless otherwise specified, "at least one" includes one or more. "Multiple" refers to two or more. For example, at least one of A, B and C includes: A exists alone, B exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B and C exist at the same time. In the present invention, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a kind of association relationship that describes the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0027] When clustering time series, there are cases where the subsequences are long, such as when the subsequence length When it is large, the K-Shape method in the database requires space to store the matrix, and time to extract the shape from the matrix, so the K-Shape method is too expensive to store and compute when processing long subsequences.

[0028] To solve the above problem, an embodiment of the present invention proposes a time series clustering method, which clusters subsequences of a time series based on center points and shapes (Medoid-Shape), by selecting a subset of all subsequences as cluster centers.

[0029] The present invention will be described in detail below in conjunction with specific implementation modes.

[0030] In some specific embodiments of the present invention, Figure 1 As shown, this scheme provides a time series clustering method, including: Step 100: obtaining subsequences of the time series to be clustered, and taking m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; Step 200, constructing an objective function with the goal of maximizing the sum of shape similarities between each subsequence and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; Step 300: Approximately solve the objective function based on a greedy strategy, and speed up the solution process through a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

[0031] It should be noted that the existing time series clustering solutions have high computational complexity when processing long sequence data and are difficult to meet the real-time and high efficiency requirements.

[0032] Therefore, the present invention significantly reduces the time complexity by using actual subsequences as clustering centers, reducing storage requirements and calculation steps; defines shape similarity and objective function, and selects subsequences as new clustering centers based on a greedy strategy; proposes an approximate algorithm, which first approximates the subsequences and then sets effective boundaries. By only considering the approximate centroid to calculate the objective function, the clustering efficiency of long time series is effectively improved.

[0033] The above steps are described in detail below through specific embodiments.

[0034] Step 100: obtaining subsequences of the time series to be clustered, and taking m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; Specifically, compared to the K-Shape method that uses feature vectors as cluster centers, the present invention uses actual subsequences as cluster centers without using feature vectors. The advantage of the above arrangement of the present invention is that there is no need to calculate and store feature vectors for each subsequence, which greatly reduces storage requirements and also reduces the calculation steps for extracting shape information from feature vectors.

[0035] On this basis, the present invention specifically defines a clustering problem based on center points and shapes, that is, to find a subsequence set that can maximize the sum of shape similarities between all subsequences and their most similar centers among all possible cluster center sets.

[0036] Step 200, constructing an objective function with the goal of maximizing the sum of shape similarities between each subsequence and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; In some possible implementations of the present invention, constructing the objective function specifically includes: Constructing a shape similarity function between each subsequence and the corresponding cluster center ; Based on the similarity function , calculate the sum of the shape similarities between each subsequence and the corresponding cluster center in the current cluster center set , the size of the sum is used to characterize the clustering effect of the current cluster center set; The objective function is constructed with the goal of maximizing the sum of the shape similarities between each subsequence and the corresponding cluster center. .

[0037] Specifically, this embodiment provides an implementation method for constructing an objective function by defining cluster centers, calculating the shape distances of each subsequence to the cluster centers, and taking maximizing the sum of shape similarities between all subsequences and their most similar centers as the goal to define the objective function.

[0038] Specifically, in order to efficiently solve the clustering problem based on center points and shapes, the embodiment of the present invention utilizes the sub-model characteristics of the objective function and approximates the objective function based on a greedy strategy, that is, a greedy algorithm is used for approximate optimization. The greedy strategy gradually constructs a cluster center set C by iteratively selecting a subsequence that can maximize the gain of the objective function. Specifically, by defining a shape similarity function g and a function representing the clustering effect of the current cluster center set C Through the above definition, the greedy algorithm designed in the embodiment of the present invention gradually selects the one that can maximize , and finally obtain the approximately optimal set of cluster centers.

[0039] In some possible implementations of the present invention, a subsequence is defined as With cluster center The shape similarity function is The calculation formula is: (1), in, represents the weight, represents the i-th subsequence; is the jth cluster center; Defining functions is the clustering effect of the current cluster center set, and the calculation formula is: (2), in, is the length of the time series T to be clustered l The subsequence set of , C is the cluster center set; Define the objective function The calculation formula is: (3).

[0040] Specifically, this embodiment provides a specific implementation method for constructing an objective function, by selecting a subset of subsequences as representative points of clusters, and these representative points will be used as cluster centers; calculating the shape distance between each subsequence and the cluster center. This distance measures the similarity in shape between the subsequence and the center point; designing a shape similarity function g to quantify the shape similarity between two subsequences (a subsequence and a cluster center); defining the objective function f , which represents the clustering effect of the current center point set C, and its goal is to maximize the sum of the shape similarities between all subsequences and their most similar centers.

[0041] Step 300: Approximately solve the objective function based on a greedy strategy, and speed up the solution process through a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

[0042] In some possible implementations of the present invention, the objective function is approximately solved based on a greedy strategy, and the solution process is accelerated by a preset effective limit, specifically including: S41, initializing each subsequence; S42, initializing an empty cluster center set C, wherein the cluster center set C is composed of m subsequences, and when initialized to be empty, m=0; S43, repeat S44-S48, m=1,…k take values ​​in turn, until k subsequences are found, k is the number of target cluster centers; S44. From the subsequence set Remove the cluster centers in the current cluster center set C, and then perform subsequence sampling; S45, executing S46 for each subsequence X in the sample; S46. Calculate the objective function after adding X , and the objective function is Speed ​​up the solution process; S47, choose The subsequence with the largest value is denoted by ; S48, select Add to the set of cluster centers obtained in the previous round; S49. Return the final set of cluster centers.

[0043] Specifically, this embodiment provides an implementation method for approximating the objective function based on a greedy strategy, in each iteration, by temporarily adding a subsequence X to the current cluster center set C and calculating the overall objective function To greedily select an optimal cluster center , Select from the added subsequence X, the specific code is as follows Figure 2 shown.

[0044] The above arrangement of this embodiment enables the subsequence that can maximize the objective function to be selected as a new cluster center each time.

[0045] In some possible implementations of the present invention, the speeding up of the solution process by using a preset effective limit specifically includes: Set validity bounds to estimate the i-th subsequence and the found cluster centers The shape distance between them, the effective limit is expressed as: (4) in, for An approximate representation of = - , is the cluster center found.

[0046] Specifically, this embodiment provides an implementation method of an effective boundary, and the identity information of the indoor unit includes at least one or more of the operating environment, target user, personalized settings and authority level. The setting of multiple identifications can meet the different needs of users and enhance the user experience.

[0047] Specifically, Figure 3 As shown, in the algorithm, it is necessary to evaluate the combination of all subsequence pairs and the current cluster center to calculate the objective function, which is very high in time complexity (reaching O(kn)), so it is necessary to find an approximate solution. This embodiment proposes an intuition by considering two similar segments in the time series, that is, the shape-based distance may satisfy the triangle inequality. However, using only the shape-based distance does not guarantee that the triangle inequality holds, so we propose a bound by combining the L1 norm and the L2 norm. In the process of proof, Young's inequality is introduced, and a bound on the difference of the shape-based distance of two subsequences and the center is given. Based on this, we propose an approximate algorithm for evaluating the objective function, which reduces the amount of calculation by first approximating clustering all subsequences and then only considering the approximate centroid to calculate the objective function.

[0048] In some possible implementations of the present invention, the objective function is set by a preset effective limit. The solution process is accelerated, including: S61, check whether approximate clustering has been performed currently, if it has been performed, jump to step S64; if it has not been performed, execute step S62; S62, using an approximate clustering algorithm for each subsequence to find r approximate clustering centers; S63, calculating the weight of each approximate cluster center, wherein the specific value of the weight is the number of subsequences in the cluster; S64. Initialize the objective function value is 0; S65, traverse each approximate cluster center and execute S66; S66, update the current objective function value, for each approximate cluster center, calculate the increment w of the objective function after adding X, and the cluster center set Each cluster center The maximum similarity , the increment Add to the current objective function value; S67. Return the updated objective function.

[0049] Specifically, this embodiment provides an objective function for adding a new subsequence by an effective limit The implementation method for speeding up the solution process is to consider that the time complexity of directly evaluating the combination of all subsequence pairs and the current cluster center to calculate the objective function is very high, and it is necessary to find an approximate solution. All subsequences are first clustered approximately, and then based on the intuition of the triangle inequality of shape distance, and combined with the L1 norm and L2 norm, a limit is proposed. Only the approximate centroid is considered to calculate the objective function, thereby reducing the amount of calculation and optimizing the efficiency of the algorithm. The specific code is as follows: Figure 4 As shown, using Figure 4 Program replacement in Figure 2 The steps in the number “6:” speed up the solution process.

[0050] Specifically, in order to further reduce the time complexity, the objective function is proposed Intuitively, any two time periods with similar shapes have similar properties in terms of shape distance. Based on this, a limit is introduced to effectively estimate the subsequence and cluster centers We prove that this limit holds and use this formula to significantly reduce the time required for actual calculations. Figure 2 As shown, by visualizing the subsequence and The similarity between them shows how to use the approximate center point and formula to optimize the objective function The computational efficiency.

[0051] The time series clustering method provided by the embodiment of the present invention uses cluster centers instead of feature vectors as the basis for clustering, selects a subset of the subsequence as the representative points of the cluster, and calculates the shape distance between these representative points and the current cluster center to determine the cluster assignment, thereby avoiding the complex feature decomposition steps in the traditional K-Shape method and significantly reducing the time complexity. On this basis, a greedy strategy is introduced to quickly approach the global optimal solution with a suboptimal solution while maintaining the shape distance optimization, and further improve the efficiency of objective function optimization through an approximate calculation strategy. In short, the present invention effectively improves the clustering efficiency of long time series, and at the same time can be close to or better than the original K-Shape method in terms of clustering accuracy.

[0052] The time series clustering device provided by the present invention is described below. The time series clustering device described below and the time series clustering method described above can be referred to each other.

[0053] In some specific embodiments of the present invention, Figure 5 As shown, this solution provides a time series clustering device, including: An acquisition module 51 is used to acquire subsequences of the time series to be clustered, and use m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; An objective function construction module 52, configured to construct an objective function with the goal of maximizing the sum of shape similarities between each of the subsequences and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; The accelerated approximate solution module 53 is used to perform an approximate solution to the objective function based on a greedy strategy and speed up the solution process through a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

[0054] The implementation principle and beneficial effects of the time series clustering device provided in the embodiment of the present invention are similar to the implementation principle and beneficial effects of the time series clustering method shown in the above embodiment. Please refer to the implementation principle and beneficial effects of the time series clustering method shown in the above embodiment, and no further details will be given here.

[0055] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the time series clustering method, which includes: obtaining a subsequence of the time series to be clustered, taking m subsequences as m clustering centers, and combining them into a clustering center set of the time series to be clustered; constructing an objective function with the goal of maximizing the sum of the shape similarities between each subsequence and the corresponding clustering center, wherein one subsequence corresponds to one clustering center; approximating the objective function based on a greedy strategy, and speeding up the solution process through a preset effective limit to determine the approximate optimal subsequence combination in the clustering center set.

[0056] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0057] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the time series clustering method provided by the above methods, which includes: obtaining subsequences of the time series to be clustered, taking m subsequences as m clustering centers, and combining them into a set of clustering centers of the time series to be clustered; constructing an objective function with the goal of maximizing the sum of the shape similarities between each of the subsequences and the corresponding clustering centers, wherein one subsequence corresponds to one clustering center; approximating the objective function based on a greedy strategy, and speeding up the solution process through a preset effective limit to determine the approximate optimal subsequence combination in the set of clustering centers.

[0058] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the time series clustering method provided by the above-mentioned methods, the method comprising: obtaining subsequences of the time series to be clustered, taking m subsequences thereof as m clustering centers, and combining them into a set of clustering centers of the time series to be clustered; constructing an objective function with the goal of maximizing the sum of the shape similarities between each of the subsequences and the corresponding clustering centers, wherein one subsequence corresponds to one clustering center; approximating the objective function based on a greedy strategy, and speeding up the solution process through a preset effective limit to determine the approximate optimal subsequence combination in the set of clustering centers.

[0059] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A time series clustering method, characterized in that: include: Obtain subsequences of the time series to be clustered, and use m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; An objective function is constructed with the goal of maximizing the sum of shape similarities between each of the subsequences and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; The objective function is approximately solved based on a greedy strategy, and the solution process is accelerated by a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

2. The time series clustering method according to claim 1, characterized in that: The constructing of the objective function specifically includes: Constructing a shape similarity function between each subsequence and the corresponding cluster center ; Based on the similarity function , calculate the sum of the shape similarities between each subsequence and the corresponding cluster center in the current cluster center set , the size of the sum is used to characterize the clustering effect of the current cluster center set; The objective function is constructed with the goal of maximizing the sum of the shape similarities between each subsequence and the corresponding cluster center. .

3. The time series clustering method according to claim 2, characterized in that: Defining a subsequence With cluster center The shape similarity function is The calculation formula is: , in, represents the weight, represents the i-th subsequence; is the jth cluster center; Defining functions is the clustering effect of the current cluster center set, and the calculation formula is: , in, is the length of the time series T to be clustered l The subsequence set of , C is the cluster center set; Define the objective function The calculation formula is: 。 4. The time series clustering method according to claim 2 or 3, characterized in that: The objective function is approximately solved based on the greedy strategy, and the solution process is accelerated by a preset effective limit, specifically including: S41, initializing each subsequence; S42, initializing an empty cluster center set C, wherein the cluster center set C is composed of m subsequences, and when initialized to be empty, m=0; S43, repeat S44-S48, m=1,…k take values ​​in turn, until k subsequences are found, k is the number of target cluster centers; S44. From the subsequence set Remove the cluster centers in the current cluster center set C, and then perform subsequence sampling; S45, for each subsequence X in the sample, execute S46; S46. Calculate the objective function after adding X , and the objective function is Speed ​​up the solution process; S47, choose The subsequence with the largest value is denoted by ; S48, select Add to the set of cluster centers obtained in the previous round; S49. Return the final set of cluster centers.

5. The time series clustering method according to claim 4, characterized in that: The method of speeding up the solution process by using a preset effective limit specifically includes: Set validity bounds to estimate the i-th subsequence and the found cluster centers The shape distance between them, the effective limit is expressed as: , in, for An approximate representation of = - , is the cluster center found.

6. The time series clustering method according to claim 5, characterized in that: The objective function is The solution process is accelerated, including: S61, check whether approximate clustering has been performed currently, if it has been performed, jump to step S64; if it has not been performed, execute step S62; S62, using an approximate clustering algorithm for each subsequence to find r approximate clustering centers; S63, calculating the weight of each approximate cluster center, wherein the specific value of the weight is the number of subsequences in the cluster; S64. Initialize the objective function value is 0; S65, traverse each approximate cluster center and execute S66; S66, update the current objective function value, for each approximate cluster center, calculate the increment w of the objective function after adding X, and the cluster center set Each cluster center The maximum similarity , the increment Add to the current objective function value; S67. Return the updated objective function.

7. A time series clustering device, characterized in that: include: An acquisition module, used for acquiring subsequences of the time series to be clustered, and taking m subsequences as m clustering centers to form a clustering center set of the time series to be clustered; An objective function construction module, used to construct an objective function with the goal of maximizing the sum of shape similarities between each subsequence and the corresponding cluster center, wherein one subsequence corresponds to one cluster center; The accelerated approximate solution module is used to perform an approximate solution to the objective function based on a greedy strategy, and speed up the solution process through a preset effective limit to determine an approximately optimal subsequence combination in the cluster center set.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the time series clustering method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the time series clustering method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the time series clustering method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Hierarchical clustering method integrating distance features, shape features and time sequence features

    CN120744549A

  • A hierarchical clustering method integrating distance features, shape features and timing features

    CN120744549B