A KNN regression model-based whole-period sampling method and system, storage medium and device

CN123008264APending Publication Date: 2026-10-30NANJING NARI WATER RESOURCES & HYDROPOWER TECH CO LTD +6
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611057218.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种基于KNN回归模型整周期采样方法系统、存储介质及设备,以解决现有方法对恒定角加速度的依赖问题,从而提高重采样精度及降低硬件成本

Benefits of technology

[0009]由上可知,本申请提供了一种基于KNN回归模型整周期采样方法、系统、存储介质及设备,通过KNN回归模型预测目标采样时刻并结合样条插值方法进行重采样,可以有效解决转速波动导致的非整周期采样问题,确保振动信号在角度域的完整性和准确性,具有在变转速工况下实现高精度整周期采样、降低硬件依赖成本、提升振动信号分析准确性的优点。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123008264A_ABST
    Figure CN123008264A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on KNN regression model whole cycle sampling method, system, storage medium and equipment, comprising: obtaining timing sampling key phase signal and vibration signal;In response to obtaining key phase signal, determine key phase time and corresponding rotor angle, construct for training sample set;According to preset equiangular interval, each rotation period is divided, and test set angle set is obtained;Training sample set is input to KNN regression model and is trained;After training, KNN regression model predicts the target sampling time corresponding to each sampling target angle in test set angle set;In response to obtaining vibration signal, according to spline interpolation method and target sampling time, obtain whole cycle resampling vibration signal;The application predicts target sampling time by KNN regression model, carries out whole cycle resampling in combination with spline interpolation method, solves the problem of non-uniform signal sampling under the condition of rotating machinery speed fluctuation, and improves signal analysis precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to sampling methods, systems, storage media, and devices, specifically to an integer period sampling method, system, storage media, and device based on a KNN regression model. Background Technology

[0002] In modern industrial equipment monitoring and rotating machinery fault diagnosis, vibration signal sampling methods are crucial for accurately acquiring equipment operating status information. Traditional timed sampling methods sample vibration signals at fixed time intervals. However, under variable speed conditions, the change in speed leads to a change in signal frequency. Timed sampling may capture vibration signals with incomplete cycles, resulting in spectral leakage and picket fence effects in spectrum analysis. This makes it difficult to accurately extract important features such as signal amplitude and phase.

[0003] To address this issue, integer-cycle sampling technology has emerged. Integer-cycle sampling can capture complete periodic signals, thereby reducing spectral leakage and the picket-fence effect, and extracting signal features more accurately. However, current integer-cycle sampling methods are typically based on the assumption of constant angular acceleration, meaning they perform poorly when dealing with non-constant angular acceleration, limiting their application in various non-uniform rotational speed scenarios. Furthermore, existing integer-cycle sampling systems often rely on specific hardware for data acquisition and processing, which is not only costly but also inconvenient and restrictive for users. Therefore, developing an integer-cycle sampling method that requires no complex hardware support and can handle non-constant angular acceleration is particularly necessary, especially in the field of health monitoring and fault diagnosis of rotating machinery, where this method holds great promise. Summary of the Invention

[0004] The purpose of this invention is to provide a system, storage medium, and device for an integer period sampling method based on a KNN regression model, in order to solve the problem of dependence on constant angular acceleration in existing methods, thereby improving resampling accuracy and reducing hardware costs.

[0005] According to a first aspect of the present invention, a method for integer period sampling based on a KNN regression model is provided, the method comprising: Acquire the key phase signal and vibration signal by timed sampling; In response to acquiring the key phase signal, the key phase moment and the corresponding rotor angle in each rotation cycle of the rotating machinery are determined and constructed as a training sample set; Each rotation cycle is divided into preset equal angular intervals to obtain the test set angle set; The training sample set is input into the KNN regression model for training. In response to the trained KNN regression model, the target sampling time corresponding to each sampled target angle in the test set angle set is predicted; In response to acquiring the vibration signal, an integer-cycle resampled vibration signal is obtained according to the spline interpolation method and the target sampling time.

[0006] According to a second aspect of the present invention, an integer-period sampling system based on a KNN regression model is provided, comprising: The signal acquisition module is used to acquire the key phase signal and vibration signal sampled at regular intervals; The training sample set construction module is used to determine the bond phase moment and corresponding angle of the rotating machinery in each rotation cycle in response to the acquisition of the bond phase signal, and construct a training sample set. The test set angle set construction module is used to divide each rotation cycle according to a preset equal angular interval to obtain the test set angle set. The model training module is used to input the training sample set into the KNN regression model for training. The model prediction module is used to predict the target sampling time corresponding to each sampled target angle in the test set angle set in response to the trained KNN regression model. The whole-cycle sampling signal acquisition module is used to obtain the whole-cycle sampling vibration signal in response to the acquisition of the vibration signal, according to the spline interpolation method and the target sampling time.

