A method and apparatus for matching a waveform curve
By dividing the waveform curve into multiple segments, calculating their own cost value and matching degree, and using the cost matrix to find the optimal path, the problem of inaccurate waveform curve matching is solved, and the accuracy and precision of matching are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SANHE ROBOT TECH CO LTD
- Filing Date
- 2022-12-21
- Publication Date
- 2026-06-30
AI Technical Summary
In the current technology, waveform curve matching is inaccurate during machine tool processing, making it difficult to effectively identify redundant or missing waveform segments, resulting in inaccurate matching results.
The waveform curve is divided into multiple segments, and the cost value and matching degree of each segment are calculated. The optimal matching path is found by constructing a cost matrix, and the influence of redundant or missing segments is eliminated.
This improves the accuracy and precision of waveform curve matching, ensuring the accuracy of matching results and the precision of similarity calculation.
Smart Images

Figure CN116304550B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of waveform curve matching technology, and specifically to a waveform curve matching method and apparatus. Background Technology
[0002] CNC machine tools are among the most common mechanical equipment in industrial machining processes, providing high-precision and high-level machining services.
[0003] In existing machine tool machining processes, each machining step generates a load curve or power curve. This curve contains multiple machining waveforms, and the differences between these waveforms can be significant. Whether two machining steps are consistent, or whether each machining step conforms to a standard machining process, is a crucial method for analyzing whether there are quality issues in that machining process. Abstracting the machining process into a time-series waveform curve and finding the optimal matching relationship is essential to obtaining the optimal similarity value. However, two identical machining waveforms can differ greatly; for example, some waveforms may have missing parts, while others may have redundant parts. If matching is based solely on similarity, it will be difficult to find the optimal matching result, leading to inaccurate matching. Summary of the Invention
[0004] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a waveform curve matching method and apparatus, which solve the above-mentioned technical problems.
[0005] According to one aspect of this application, a waveform curve matching method is provided for matching a first waveform curve and a second waveform curve. The waveform curve matching method includes: dividing the first waveform curve into a plurality of first waveform segments; dividing the second waveform curve into a plurality of second waveform segments; and calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve.
[0006] In one embodiment, calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments includes: calculating a first self-value for each first waveform segment; wherein the first self-value represents a waveform feature value of the first waveform segment; calculating a second self-value for each second waveform segment; wherein the second self-value represents a waveform feature value of the second waveform segment; and calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the plurality of first self-values and the plurality of second self-values.
[0007] In one embodiment, calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the plurality of first self-values and the plurality of second self-values includes: calculating a single combination value between a single first waveform segment and a single second waveform segment based on the plurality of first self-values and the plurality of second self-values; calculating a multiple combination value between a single first waveform segment and a plurality of consecutive second waveform segments, or between a single second waveform segment and a plurality of consecutive first waveform segments, based on the plurality of first self-values and the plurality of second self-values; and calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the single combination value and the multiple combination value.
[0008] In one embodiment, calculating the combined cost value between a single first waveform segment and a single second waveform segment based on a plurality of first self-cost values and a plurality of second self-cost values includes: calculating the sum of the cost values of all first self-cost values and all second self-cost values; calculating the sum of the durations of all first waveform segments and all second waveform segments; obtaining at least one sub-segment corresponding to the shorter duration segment of the single first waveform segment and the single second waveform segment based on the longer duration segment among the single first waveform segment and the single second waveform segment; wherein the duration of the sub-segment is equal to the duration of the shorter duration segment; calculating the sum of the differences between each sub-segment and the shorter duration segment; selecting the sub-segment with the smallest sum of differences as the optimal sub-segment; calculating the similarity between the optimal sub-segment and the shorter duration segment; and calculating the combined cost value between the single first waveform segment and the single second waveform segment based on the sum of cost values, the sum of durations, the duration corresponding to the shorter duration segment, and the similarity.
[0009] In one embodiment, calculating the similarity between the optimal sub-segment and the shorter segment includes: calculating the minimum and maximum values of multiple moments in the optimal sub-segment and the shorter segment; calculating the sum of multiple minimum values and the sum of multiple maximum values to obtain a total sum of minimum values and a total sum of maximum values; and calculating the similarity between the optimal sub-segment and the shorter segment based on the total sum of minimum values and the total sum of maximum values; wherein the similarity is positively correlated with the total sum of minimum values and negatively correlated with the total sum of maximum values.
[0010] In one embodiment, calculating the multiple combination costs between a single first waveform segment and multiple consecutive second waveform segments, or a single second waveform segment and multiple consecutive first waveform segments, based on a plurality of first self-cost values and a plurality of second self-cost values, includes: calculating the sum of the costs of all first self-cost values and all second self-cost values; calculating the sum of the durations of all first waveform segments and all second waveform segments; and obtaining at least one sub-segment corresponding to the shorter segment among the single first waveform segment and the plurality of consecutive second waveform segments based on the longer segment among the single first waveform segment and the plurality of consecutive second waveform segments, or based on the single second waveform segment and the plurality of consecutive first waveform segments... For each longer segment in a waveform segment, at least one sub-segment is obtained that corresponds to a shorter segment in the single second waveform segment and the plurality of consecutive first waveform segments; wherein the duration of the sub-segment is equal to the duration of the shorter segment; the sum of the differences between each sub-segment and the shorter segment is calculated; the sub-segment with the smallest sum of differences is selected as the optimal sub-segment; the similarity between the optimal sub-segment and the shorter segment is calculated; and multiple combinations of cost values between the single first waveform segment and the plurality of consecutive second waveform segments, or between the single second waveform segment and the plurality of consecutive first waveform segments, are calculated based on the sum of cost values, the sum of durations, the duration corresponding to the shorter segment, and the similarity.
[0011] In one embodiment, calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the single-group substitution value and the multiple-group substitution value includes: constructing a cost matrix using the plurality of first waveform segments and the plurality of second waveform segments as rows and columns, respectively; wherein, auxiliary rows are set between adjacent first waveform segments, and auxiliary columns are set between adjacent second waveform segments, the values corresponding to the first waveform segments and the second waveform segments in the cost matrix are real cross values, the values corresponding to the auxiliary rows and the auxiliary columns are auxiliary cross values, the real cross value is the minimum value among the left-side value, the upper-left value, and the upper-side value of the real cross value, and the auxiliary cross value is the minimum value among the left-side value, the upper-left value, and the upper-side value of the auxiliary cross value; and calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the cost matrix.
[0012] In one embodiment, calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the cost matrix includes: taking the lower right element of the cost matrix as the sum of the matching costs between the plurality of first waveform segments and the plurality of second waveform segments; and finding the optimal path from the lower right element to the upper left element of the cost matrix to obtain the matching method between the plurality of first waveform segments and the plurality of second waveform segments.
[0013] In one embodiment, finding the optimal path from the lower right corner element to the upper left corner element of the cost matrix includes: starting from the lower right corner element, determining the direction of the optimal path based on the numerical source of the current element; wherein the direction of the optimal path is consistent with the numerical source of the current element.
[0014] According to another aspect of this application, a waveform curve matching apparatus is provided for matching a first waveform curve and a second waveform curve, comprising: a first segmentation module for segmenting the first waveform curve into a plurality of first waveform segments; a second segmentation module for segmenting the second waveform curve into a plurality of second waveform segments; and a matching calculation module for calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve.
[0015] This application provides a waveform curve matching method and apparatus, which involves dividing a first waveform curve into multiple first waveform segments; dividing a second waveform curve into multiple second waveform segments; and calculating the matching degree between the multiple first waveform segments and the multiple second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve. Specifically, both the first and second waveform curves are divided into waveform segments, and then each waveform segment is compared to eliminate redundant and missing segments, thereby finding accurate matching results and improving matching accuracy, thus enhancing the precision of calculating the similarity between the first and second waveform curves. Attached Figure Description
[0016] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0017] Figure 1 This is a schematic flowchart of a waveform curve matching method provided in an exemplary embodiment of this application.
[0018] Figure 2 This is a schematic diagram of the structure of the first waveform curve and the second waveform curve provided in another exemplary embodiment of this application.
[0019] Figure 3 This is a schematic diagram of the structure of the first waveform segment and the second waveform segment provided in another exemplary embodiment of this application.
[0020] Figure 4 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application.
[0021] Figure 5 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application.
[0022] Figure 6 This is a flowchart illustrating a single-combination cost calculation method in a waveform curve matching method provided by an exemplary embodiment of this application.
[0023] Figure 7 This is a schematic flowchart of a multi-combination cost calculation method in a waveform curve matching method provided by an exemplary embodiment of this application.
[0024] Figure 8 This is a flowchart illustrating the matching degree calculation method in a waveform curve matching method provided by an exemplary embodiment of this application.
[0025] Figure 9 This is a schematic diagram of the structure of a cost matrix provided in an exemplary embodiment of this application.
[0026] Figure 10 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application.
[0027] Figure 11 This is a schematic diagram of the matching result of the waveform curve provided in an exemplary embodiment of this application.
[0028] Figure 12 This is a schematic diagram of the structure of a waveform curve matching device provided in an exemplary embodiment of this application.
[0029] Figure 13 This is a schematic diagram of the structure of a waveform curve matching device provided in another exemplary embodiment of this application.
[0030] Figure 14 This is a structural diagram of an electronic device provided in an exemplary embodiment of this application. Detailed Implementation
[0031] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0032] Figure 1 This is a schematic flowchart illustrating a waveform curve matching method provided in an exemplary embodiment of this application. The waveform curve matching method is used to match a first waveform curve and a second waveform curve, such as... Figure 1 As shown, the matching method for this waveform curve includes the following steps:
[0033] Step 100: Divide the first waveform curve into multiple first waveform segments.
[0034] The first waveform curve is sliced to divide it into multiple first waveform segments, and these segments can be numbered (e.g., curve 1-1, curve 1-2, ...). Specifically, the slicing method can be an edge detection algorithm or other algorithm suitable for waveform curve slicing; this application does not limit the specific slicing method.
[0035] Step 200: Divide the second waveform curve into multiple second waveform segments.
[0036] The second waveform curve is sliced to divide it into multiple second waveform segments, and these segments can be numbered (e.g., curve 2-1, curve 2-2, ...). Specifically, the slicing method can be an edge detection algorithm or other algorithm suitable for waveform curve slicing; this application does not limit the specific slicing method.
[0037] like Figure 2 The diagram shows the structure of the first and second waveform curves. Figure 3 The diagram shows the structure of the first and second waveform segments obtained by dividing the first and second waveform curves. Figure 2 and 3 As shown, by dividing the first waveform curve and the second waveform curve into multiple first waveform segments and multiple second waveform segments, and matching the multiple first waveform segments and multiple second waveform segments, the matching accuracy is improved.
[0038] Step 300: Calculate the matching degree between multiple first waveform segments and multiple second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve.
[0039] By matching the first waveform segment and the second waveform segment, redundant or missing waveform segments in the first and second waveform curves can be eliminated, thus avoiding the participation of such redundant or missing waveform segments in the matching process, thereby improving the accuracy and precision of the matching.
[0040] This application provides a waveform curve matching method, which involves dividing a first waveform curve into multiple first waveform segments; dividing a second waveform curve into multiple second waveform segments; and calculating the matching degree between the multiple first waveform segments and the multiple second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve. Specifically, both the first and second waveform curves are divided into waveform segments, and then each waveform segment is compared to eliminate redundant and missing segments, thereby finding accurate matching results and improving matching accuracy, thus enhancing the precision of calculating the similarity between the first and second waveform curves.
[0041] Figure 4 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application. Figure 4 As shown, step 300 above may include:
[0042] Step 310: Calculate the first self-cost value of each first waveform segment.
[0043] Here, the first self-cost value represents the waveform feature value of the first waveform segment. The first self-cost value indicates the cost when the corresponding first waveform segment is not matched. Specifically, the calculation of the first self-cost value can be related to the duration and power value of the corresponding first waveform segment. For example, the first self-cost value can be equal to the sum of the power values at each time point in the corresponding first waveform segment. For example, if the first waveform segment is curve 1-1(6,48), then the duration of this first waveform segment... Firstly, its intrinsic value
[0044] Step 320: Calculate the second self-value of each second waveform segment.
[0045] The second self-cost value represents the waveform characteristic value of the second waveform segment. The second self-cost value represents the cost when the corresponding second waveform segment is not matched. Specifically, the calculation of the second self-cost value can be related to the duration and power value of the corresponding second waveform segment. For example, the second self-cost value can be equal to the sum of the power values at each time point in the corresponding first waveform segment.
[0046] Step 330: Calculate the matching degree between multiple first waveform segments and multiple second waveform segments based on multiple first self-values and multiple second self-values.
[0047] After obtaining multiple first self-values and multiple second self-values, the matching degree between multiple first waveform segments and multiple second waveform segments is calculated based on the multiple first self-values and multiple second self-values. Specifically, the matching method with the minimum total value after matching multiple first waveform segments and multiple second waveform segments is the optimal matching result.
[0048] Figure 5 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application. Figure 5 As shown, step 330 above may include:
[0049] Step 331: Calculate the single-combination value between a single first waveform segment and a single second waveform segment based on multiple first self-values and multiple second self-values.
[0050] Since there may be redundant or missing waveform segments in the first and second waveform curves, the optimal matching method can be obtained by calculating the single combination cost value between a single first waveform segment and a single second waveform segment, thus avoiding misalignment of the entire matching caused by redundant or missing waveform segments. Let the single combination cost value of curve 1-i and curve 2-j be...
[0051] Step 332: Calculate the multiple combination values between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments, based on multiple first self-values and multiple second self-values.
[0052] Since a large waveform segment may be divided into multiple smaller waveform segments during the segmentation process, there may be situations where one waveform segment corresponds to multiple waveform segments. To ensure matching accuracy, this application considers both one-to-many matching methods, i.e., matching between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments. Let the multiple combination cost values of curve 1-i, curve 2-j1, and curve 2-j2 be denoted as... The multiple combination cost values of curve 1-i1, curve 1-i2 and curve 2-j are
[0053] Step 333: Calculate the matching degree between multiple first waveform segments and multiple second waveform segments based on the single-group substitution value and the multi-group substitution value.
[0054] The single-group and multi-group substitution values mentioned above are all negative, meaning that matching eliminates a portion of the substitution value of each segment within the combination. After obtaining the single-group and multi-group substitution values, the optimal matching method between multiple first waveform segments and multiple second waveform segments is found based on these values, and then the matching similarity between the first waveform curve and the second waveform curve is calculated.
[0055] Figure 6 This is a schematic flowchart illustrating a single-combination cost calculation method within a waveform curve matching method provided in an exemplary embodiment of this application. Figure 6 As shown, step 331 above may include:
[0056] Step 3311: Calculate the total value of all first self-costs and all second self-costs.
[0057] Calculate the sum of the first self-cost values of all first waveform segments and the second self-cost values of all second waveform segments, which is cost. sum .
[0058] Step 3312: Calculate the total duration of all first waveform segments and all second waveform segments.
[0059] Calculate the sum of the durations of all first waveform segments in the first waveform curve and the second waveform segment in the second waveform curve. sum .
[0060] Step 3313: Based on the longer segment in the single first waveform segment and the single second waveform segment, obtain at least one sub-segment corresponding to the shorter segment in the single first waveform segment and the single second waveform segment.
[0061] In this process, the duration of a sub-segment is equal to the duration of the shorter segment. Since the durations of the matched individual first waveform segment and individual second waveform segment may differ, to better match individual first waveform segments and individual second waveform segments, it is necessary to find out which specific segment within the longer segment matches the shorter segment. Therefore, by dividing the longer segment into sub-segments corresponding to the shorter segment, the matching accuracy is improved.
[0062] Step 3314: Calculate the sum of the differences between each sub-segment and the shorter segments.
[0063] Step 3315: Select the sub-segment with the smallest sum of differences as the optimal sub-segment.
[0064] Specifically, calculate the index corresponding to the optimal matching interval between the two waveform segments. minThis means determining which part of the longer segment the shorter segment should correspond to. For example, the durations of the two segments are... and The segment corresponding to the smaller of the two values (i.e., the shorter segment) is shifted from left to right within the segment corresponding to the larger value (i.e., the longer segment), shifting by one sampling time interval at a time. The sum of the power differences between the two segments within each small segment interval, cost, is calculated. error After moving from left to right, generate a set (i.e., multiple) of costs. error Find out the cost error Find the value with the smallest value, and then obtain the index corresponding to this smallest value. min That is, the index was moved from left to right. min For each sampling time, this index is the optimal matching index for reaching the optimal matching interval.
[0065] Step 3316: Calculate the similarity between the optimal sub-segment and the shorter segment.
[0066] In one embodiment, step 3316 can be implemented as follows: calculating the minimum and maximum values of multiple moments in the optimal sub-segment and the shorter segment, calculating the sum of multiple minimum values and the sum of multiple maximum values to obtain the sum of minimum values and the sum of maximum values, and calculating the similarity between the optimal sub-segment and the shorter segment based on the sum of minimum values and the sum of maximum values; wherein, the similarity is positively correlated with the sum of minimum values and negatively correlated with the sum of maximum values. Specifically, based on the aforementioned optimal matching index... min yval is the sum of the minimum power values of the smaller segments (shorter segments) and the larger segments (optimal sub-segments) at each time step within a shorter segment interval. min and the sum of the maximum values yval max The ratio of these two values is the similarity between the two segments. i,i,j,j =yval min / yval max Therefore, its maximum value is 1.
[0067] Step 3317: Calculate the single-combination cost between a single first waveform segment and a single second waveform segment based on the total cost, total duration, duration corresponding to the shorter segment, and similarity.
[0068] Specifically, The negative sign indicates that the cost of the combination is eliminated, and the last two terms are cost. sum / time sum It represents the average self-value per unit of time. This means that the combination eliminates twice the duration of the shorter time in these two waveform segments, multiplied by similarity. i,i,j,j This indicates how similar the two waveform segments are. The higher the similarity, the greater the cost that will be eliminated after combining them.
[0069] Figure 7 This is a flowchart illustrating a multi-combination cost calculation method in a waveform curve matching method provided by an exemplary embodiment of this application. Figure 7 As shown, step 332 above may include:
[0070] Step 3321: Calculate the total value of all first self-costs and all second self-costs.
[0071] Step 3322: Calculate the total duration of all first waveform segments and all second waveform segments.
[0072] Step 3323: Based on the longer segment among the single first waveform segment and multiple consecutive second waveform segments, obtain at least one sub-segment corresponding to the shorter segment among the single first waveform segment and multiple consecutive second waveform segments; or based on the longer segment among the single second waveform segment and multiple consecutive first waveform segments, obtain at least one sub-segment corresponding to the shorter segment among the single second waveform segment and multiple consecutive first waveform segments.
[0073] In this design, the duration of a sub-segment is equal to the duration of the shorter segment. Specifically, the combination principle for a single first waveform segment and multiple consecutive second waveform segments is: the sum of the durations of multiple consecutive second waveform segments is less than or equal to the duration of a single first waveform segment; similarly, the combination principle for a single second waveform segment and multiple consecutive first waveform segments is: the sum of the durations of multiple consecutive first waveform segments is less than or equal to the duration of a single second waveform segment. Multiple consecutive waveform segments are simply spliced together end-to-end, with an interval of one sampling time between adjacent segments, thus forming a single overall waveform segment.
[0074] Step 3324: Calculate the sum of the differences between each sub-segment and the shorter segments.
[0075] Step 3325: Select the sub-segment with the smallest sum of differences as the optimal sub-segment.
[0076] Step 3326: Calculate the similarity between the optimal sub-segment and the shorter segment.
[0077] The calculation methods for steps 3321-3326 above are the same as those for steps 3311-3316 above, and will not be repeated here.
[0078] Step 3327: Calculate the multiple combination costs between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments, based on the total cost, total duration, duration corresponding to shorter segments, and similarity.
[0079] This is illustrated using a single first waveform segment and multiple consecutive second waveform segments as an example, such as calculating... That is, the i-th first waveform segment and the j1 to j2-th second waveform segments. Simply concatenate the consecutive segments j1 to j2 of the second waveform segment one end at a time, with a sampling time interval between adjacent segments, and connect them to form a whole waveform segment. Calculate the combined value of this whole segment and the first waveform segment i according to the aforementioned one-to-one combination logic.
[0080] Figure 8 This is a flowchart illustrating the matching degree calculation method in a waveform curve matching method provided by an exemplary embodiment of this application. For example... Figure 8 As shown, step 333 above may include:
[0081] Step 3331: Construct a cost matrix using multiple first waveform segments and multiple second waveform segments as rows and columns, respectively.
[0082] Each waveform segment of the first and second waveform curves is used as a row and column of the cost matrix, arranged sequentially by index. The first row and first column are empty, the last row and last column are also empty, and there is a blank row or column between the indices of adjacent segments. Specifically, as shown... Figure 9 As shown, auxiliary rows are set between adjacent first waveform segments, and auxiliary columns are set between adjacent second waveform segments. In the cost matrix, the values corresponding to the first and second waveform segments are real crossover values, and the values corresponding to the auxiliary rows and columns are auxiliary crossover values. The real crossover value is the minimum of the left-hand, top-left, and top-hand values of the real crossover value. The auxiliary crossover value is the minimum of the left-hand, top-left, and top-hand values of the auxiliary crossover value. There are no values at the intersection of the first waveform segment and the auxiliary column, or at the intersection of the second waveform segment and the auxiliary row. Figure 9 As shown, the first row contains the waveform segments of the first waveform curve, each placed in its corresponding position in the example. Each segment is followed by parentheses containing two numbers, the first of which represents the duration of the segment, "time". col The second represents the cost of the segment itself. col Similarly, each waveform segment of the second waveform curve is sequentially placed into the execution field in the first column of the cost matrix table, followed by the duration (time) of each segment.row and its own cost row .
[0083] In the cost matrix, the value at the real crossover point is the real crossover value (cost). real The value at the auxiliary intersection point is the auxiliary intersection value (cost). aux Each cross value is determined by the three adjacent cross values to its left, top left, and top. After a certain transformation, these three cross values become the left, top left, and top values of the current cross value, respectively. The smallest of these three values is taken as the size of the current cross value. This application updates the cross value iteratively from the top left to the bottom right. Except for the cross value of the first auxiliary row and the first auxiliary column, which is 0, the other cross values can be updated row by row or column by column until the cross value of the last auxiliary row and the last auxiliary column (i.e., the auxiliary cross value of the bottom right corner of the matrix) is updated.
[0084] Step 3332: Calculate the matching degree between multiple first waveform segments and multiple second waveform segments based on the cost matrix.
[0085] In one embodiment, step 3332 can be implemented as follows: the lower right element of the cost matrix is used as the sum of the costs of matching between multiple first waveform segments and multiple second waveform segments (corresponding to the matching degree between multiple first waveform segments and multiple second waveform segments), and the optimal path from the lower right element of the cost matrix to the upper left element is found to obtain the matching method between multiple first waveform segments and multiple second waveform segments.
[0086] Specifically, the optimal path can be found by starting from the bottom right element and determining the direction of the optimal path based on the source of the current element's value. The direction of the optimal path is consistent with the source of the current element's value, that is, the direction of the optimal path is consistent with the direction of the parent node of the current intersection.
[0087] The direction of the smallest of the three values (left, top-left, and top) of the current cross value is the direction pointed to by the parent node of the current cross point. If there are no adjacent cross points in a certain direction, such as in the first auxiliary row, the top-left and top values of all cross points in that row are set to infinity. A special case is that the cross value of the first auxiliary row and the first auxiliary column is set to 0.
[0088] Specifically, the update rules for real crossover values and auxiliary crossover values are as follows:
[0089] Auxiliary cross value ( The method for determining i and j (where i is the i-th auxiliary row and j is the j-th auxiliary column, respectively) is as follows:
[0090] The left side value of the auxiliary cross value is equal to the left cross value. In addition to the value of the (j-1)th segment (referred to as column segment j-1) corresponding to the column to be crossed. The upper side value of the auxiliary cross value is equal to the upper cross value. In addition to the value of the (i-1)th segment (referred to as row segment i-1) corresponding to the row to be crossed. The top-left value of the auxiliary cross value is equal to the top-left cross value. Add the sum of the values of its corresponding row segment i-1 and column segment j-1.
[0091] The smallest of these three values is used as the current auxiliary cross value, expressed by the formula:
[0092]
[0093] The direction in which the minimum value is located (left / upper left / upper) is the direction in which the current auxiliary intersection point points to its parent node, and the intersection point it points to is its parent node.
[0094] by Figure 9 The auxiliary cross value of the 7th auxiliary row and the 5th auxiliary column in the data. For example, its left cross value The cost of the column segment to be crossed is... Its upper cross value The cost of the row segment to be crossed is... Its upper left cross value The corresponding line segment cost value is The cost value of the column segment is Therefore, this auxiliary cross value The minimum value is the upper value, therefore the parent node of this auxiliary cross value is the upper one.
[0095] Real cross value ( The method for determining i and j (where i and j are the i-th and j-th instances, respectively) is as follows:
[0096] The upper left value of the real crossover value is equal to the auxiliary crossover value to the upper left of the real crossover value. In addition to the cost of the one-to-one combination of the row and column segments corresponding to the real cross value, The parent node in this direction points to the top left.
[0097] The left-hand and top-hand values have the same calculation logic. For example, the left-hand value:
[0098] If there is no row-to-multiple-column combination ending with column segment j for the row segment i corresponding to the desired real intersection point, then the left-hand side value is directly set to infinity.
[0099] If there exists a row-to-many column combination, then iterate through all the row-i combinations ending with column segment j and calculate the value of each such combination. Where m is the number of column segments in the combination, plus the auxiliary cross value at the top left of the cross point of this combination. The sum of the intrinsic values of all column segments preceding column segment j within the combination. The result of each such combination is compared, and the minimum value is the value to its left. n represents the number of row-to-multiple column combinations in all i-th row segments that end with column segment j. The continuous pointing path of this combination is also recorded as a basis for finding the parent node. For example, if the current optimal row-to-column combination is a one-to-three combination (one row to three columns), then the continuous pointing path is left → left → top left, and the final auxiliary intersection pointed to by the top left is its parent node.
[0100] Similarly, we can obtain the upper side value and its continuous pointing path:
[0101] If there is no column segment j corresponding to the desired real intersection point that is a combination of multiple rows ending with row segment i, then the upper value is directly set to infinity.
[0102] If there exists a column-to-many row combination, then iterate through all columns j ending with row segment i and calculate the value of each such combination. Where m is the number of row segments in the combination, plus the auxiliary cross value to the upper left of the topmost real cross point of this combination. The sum of the intrinsic values of all line segments preceding line segment i in the combination. The results of each such combination are compared, and the minimum value is the value above it. n represents the number of column-to-row combinations in all segments ending with row segment i. The continuous pointing paths of these combinations are also recorded as a basis for finding the parent node.
[0103] The smallest of these three values is taken as the current real crossover value, which can be expressed by the formula:
[0104]
[0105] The parent node is determined as follows: if the smallest one is on the top left, its parent node is the auxiliary intersection point on the top left; if it is on the left or top, its parent node is the auxiliary intersection point that the continuous pointing path in that direction eventually points to.
[0106] by Figure 9 The real cross value of the last row and the last column of the data. For example, its upper left auxiliary cross value The value of the one-to-one combination of the row and column segments corresponding to this real cross value Its upper value, based on the duration of the corresponding row and column segments, since the column segment 15 corresponding to the actual intersection point does not have a column-to-multiple-row combination ending with row segment 14, therefore The left-hand value, based on the duration of the corresponding row and column segments, since the row segment 14 corresponding to the actual intersection point has a column-to-multiple row combination ending with column segment 15, there are a total of two combination methods: (14,14,14,15) and (14,14,13,15), i.e., n=2. Therefore, Substituting the corresponding values, we get the minimum value as -627, and the one-to-many combination corresponding to the minimum value is (14,14,13,15), that is, row segment 14 corresponds to column segments 13-15.
[0107] Therefore, the real cross value The minimum value is the left-hand value, therefore the parent node of this real intersection value points to the left → left → top left. The parent node is the auxiliary intersection point of the 14th auxiliary row and the 13th auxiliary column, and the value of the parent node is represented as...
[0108] As can be seen from the above calculation process, the parent node of an auxiliary intersection point can be either an auxiliary intersection point or a real intersection point, while the parent node of a real intersection point is always an auxiliary intersection point; auxiliary intersection points do not have continuous pointing, while the left or top side of a real intersection point may have multiple levels of continuous pointing.
[0109] After the cost matrix is updated, the auxiliary cross value in its lower right corner represents the total cost value after optimal matching of all segments of the two curves. Starting from the auxiliary cross point in the lower right corner, follow its pointing path to find its parent nodes sequentially until the auxiliary cross point in the upper left corner of the cost matrix. Based on the optimal matching route, the segment matching relationship between the first and second waveform curves can be found. The method for finding the optimal matching route is as follows: starting from the auxiliary cross point in the lower right corner, follow its pointing path to find its parent nodes sequentially until the auxiliary cross point in the upper left corner of the matrix, such as... Figure 9 The gray background path is shown in the diagram. If the parent node of an auxiliary intersection point in the optimal route is also an auxiliary intersection point, then the row or column segments skipped by these two auxiliary intersection points are not matched by any segment; if there are consecutive pointers in the optimal route, it means that there is a one-to-many combination in the optimal match.
[0110] Figure 10 This is a flowchart illustrating a waveform curve matching method provided in another exemplary embodiment of this application. Figure 10 As shown, the matching method for this waveform curve includes the following steps:
[0111] Step 801: Obtain at least two consecutive processing data from the equipment to obtain at least two waveform curves.
[0112] First, obtain the waveform curve that needs to be matched.
[0113] Step 802: Divide the waveform curve into waveform segments for each waveform curve.
[0114] The waveform curve is divided into multiple waveform segments in the manner described above.
[0115] Step 803: Perform matching calculations on the pairwise waveform curves.
[0116] Step 804: Calculate the intrinsic value, duration value, single-group intrinsic value, and multi-group intrinsic value of the two sets of waveform segments.
[0117] The intrinsic value, duration value, single-combination value, and multi-combination value of the waveform segment are calculated using the method described above.
[0118] Step 805: Generate a cost matrix based on the two sets of waveform segments and initialize it to 0.
[0119] Construct a cost matrix based on the two sets of waveform segments to be matched, and initialize the elements of the cost matrix to 0.
[0120] Step 806: Initialize the cross value of the first auxiliary row and the first auxiliary column to 0.
[0121] Step 807: Update each auxiliary cross value and real cross value sequentially from the top left corner to the bottom right corner of the cost matrix.
[0122] The auxiliary cross value and the real cross value of the cost matrix are obtained by updating the auxiliary cross value and the real cross value from the top left corner to the bottom right corner of the cost matrix.
[0123] Step 808: Calculate the total generation value after matching the two sets of fragments.
[0124] The total value after matching the two sets of fragments is the size of the auxiliary cross value of the last auxiliary row and the last auxiliary column in the lower right corner of the cost matrix.
[0125] Step 809: Based on the two sets of waveform segments, generate the corresponding extended parent node matrix and initialize it as an empty array.
[0126] Step 810: Calculate each auxiliary cross value and real cross value based on the left side value, the top left side value, and the top side value.
[0127] The parent node for each auxiliary cross value and real cross value is calculated using the method described above.
[0128] Step 811: Search for the parent node from the bottom right corner of the parent node matrix until the auxiliary intersection of the first auxiliary row and the first auxiliary column in the top left corner.
[0129] That is, to search for the optimal matching path from the bottom right corner to the top left corner.
[0130] Step 812: Based on the search path of the parent node, obtain the matching relationship between the two sets of waveform segments.
[0131] That is, the matching relationship between the two sets of waveform segments is determined based on the optimal matching path.
[0132] Step 813: Calculate the matching similarity between the two waveform curves based on the matching relationship.
[0133] like Figure 11 The diagram shown illustrates the matching results. This application uses the matching method described in the above embodiments to obtain the following results: Figure 11 The matching results shown in the figure indicate that a single waveform segment matches multiple consecutive waveform segments, such as... Figure 11 The 10th and 11th segments of the first waveform curve match the 11th segment of the second waveform curve, while the 8th segment of the second waveform curve does not participate in the matching.
[0134] Figure 12 This is a schematic diagram of a waveform curve matching device provided in an exemplary embodiment of this application. The waveform curve matching device is used to match a first waveform curve and a second waveform curve, such as... Figure 12 As shown, the waveform curve matching device 90 includes: a first segmentation module 91 for segmenting the first waveform curve into multiple first waveform segments; a second segmentation module 92 for segmenting the second waveform curve into multiple second waveform segments; and a matching calculation module 93 for calculating the matching degree between the multiple first waveform segments and the multiple second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve.
[0135] This application provides a waveform curve matching device, which divides a first waveform curve into multiple first waveform segments by a first segmentation module 91; divides a second waveform curve into multiple second waveform segments by a second segmentation module 92; and calculates the matching degree between the multiple first waveform segments and the multiple second waveform segments by a matching calculation module 93 to obtain the matching degree between the first waveform curve and the second waveform curve. That is, both the first waveform curve and the second waveform curve are divided into waveform segments, and then each waveform segment is compared to eliminate the matching of redundant waveform segments and missing segments, so as to find accurate matching results, improve matching accuracy, and thus improve the accuracy of calculating the similarity between the first waveform curve and the second waveform curve.
[0136] Figure 13 This is a schematic diagram of the structure of a waveform curve matching device provided in another exemplary embodiment of this application. For example... Figure 13 As shown, the matching calculation module 93 may include: a first calculation unit 931, used to calculate the first self-value of each first waveform segment, wherein the first self-value represents the waveform feature value of the first waveform segment; a second calculation unit 932, used to calculate the second self-value of each second waveform segment, wherein the second self-value represents the waveform feature value of the second waveform segment; and a third calculation unit 933, used to calculate the matching degree between multiple first waveform segments and multiple second waveform segments based on multiple first self-values and multiple second self-values.
[0137] In one embodiment, the third calculation unit 933 may be further configured to: calculate a single combination value between a single first waveform segment and a single second waveform segment based on a plurality of first self-values and a plurality of second self-values; calculate a multiple combination value between a single first waveform segment and a plurality of consecutive second waveform segments, or between a single second waveform segment and a plurality of consecutive first waveform segments, based on a plurality of first self-values and a plurality of second self-values; and calculate the matching degree between a plurality of first waveform segments and a plurality of second waveform segments based on the single combination value and the multiple combination value.
[0138] In one embodiment, the first calculation unit 931 may be further configured to: calculate the sum of the costs of all first self-costs and all second self-costs; calculate the sum of the durations of all first waveform segments and all second waveform segments; obtain at least one sub-segment corresponding to the shorter duration of a single first waveform segment and a single second waveform segment based on the longer duration of the segment, wherein the duration of the sub-segment is equal to the duration of the shorter duration segment; calculate the sum of the differences between each sub-segment and the shorter duration segment; select the sub-segment with the smallest sum of differences as the optimal sub-segment; calculate the similarity between the optimal sub-segment and the shorter duration segment; calculate the single-combination cost of a single first waveform segment and a single second waveform segment based on the sum of cost, the sum of duration, the duration corresponding to the shorter duration segment, and the similarity; and calculate the single-combination cost of a single first waveform segment and a single second waveform segment based on the sum of cost, the sum of duration, the duration corresponding to the shorter duration segment, and the similarity.
[0139] In one embodiment, the first calculation unit 931 may be further configured to: calculate the minimum and maximum values of multiple moments in the optimal sub-segment and the shorter segment, calculate the sum of multiple minimum values and the sum of multiple maximum values to obtain the sum of minimum values and the sum of maximum values, and calculate the similarity between the optimal sub-segment and the shorter segment based on the sum of minimum values and the sum of maximum values; wherein the similarity is positively correlated with the sum of minimum values and negatively correlated with the sum of maximum values.
[0140] In one embodiment, the second calculation unit 932 may be further configured to: calculate the sum of the costs of all first self-costs and all second self-costs; calculate the sum of the durations of all first waveform segments and all second waveform segments; and, based on the longer duration of a single first waveform segment and a plurality of consecutive second waveform segments, obtain at least one sub-segment corresponding to a shorter duration of a single first waveform segment and a plurality of consecutive second waveform segments, or based on the longer duration of a single second waveform segment and a plurality of consecutive first waveform segments, obtain at least one sub-segment corresponding to a shorter duration of a single second waveform segment and a plurality of consecutive first waveform segments, wherein... The duration of each sub-segment is equal to the duration of the shorter segment; the sum of the differences between each sub-segment and the shorter segment is calculated; the sub-segment with the smallest sum of differences is selected as the optimal sub-segment; the similarity between the optimal sub-segment and the shorter segment is calculated; based on the sum of cost values, the sum of durations, the duration corresponding to the shorter segment, and the similarity, the single combination cost value between a single first waveform segment and a single second waveform segment is calculated; based on the sum of cost values, the sum of durations, the duration corresponding to the shorter segment, and the similarity, the multiple combination cost values between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments, are calculated.
[0141] In one embodiment, the second calculation unit 932 may be further configured to: calculate the minimum and maximum values of multiple moments in the optimal sub-segment and the shorter segment, calculate the sum of multiple minimum values and the sum of multiple maximum values to obtain the sum of minimum values and the sum of maximum values, and calculate the similarity between the optimal sub-segment and the shorter segment based on the sum of minimum values and the sum of maximum values; wherein the similarity is positively correlated with the sum of minimum values and negatively correlated with the sum of maximum values.
[0142] In one embodiment, the third calculation unit 933 may be further configured to: construct a cost matrix using multiple first waveform segments and multiple second waveform segments as rows and columns respectively; and calculate the matching degree between the multiple first waveform segments and multiple second waveform segments based on the cost matrix.
[0143] In one embodiment, the third calculation unit 933 may be further configured to: find the optimal path that minimizes the sum of costs from the lower right corner element to the upper left corner element of the cost matrix, so as to obtain the matching method between the multiple first waveform segments and the multiple second waveform segments, and calculate the matching degree between the multiple first waveform segments and the multiple second waveform segments according to the matching method.
[0144] In one embodiment, the third calculation unit 933 may be further configured to: starting from the lower right corner element, determine the direction of the optimal path based on the source of the current element's value; wherein, the direction of the optimal path is consistent with the source of the current element's value, that is, the direction of the optimal path is consistent with the direction of the parent node of the current intersection point.
[0145] Below, for reference Figure 14 This application describes an electronic device according to embodiments thereof. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.
[0146] Figure 14 A block diagram of an electronic device according to an embodiment of this application is illustrated.
[0147] like Figure 14 As shown, the electronic device 10 includes one or more processors 11 and memory 12.
[0148] The processor 11 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0149] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may execute the program instructions to implement the methods of the various embodiments of this application described above and / or other desired functions. Various contents such as input signals, signal components, and noise components may also be stored in the computer-readable storage medium.
[0150] In one example, the electronic device 10 may also include an input device 13 and an output device 14, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0151] When the electronic device is a standalone device, the input device 13 can be a communication network connector for receiving the collected input signals from the first device and the second device.
[0152] In addition, the input device 13 may also include, for example, a keyboard, a mouse, etc.
[0153] The output device 14 can output various information to the outside, including determined distance information, direction information, etc. The output device 14 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0154] Of course, for the sake of simplicity, Figure 14 Only some of the components of the electronic device 10 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 10 may include any other suitable components depending on the specific application.
[0155] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0156] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0157] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for matching a first waveform curve and a second waveform curve of a numerical control machine tool machining process, the first waveform curve and the second waveform curve being a load curve or a power curve generated by the numerical control machine tool machining process, characterized in that, The waveform curve matching method includes: The first waveform curve is divided into multiple first waveform segments; The second waveform curve is divided into multiple second waveform segments; and Calculate the matching degree between the plurality of first waveform segments and the plurality of second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve, so as to determine whether the two machining processes of the CNC machine tool are consistent or whether each machining process is consistent with the standard machining process; The calculation of the matching degree between the plurality of first waveform segments and the plurality of second waveform segments includes: Calculate the first self-value for each of the first waveform segments; wherein the first self-value represents the waveform feature value of the first waveform segment; Calculate the second self-value for each of the second waveform segments; wherein the second self-value represents the waveform feature value of the second waveform segment; Calculate the single-combination value between a single first waveform segment and a single second waveform segment based on a plurality of first self-values and a plurality of second self-values; Calculate multiple combinations of cost values between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments, based on multiple first self-cost values and multiple second self-cost values; and Based on the single-group substitution value and the multi-group substitution value, the matching degree between the plurality of first waveform segments and the plurality of second waveform segments is calculated; The step of calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the single combination substitution value and the multiple combination substitution value includes: A cost matrix is constructed using multiple first waveform segments and multiple second waveform segments as rows and columns, respectively. Auxiliary rows are set between adjacent first waveform segments, and auxiliary columns are set between adjacent second waveform segments. In the cost matrix, the values corresponding to the first and second waveform segments are real crossover values, and the values corresponding to the auxiliary rows and columns are auxiliary crossover values. The real crossover value is the minimum value among the left-side, upper-left, and upper-side values of the real crossover value, and the auxiliary crossover value is the minimum value among the left-side, upper-left, and upper-side values of the auxiliary crossover value. Wherein, the upper left value of the real cross value is equal to the auxiliary cross value on the upper left side of the real cross value, plus the cost of the one-to-one combination of the row segment and column segment corresponding to the real cross value; If there is no row-to-many column combination ending with column segment j for the row segment i corresponding to the real cross value, set the left side value of the real cross value to infinity; if there is such a row-to-many column combination, iterate through and calculate the cost of all one-to-many combinations ending with column segment j in the i-th row, add the auxiliary cross value to the upper left of the leftmost real cross value of this combination and the sum of the cost of all column segments before column segment j in the combination, compare the results of each such combination, and the minimum value is the left side value of the real cross value; If there is no column-to-many row combination ending with row segment i for the column segment j corresponding to the real cross value, the upper value of the real cross value is set to infinity; if there is such a column-to-many row combination, the cost of all one-to-many combinations ending with row segment i in the j-th column is calculated, and then the auxiliary cross value to the upper left of the top real cross value of this combination and the cost of all row segments before row segment i in the combination are added. The results of each such combination are compared, and the minimum value is the upper value of the real cross value. The left-side value of the auxiliary cross value is equal to the left-side cross value plus the value of the (j-1)th segment corresponding to the column to be crossed; the upper-side value of the auxiliary cross value is equal to the upper-side cross value plus the value of the (i-1)th segment corresponding to the row to be crossed; the upper-left-side value of the auxiliary cross value is equal to the upper-left-side cross value plus the sum of the values of the corresponding row segment i-1 and column segment j-1; and Based on the cost matrix, the matching degree between the plurality of first waveform segments and the plurality of second waveform segments is calculated.
2. The waveform curve matching method according to claim 1, characterized by, The step of calculating the single-combination cost between a single first waveform segment and a single second waveform segment based on a plurality of first self-cost values and a plurality of second self-cost values includes: Calculate the total value of all first self-costs and all second self-costs; Calculate the total duration of all the first waveform segments and all the second waveform segments; Based on the longer segment of the single first waveform segment and the single second waveform segment, at least one sub-segment corresponding to the shorter segment of the single first waveform segment and the single second waveform segment is obtained; wherein the duration of the sub-segment is equal to the duration of the shorter segment; Calculate the sum of the differences between each of the sub-segments and the shorter segment; The sub-segment with the smallest sum of differences is selected as the optimal sub-segment; Calculate the similarity between the optimal sub-segment and the shorter segment; and The single-group cost value between the individual first waveform segment and the individual second waveform segment is calculated based on the sum of the cost values, the sum of the durations, the durations corresponding to the shorter segments, and the similarity.
3. The method of matching waveforms according to claim 2, wherein, The calculation of the similarity between the optimal sub-segment and the shorter segment includes: Calculate the minimum and maximum values at multiple moments between the optimal sub-segment and the shorter segment; Calculate the sum of the plurality of said minimum values and the sum of the plurality of said maximum values to obtain the sum of the minimum values and the sum of the maximum values; and The similarity between the optimal sub-segment and the shorter segment is calculated based on the sum of the minimum and the sum of the maximum values; wherein the similarity is positively correlated with the sum of the minimum values and negatively correlated with the sum of the maximum values.
4. The method of matching a waveform curve according to claim 1, wherein, The step of calculating multiple combination values between a single first waveform segment and multiple consecutive second waveform segments, or between a single second waveform segment and multiple consecutive first waveform segments, based on multiple first self-values and multiple second self-values, includes: Calculate the total value of all first self-costs and all second self-costs; Calculate the total duration of all the first waveform segments and all the second waveform segments; Based on the single first waveform segment and the longer segment among the plurality of consecutive second waveform segments, at least one sub-segment corresponding to the shorter segment among the single first waveform segment and the plurality of consecutive second waveform segments is obtained; or based on the single second waveform segment and the longer segment among the plurality of consecutive first waveform segments, at least one sub-segment corresponding to the shorter segment among the single second waveform segment and the plurality of consecutive first waveform segments is obtained; wherein the duration of the sub-segment is equal to the duration of the shorter segment; Calculate the sum of the differences between each of the sub-segments and the shorter segment; The sub-segment with the smallest sum of differences is selected as the optimal sub-segment; Calculate the similarity between the optimal sub-segment and the shorter segment; and Based on the sum of the cost values, the sum of the durations, the durations corresponding to the shorter segments, and the similarity, the combined cost values of the single first waveform segment and the plurality of consecutive second waveform segments, or the single second waveform segment and the plurality of consecutive first waveform segments, are calculated.
5. The method of matching a waveform curve according to claim 1, wherein, The step of calculating the matching degree between the plurality of first waveform segments and the plurality of second waveform segments based on the cost matrix includes: The lower right element of the cost matrix is used as the sum of the matching costs between the plurality of first waveform segments and the plurality of second waveform segments; and Find the optimal path from the lower right element to the upper left element of the cost matrix to obtain the matching method between the plurality of first waveform segments and the plurality of second waveform segments.
6. The waveform curve matching method according to claim 5, characterized in that, The process of finding the optimal path from the bottom right element to the top left element of the cost matrix includes: Starting from the bottom right element, the direction of the optimal path is determined based on the source of the current element's value; wherein the direction of the optimal path is consistent with the source of the current element's value.
7. A waveform curve matching device, said device being capable of implementing the waveform curve matching method according to any one of claims 1-6, said device being used to match a first waveform curve and a second waveform curve during CNC machine tool machining, wherein the first waveform curve and the second waveform curve are load curves or power curves generated during the CNC machine tool machining process, characterized in that, include: The first segmentation module is used to segment the first waveform curve into multiple first waveform segments; The second segmentation module is used to segment the second waveform curve into multiple second waveform segments; as well as The matching calculation module is used to calculate the matching degree between the plurality of first waveform segments and the plurality of second waveform segments to obtain the matching degree between the first waveform curve and the second waveform curve, so as to determine whether the two processing processes of the CNC machine tool are consistent or whether each processing process is consistent with the standard processing process.