[0007] According to a third aspect of the invention, a computer-readable storage medium is provided for storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform an integer sampling method based on a KNN regression model.

[0008] According to a fourth aspect of the present invention, a computing device is provided, comprising one or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs including instructions for executing an integer sampling method based on a KNN regression model.

[0009] As can be seen from the above, this application provides a method, system, storage medium, and device for integer-cycle sampling based on the KNN regression model. By predicting the target sampling time using the KNN regression model and combining it with spline interpolation for resampling, the non-integer-cycle sampling problem caused by speed fluctuations can be effectively solved, ensuring the integrity and accuracy of vibration signals in the angular domain. It has the advantages of achieving high-precision integer-cycle sampling under variable speed conditions, reducing hardware dependency costs, and improving the accuracy of vibration signal analysis. Attached Figure Description

[0010] Figure 1 A schematic diagram of a KNN-based integer-period sampling method provided in an embodiment of the present invention;

[0011] Figure 2 A schematic diagram illustrating the specific process of a KNN-based integer period sampling method provided in an embodiment of the present invention;

[0012] Figure 3 A schematic diagram of an integer-period sampling system architecture based on KNN is provided for an embodiment of the present invention;

[0013] Figure 4 This is a schematic diagram of the original waveform for timing sampling provided in an embodiment of the present invention;

[0014] Figure 5 This is a schematic diagram of an integer-cycle resampling waveform provided in an embodiment of the present invention;

[0015] Figure 6 This is a schematic diagram of the amplitude spectrum of the original waveform obtained by timing sampling, provided in an embodiment of the present invention.

[0016] Figure 7 This is a schematic diagram of the amplitude spectrum of the integer-cycle resampled waveform provided in an embodiment of the present invention;

[0017] Figure 8 This is a schematic diagram of the phase spectrum of the original waveform provided in an embodiment of the present invention;

[0018] Figure 9 This is a schematic diagram of the phase spectrum of the full-cycle resampling waveform provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0020] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0021] Existing sampling methods cannot accurately reflect the actual operating status of equipment under variable speed conditions. Although full-cycle sampling can provide more accurate vibration signal analysis, existing full-cycle sampling systems usually require complex hardware support, resulting in high costs and limited adoption.

[0022] To address this, this application proposes a method, system, storage medium, and device for integer periodic sampling based on a KNN regression model. See also... Figure 1 The method involves acquiring timed sampled key phase signals and vibration signals; in response to acquiring the key phase signals, determining the key phase moment and corresponding rotor angle in each rotation cycle of the rotating machinery, and constructing a training sample set; dividing each rotation cycle into a test set angle set according to a preset equal angular interval; inputting the training sample set into a KNN regression model for training; in response to the trained KNN regression model, predicting the target sampling moment corresponding to each sampled target angle in the test set angle set; and in response to acquiring the vibration signals, obtaining the full-cycle resampled vibration signal according to the spline interpolation method and the target sampling moment.

[0023] For ease of understanding, the following explains some key terms in this embodiment:

[0024] A key phase signal, typically acquired by a key phase sensor, indicates a specific angular position of the rotor of rotating machinery per rotational cycle. This signal provides a synchronization reference between the rotor angle and time.

[0025] Vibration signals reflect the vibration characteristics of mechanical equipment during operation. These signals are an important basis for fault diagnosis and condition monitoring.

[0026] The KNN regression model, or K-nearest neighbor regression model, is a nonparametric statistical method used to predict numerical outputs. This model calculates the distance between the point to be predicted and all points in the training set, selects the K nearest neighbors, and then performs a weighted average based on the output values ​​of these neighbors to obtain the prediction result.

[0027] Full-cycle sampling refers to sampling data at equal angular intervals within one or more complete rotation cycles of rotating machinery. This sampling method helps eliminate the impact of speed fluctuations on signal analysis and improves the accuracy of spectrum analysis.

[0028] Spline interpolation is a method that approximates or interpolates data points by constructing a piecewise polynomial function. This method generates smooth curves and is often used for data reconstruction and signal resampling to obtain signal values ​​at points other than the original samples.

[0029] Example 1

[0030] This embodiment provides a periodic sampling method based on the KNN regression model. (See attached...) Figure 2 The method specifically includes the following steps:

[0031] S1. Acquire the key phase signal and vibration signal by timed sampling.

[0032] Specifically, the bond phase signal and vibration signal generated within a fixed time interval are acquired, and the signal array k obtained from the bond phase signal is... t It can be represented as Where M represents the number of bond phase points; the array of measurement points y obtained from the vibration signal j It can be represented as ,in Indicates the measuring point j At sampling time i The collected vibration signals.

[0033] S2. In response to acquiring the key phase signal, determine the key phase moment and the corresponding rotor angle in each rotation cycle of the rotating machinery, and construct a training sample set.

[0034] Specifically, in response to acquiring the timed sampled key phase signal, the rotation of the rotating machinery rotor in each rotation cycle (in 2...) is determined. The bond phase moments (for one cycle) and their corresponding rotor angles are used to construct a training sample set. Its expression is as follows: ;

[0035] in, express The rotor angle at that moment It represents the key phase time corresponding to a known key phase signal.

[0036] Under variable speed conditions, the angular velocity of the rotor in rotating machinery varies, resulting in a nonlinear relationship between time and angle. This embodiment constructs a training sample set by explicitly pairing the sampling time corresponding to each key phase signal with its rotor angle. The discrete key phase signals are transformed into a continuous mapping set that can be used to train the machine learning model, enabling the model to accurately capture the impact of speed changes on the correspondence between sampling time and rotor angle, providing a data foundation for accurate prediction of resampling times. Simultaneously, it avoids the dependence of traditional methods on constant angular acceleration, improving the method's adaptability and accuracy.

[0037] S3. Divide each rotation cycle into preset equal angular intervals to obtain the test set angle set.

[0038] Specifically, as one implementation method, each rotation cycle can be evenly divided into C sampling points at preset equal angular intervals to generate a test set of angles for M rotation cycles. The angles in the test set angle set can be understood as the target angles that are expected to be sampled for an entire period.

[0039] This embodiment generates a series of resampled target angles uniformly distributed in the angular domain. This precise, equiangular division ensures that the final resampled vibration signal is stationary in the angular domain under varying rotational speeds, thereby eliminating non-stationarity in the time domain. Parameter C is adjusted to meet different precision requirements; this mathematical rigor is the foundation for achieving high-precision integer-cycle sampling and effectively suppresses spectral leakage and the picket fence effect.

[0040] S4. Input the training sample set into the KNN regression model for training; in response to the trained KNN regression model, predict the target sampling time corresponding to each sampling target angle in the test set angle set.

[0041] Specifically, the training sample set D will be constructed. train The input is fed into the KNN regression model for training, and then the trained KNN regression model is used to analyze each sampled target angle in the test set angle set. Prediction is performed to obtain the target sampling time. .

[0042] The KNN regression model makes predictions by including the following steps:

[0043] S401, Calculate the angle of the sampling target. The Euclidean distance d between each rotor angle in the training sample set k The value, the Euclidean distance calculation formula is: ;

[0044] in, This represents the given angle to be predicted, i.e., the angle of the sampling target. k This represents the angle of each rotor in the training sample set.

[0045] S402. Based on the Euclidean distance value, select the K target rotor angles from the training sample set that are closest to the sampled target angle, and denot them as the set. And assign weights to each target rotor angle. The formula is as follows: ;

[0046] in, This represents the smallest positive number that prevents the denominator from being zero.

[0047] S403, based on the weight of each target rotor angle The target sampling time is obtained by weighted averaging the sampling times of the K closest target rotor angles, as shown in the following formula: ;

[0048] This leads to the predicted target sampling time sequence, expressed as follows: .

[0049] The KNN regression model can accurately predict the resampling time of each sampling target angle, providing a precise time reference for subsequent interpolation.

[0050] S5. In response to acquiring the vibration signal, obtain the full-cycle resampled vibration signal according to the spline interpolation method and the target sampling time.

[0051] Specifically, since the vibration signal is sampled at the original time, its sampling time may not perfectly match the predicted resampling target sampling time. Spline interpolation is a high-precision interpolation method that can smoothly reconstruct the vibration signal values ​​at these precise times based on the original sampling time and the predicted sampling time. This interpolation not only ensures the continuity and smoothness of the signal but also effectively reduces spectral leakage and the picket fence effect, thereby obtaining more accurate amplitude and phase information.

[0052] Based on the spline interpolation method and the resampled vibration signal at the target sampling time, the full-cycle resampled vibration signal is obtained. Specifically:

[0053] S501, in response to the timed sampling vibration signal, in each interval Define a cubic spline function that satisfies preset conditions. The formula is as follows: , This represents the coefficient to be determined.

[0054] The cubic spline function for each interval must satisfy the following conditions:

[0055] (1) Function values ​​are continuous: , ;

[0056] (2) The first derivative is continuous: ;

[0057] (3) The second derivative is continuous: ;

[0058] (4) Natural boundary conditions: , .

[0059] Natural boundary conditions are applied by forcibly setting the interpolation curve at the start time t1 and the end time t2. N The second derivative (i.e., curvature) at the point is zero, causing the spline function curve to exhibit a flat or linear trend at both ends. This boundary treatment helps avoid unnatural oscillations or excessive bending at the signal boundaries when there is no additional information to guide the behavior at the signal ends, thereby ensuring the smoothness and physical rationality of the entire interpolated signal and improving the reliability of the interpolation results.

[0060] S502, Set Its value can be obtained by recursively solving a system of tridiagonal equations. The recursive formula is: ;

[0061] Among them, M n It is the value of the second derivative, representing the spline function curve at node t. n curvature at y n and y n+1 These are nodes t n and t n+1 Vibration signal values ​​at; M1 and M N h represents the boundary conditions, set to zero to represent natural boundary conditions; n h represents the time interval between nodes. n The calculation formula is: , where t n and t n+1 It is the time scale of adjacent nodes.

[0062] In response to the solution obtained M i The spline function over each interval can be expressed as: .

[0063] S503, Response to the target sampling time of the entire cycle Determine its interval Using the formula The vibration signal interpolation is calculated to obtain the full-cycle resampled vibration signal.

[0064] High-precision vibration signal values ​​can be obtained at predicted sampling times using spline interpolation, generating full-cycle sampled signals. By defining the spline function as a piecewise cubic polynomial and pre-setting the continuity of the function values, first derivative, and second derivative at the nodes, these continuity conditions are crucial for cubic spline interpolation to generate smooth, continuous interpolation curves with continuous curvature. This ensures that the resampled vibration signal does not exhibit sharp jumps or unnatural distortions on the time axis, thus preserving the physical characteristics of the original signal to the maximum extent, effectively reducing spectral leakage and the picket fence effect, and improving the accuracy of signal analysis.

[0065] This embodiment constructs a KNN regression model to learn the nonlinear mapping relationship between rotor angle and sampling time, and combines it with cubic spline interpolation to resample the vibration signal, effectively solving the problem that traditional time-based sampling data cannot accurately reflect the equipment's operating status under variable speed conditions. This achieves full-cycle sampling without complex hardware support, reducing system costs and promotion difficulty, while improving the accuracy of vibration signal analysis. Experimental verification shows that compared with traditional time-based sampling methods, this method reduces amplitude error from 60.85% to 0% and phase error from 75.41% to 1.51%, significantly improving the accuracy of frequency domain analysis and effectively suppressing spectral leakage. The signal after full-cycle resampling has highly concentrated energy in the frequency domain, eliminating temporal non-stationarity and providing a reliable data foundation for rotor fault diagnosis and condition monitoring.

[0066] In some of the above-mentioned solutions of this application, this application further proposes to divide each rotation cycle into C sampling points at a preset equal angular interval, and generate a test set angle set including the sampled target angles within M rotation cycles;

[0067] The formula for calculating the angle of the sampling target is: ;

[0068] Where i represents the i-th rotation cycle, and j represents the sampling time number corresponding to each rotation cycle.

[0069] The above technical solution solves the problems of uniformity and computability in generating the test set angles by uniformly dividing the angle within each rotation cycle into C sampling points and generating a test set angle set for M rotation cycles. This uniform division ensures the equal distribution of angle intervals and avoids sampling point distribution deviations caused by non-uniform division, thereby improving the quality of the test set. Therefore, this solution enhances the representativeness and comprehensiveness of the test set, enabling the KNN regression model to more accurately learn the mapping relationship between rotor angles and sampling times. This provides a more precise target sampling time for subsequent spline interpolation resampling, ultimately generating high-quality whole-cycle sampled vibration signals and effectively improving the accuracy and reliability of the KNN regression model-based whole-cycle sampling method.

[0070] In the process of resampling vibration signals, this application introduces a cubic spline function that meets preset conditions to ensure the smoothness and continuity of the reconstructed signal, effectively avoiding signal distortion caused by inaccurate interpolation. In some embodiments of this application, the preset conditions are further proposed as follows: the cubic spline function satisfies continuous function value, continuous first derivative, continuous second derivative, and natural boundary conditions.

[0071] Function value continuity means that the function values ​​of adjacent cubic spline function segments must be equal at the junctions of different sampling time intervals. This ensures that the interpolation curve precisely matches the original data points at all data points, without breaks or jumps at nodes, thus guaranteeing the amplitude accuracy and signal integrity of the reconstructed vibration signal. First derivative continuity means that the first derivatives of adjacent cubic spline function segments must be equal at the junctions of different sampling time intervals. This ensures a smooth transition of the interpolation curve at nodes, avoiding sharp corners or unnatural abrupt changes, effectively preserving the dynamic change trend and waveform characteristics of the vibration signal, and reducing the introduction of high-frequency noise. Second derivative continuity means that the second derivatives (i.e., curvature) of adjacent cubic spline function segments must be equal at the junctions of different sampling time intervals. This further ensures the smoothness of the interpolation curve, making the curvature of the curve change continuously throughout the interval, avoiding oscillations or instabilities that may occur during the interpolation process, thus making the reconstructed vibration signal closer to the real physical vibration characteristics.

[0072] A natural boundary condition means that the second derivative of the cubic spline function is set to zero at both the start and end points of the entire interpolation interval. This means that at the two endpoints of the signal, the spline curve appears as a straight line, i.e., with zero curvature. This choice of boundary condition helps minimize the additional errors and unnatural curvature introduced by interpolation at the boundaries, effectively avoiding distortion at the start and end points of the signal, thereby improving the accuracy and reliability of the entire resampled signal.

[0073] The above technical solution clearly defines the preset conditions for the cubic spline function in the resampling process, requiring continuity of function values, first derivatives, and second derivatives, as well as satisfaction of natural boundary conditions. These conditions work together to ensure that the generated whole-cycle sampled vibration signal has high smoothness and accuracy when resampling vibration signals using spline interpolation. Continuity of function values ​​avoids jumps in signal amplitude, continuity of the first derivative ensures a smooth transition in signal variation trends, continuity of the second derivative further suppresses oscillations during interpolation, and natural boundary conditions effectively reduce distortion caused by boundary effects. These precise continuity requirements and boundary processing enable the reconstructed vibration signal to more realistically reflect the characteristics of the original signal, thereby significantly reducing spectral leakage and picket fence effects that may occur with traditional timed sampling under varying speed conditions. This provides a more accurate and reliable data foundation for subsequent vibration signal analysis (such as amplitude spectrum and phase spectrum analysis).

[0074] Example 2

[0075] Traditional timed sampling methods cannot accurately reflect the actual operating status of equipment under variable speed conditions. Although full-cycle sampling can provide more accurate vibration signal analysis, existing full-cycle sampling systems usually require complex hardware support, resulting in high costs and limited adoption.

[0076] To address this, this application proposes an integer-period sampling system based on the KNN regression model. (See reference...) Figure 3 The system includes:

[0077] The signal acquisition module is used to acquire key phase signals and vibration signals sampled at regular intervals. The key phase signal indicates the specific angular position of the rotor of the rotating machinery per rotation cycle; the vibration signal reflects the operating state of the rotating machinery.

[0078] The training sample set construction module is used to determine the bond phase moment and corresponding angle of the rotating machinery in each rotation cycle in response to the acquired bond phase signal, and construct a training sample set. These bond phase signals and corresponding moments constitute the training samples of the angle-time mapping relationship, providing training data for the subsequent KNN regression model.

[0079] The test set angle collection construction module is used to divide each rotation cycle at preset equal angular intervals to obtain the test set angle collection. Specifically, this module evenly divides each rotation cycle into C sampling points at preset equal angular intervals, generating a test set angle collection that includes the sampled target angles within M rotation cycles. The formula for calculating the sampled target angle is: ;

[0080] Here, i represents the i-th rotation cycle, and j represents the sampling time number corresponding to each rotation cycle. This division method ensures uniform sampling in the angle domain, providing a basis for subsequent whole-cycle sampling.

[0081] The model training module inputs the training sample set into the KNN regression model for training. During model training, this module calculates the Euclidean distance between the sampled target angle and each rotor angle in the training sample set. Based on the Euclidean distance, it selects the K target rotor angles in the training sample set that are closest to the sampled target angle and assigns weights to each target rotor angle. Then, it performs a weighted average of the sampling times of the aforementioned K target rotor angles based on their weights to obtain the target sampling time. This KNN-based regression method can effectively handle nonlinear angle-time mapping relationships.

[0082] The model prediction module responds to the trained KNN regression model, predicting the target sampling time corresponding to each sampled target angle in the test set angle set. In this way, the system can determine the corresponding time point at equal angular intervals, preparing for subsequent signal resampling.

[0083] The whole-cycle sampling signal acquisition module responds to the acquisition of the vibration signal by obtaining the whole-cycle sampling vibration signal according to the spline interpolation method and the target sampling time.

[0084] Specifically, in response to the timed sampling vibration signal, in each interval Define a cubic spline function that satisfies the preset conditions. The formula is as follows: , Indicates the coefficient to be determined;

[0085] set up ;

[0086] Using the tridiagonal system of equations 6( / - / The solution is obtained by recursion. ;

[0087] in, The value of the second derivative is given, and the curvature of the spline function curve at the nodes is also given. and Representing nodes respectively and Vibration signal value at the location; The time interval between nodes is represented by the formula h. n =t n+1-t n ;t n and t n+1 Indicates the time scale of adjacent nodes; and This represents the boundary conditions; setting it to zero indicates a natural boundary condition.

[0088] In response to the solution obtained The cubic spline function over each interval can be expressed as: ;

[0089] Response to the target sampling time of the entire cycle Determine its interval Using the formula The vibration signal interpolation is calculated to obtain the full-cycle resampled vibration signal.

[0090] This KNN regression-based whole-cycle sampling system can convert non-stationary vibration signals obtained through time-based sampling into stationary signals in the angular domain, effectively eliminating temporal non-stationarity. The system accurately captures the amplitude and phase characteristics of rotating machinery vibration signals, significantly improving the accuracy of spectral analysis. Compared to traditional time-based sampling, this system effectively suppresses spectral leakage and improves the accuracy of spectral analysis, providing reliable technical support for the condition monitoring and fault diagnosis of rotating machinery. This system is suitable for vibration signal analysis of various rotating machinery, especially for vibration monitoring under non-stationary conditions such as the acceleration process of hydroelectric generators, where speed variations are significant, demonstrating significant application value.

[0091] Based on the same technical solution, the present invention also discloses a computer-readable storage medium for storing one or more programs, wherein the one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the above-described method.

[0092] Based on the same technical solution, the present invention also discloses a computing device, including one or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, and the one or more programs include instructions for performing the above-described method.

[0093] Example 3

[0094] The following example will provide a more detailed explanation of the above technical solution:

[0095] When monitoring the condition of a rotating machine, the rotational speed may change nonlinearly during operation, making it difficult for traditional timed sampling methods to obtain vibration signals that accurately reflect the actual operating state of the equipment. To address this issue, this embodiment provides an integer-cycle sampling method based on a KNN regression model, specifically including the following steps:

[0096] S1. Continuously acquire timed sampled key phase signals and vibration signals.

[0097] S2, the key phase signal is used to accurately identify the starting point of each rotation cycle of the rotating machinery rotor, and to record the rotor angle and key phase time corresponding to these key phase points, thus constructing a training sample set.

[0098] S3. To achieve full-cycle sampling, a series of uniformly distributed target angles need to be generated. The angles within each rotation cycle are uniformly divided into C sampling points. For M monitoring cycles, the system will generate a set of test angles for M cycles. This set of test angles contains all the target angles that are expected to be sampled for full cycles.

[0099] S4. Input the previously constructed training sample set into the KNN regression model for training. This model establishes a nonlinear mapping model from angle to time by learning the correspondence between rotor angles and sampling times in the training sample set. Using the trained KNN regression model, predict each sampled target angle in the test angle set to obtain its corresponding target sampling time. The specific prediction process includes: calculating the Euclidean distance between each sampled target angle in the test angle set and each rotor angle in the training sample set. Based on the Euclidean distance value, select the K angles in the training sample set that are closest to the sampled target angle as nearest neighbors, and assign weights according to their distance. For example, the closer the nearest neighbor, the greater the weight. Finally, perform a weighted average of the sampling times corresponding to the aforementioned K nearest neighbor angles based on these weights to obtain the target sampling time of the sampled target angle. Through this process, a series of target sampling time sequences that precisely correspond to the sampled target angles of the entire cycle are obtained.

[0100] S5. Responding to the vibration signal sampled at a specific time, obtain the full-cycle resampled vibration signal according to the spline interpolation method and the target sampling time.

[0101] Compared to traditional time-based sampling methods, this scheme constructs a rotor angle-time mapping relationship using a KNN regression model, avoiding dependence on constant angular acceleration and improving adaptability and sampling accuracy under variable speed conditions. Furthermore, compared to traditional full-cycle sampling systems requiring complex hardware support, this scheme only relies on time-sampled key phase and vibration signals, requiring no additional hardware investment, thus reducing implementation costs and promotion difficulty. Through precise target sampling times predicted by the KNN model and smooth reconstruction using cubic spline interpolation, spectral leakage and picket fence effects in the Fourier transform are effectively suppressed, enabling more accurate extraction of signal amplitude, phase, and other features, significantly improving the accuracy of vibration signal analysis.

[0102] Example 4

[0103] This invention also includes numerical simulation analysis. To simulate the nonlinear speed change characteristics during the acceleration process of a hydroelectric generator, a nonlinear time-varying frequency simulated vibration signal was constructed to verify the universality of the proposed method. This embodiment is divided into two stages: time-domain resampling and spectrum analysis. The experimental data includes time-domain waveforms, amplitude spectra, phase spectra, and comparisons of spectral parameters before and after resampling.

[0104] The formula for simulating vibration signals is as follows: ;

[0105] Wherein, amplitude A=20, initial frequency f0=50Hz, and frequency change rate k f =2Hz / s, sampling frequency f s =1024Hz, number of resampling points C=64, total duration T=5s.

[0106] Please refer to Figure 4 , Figure 4 The original waveform under timed sampling is shown, exhibiting obvious period compression. The resampled waveform, processed by KNN angle-time mapping and cubic spline interpolation, is then compared. Figure 5 It exhibits a stable, evenly spaced distribution in the periodic domain, successfully converting non-stationary time-domain signals into stationary signals in the periodic domain, thus eliminating time non-stationarity.

[0107] Please refer to Figure 6 , Figure 6 The amplitude spectrum of the time-sampled waveform is shown, exhibiting significant main lobe spread at 7Hz, with a maximum amplitude of only 7.83. The amplitude spectrum obtained by full-cycle resampling (…) Figure 7 Its spectral energy is highly concentrated at the fundamental frequency (1st order), corresponding to an amplitude of 20, and the amplitude error basically disappears.

[0108] Please refer to Figure 8 , Figure 8The phase spectrum of the timed sampling waveform is shown, with a phase of -157.87° at 7Hz, which deviates significantly from the theoretical phase of -90°. The phase spectrum obtained by full-cycle resampling (…) Figure 9 Its fundamental frequency phase (1st order) is stable at -91.36°, and the phase curve is more periodic, which greatly improves the phase accuracy.

[0109] Table 1 Comparison of frequency domain data between timed sampling and whole-cycle sampling Timed sampling 7.83 60.85% -157.87° 75.41% Integer resampling 20 0.00% -91.36° 1.51%

[0110] As shown in Table 1, the numerical simulation results of this embodiment indicate that timing sampling suffers from severe spectral leakage due to its non-integer period truncation, resulting in significant deviations in both amplitude and phase. However, the method proposed in this invention, through integer period resampling, reduces the amplitude accuracy from 60.85% error in timing sampling to 0, and the phase accuracy from 75.41% error in timing sampling to 1.51%. This demonstrates that this application can effectively suppress spectral analysis errors and significantly improve the accuracy of vibration signal analysis under variable speed conditions.

[0111] Furthermore, those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, computer devices, storage media, or products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0112] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0113] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0114] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0115] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for integer period sampling based on a KNN regression model, characterized in that, The method includes: Acquire the key phase signal and vibration signal by timed sampling; In response to acquiring the key phase signal, the key phase moment and the corresponding rotor angle in each rotation cycle of the rotating machinery are determined and constructed as a training sample set; Each rotation cycle is divided into preset equal angular intervals to obtain the test set angle set; The training sample set is input into the KNN regression model for training. In response to the trained KNN regression model, the target sampling time corresponding to each sampled target angle in the test set angle set is predicted; In response to acquiring the vibration signal, an integer-cycle resampled vibration signal is obtained according to the spline interpolation method and the target sampling time.

2. The sampling method according to claim 1, characterized in that, The steps to obtain the test set angle set by dividing each rotation cycle into a preset equal angular interval include: dividing each rotation cycle into C sampling points evenly according to the preset equal angular interval, and generating a test set angle set including the sampled target angles within M rotation cycles; The formula for calculating the angle of the sampling target is: ; Where i represents the i-th rotation cycle, and j represents the sampling time number corresponding to each rotation cycle.

3. The sampling method according to claim 1, characterized in that, The steps for predicting the target sampling time corresponding to each sampled target angle in the test set angle set in response to the trained KNN regression model include: Calculate the Euclidean distance between the sampled target angle and each rotor angle in the training sample set; Based on the Euclidean distance value, select the K target rotor angles in the training sample set that are closest to the sampled target angle, and assign weights to each target rotor angle; The sampling times of the aforementioned K target rotor angles are weighted and averaged according to the weight of each target rotor angle to obtain the target sampling time.

4. The sampling method according to claim 1, characterized in that, In response to acquiring the vibration signal, the step of obtaining the full-cycle resampled vibration signal according to the spline interpolation method and the target sampling time includes: In response to the timed sampling vibration signal, in each interval Define a cubic spline function that satisfies the preset conditions. The formula is as follows: , Indicates the coefficient to be determined; set up ; Using the tridiagonal system of equations 6( / - / The solution is obtained by recursion. ; in, The value of the second derivative is given, and the curvature of the spline function curve at the nodes is also given. and Representing nodes respectively and Vibration signal value at the location; The time interval between nodes is represented by the formula h. n =t n+1 -t n ;t n and t n+1 Indicates the time scale of adjacent nodes; and This represents the boundary conditions; setting it to zero indicates a natural boundary condition. In response to the solution obtained The cubic spline function over each interval can be expressed as: ; Response to the target sampling time of the entire cycle Determine its interval Using the formula The vibration signal interpolation is calculated to obtain the full-cycle resampled vibration signal.

5. A periodic sampling system based on a KNN regression model, characterized in that, include: The signal acquisition module is used to acquire the key phase signal and vibration signal sampled at regular intervals; The training sample set construction module is used to determine the bond phase moment and corresponding angle of the rotating machinery in each rotation cycle in response to the acquisition of the bond phase signal, and construct a training sample set. The test set angle set construction module is used to divide each rotation cycle according to a preset equal angular interval to obtain the test set angle set. The model training module is used to input the training sample set into the KNN regression model for training. The model prediction module is used to predict the target sampling time corresponding to each sampled target angle in the test set angle set in response to the trained KNN regression model. The whole-cycle sampling signal acquisition module is used to obtain the whole-cycle sampling vibration signal in response to the acquisition of the vibration signal, according to the spline interpolation method and the target sampling time.

6. The sampling system according to claim 5, characterized in that, The test set angle set construction module further includes: dividing each rotation cycle into C sampling points at a preset equal angle interval to generate a test set angle set including the sampled target angles within M rotation cycles; The formula for calculating the angle of the sampling target is: ; Where i represents the i-th rotation cycle, and j represents the sampling time number corresponding to each rotation cycle.

7. The sampling system according to claim 5, characterized in that, The model training module also includes: Calculate the Euclidean distance between the sampled target angle and each rotor angle in the training sample set; Based on the Euclidean distance value, select the K target rotor angles in the training sample set that are closest to the sampled target angle, and assign weights to each target rotor angle; The sampling times of the aforementioned K target rotor angles are weighted and averaged according to the weight of each target rotor angle to obtain the target sampling time.

8. The sampling system according to claim 5, characterized in that, The whole-cycle sampling signal acquisition module further includes: In response to the timed sampling vibration signal, in each interval Define a cubic spline function that satisfies the preset conditions. The formula is as follows: , Indicates the coefficient to be determined; set up ; Using the tridiagonal system of equations 6( / - / The solution is obtained by recursion. ; in, The value of the second derivative is given, and the curvature of the spline function curve at the nodes is also given. and Representing nodes respectively and Vibration signal value at the location; The time interval between nodes is represented by the formula h. n =t n+1 -t n ;t n and t n+1 Indicates the time scale of adjacent nodes; and This represents the boundary conditions; setting it to zero indicates a natural boundary condition. In response to the solution obtained The cubic spline function over each interval can be expressed as: ; Response to the target sampling time of the entire cycle Determine its interval Using the formula The vibration signal interpolation is calculated to obtain the full-cycle resampled vibration signal.

9. A computer-readable storage medium for storing one or more programs, characterized in that: The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods in the KNN regression model integer sampling method according to claims 1 to 4.

10. A computing device, characterized in that, include: One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods in the KNN regression model integer sampling method according to claims 1 to 4.