Keyboard shaft fault diagnosis method, device, equipment and storage medium
By collecting electrical and vibration signals of the keyboard axis body, and combining multiple signal processing technologies and graph convolutional neural network models, the problems of low efficiency and poor accuracy of keyboard axis body fault diagnosis in the prior art are solved, and fault diagnosis of high accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510192257.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-21
AI Technical Summary
The existing keyboard shaft body fault diagnosis methods are inefficient and have poor accuracy, making it difficult to identify complex fault modes, especially under small sample data conditions, the diagnostic accuracy rate is low.
By collecting electrical and vibration signals of the keyboard axis body, combining square envelope spectrum calculation, reassigned spectrum correlation analysis, wavelet packet decomposition and Markov transfer field image processing technology, a fringe pooling graph convolution neural network model is input for fault analysis.
It realizes deep fusion of multi-source information, enhances the ability to express fault characteristics, improves the diagnostic accuracy under small sample conditions, enhances the ability to distinguish different types of faults, and improves the reliability of diagnostic results.
Smart Images

Figure CN119688290B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fault diagnosis technology, and in particular to a keyboard shaft fault diagnosis method, device, equipment and storage medium. Background Art
[0002] Currently, keyboard shaft fault detection mainly relies on manual experience judgment, which has problems such as low efficiency and poor accuracy. The traditional keyboard shaft fault diagnosis method is mainly based on single signal feature analysis, which is difficult to effectively identify complex fault modes, especially under small sample data conditions, and the diagnostic accuracy is low.
[0003] Existing keyboard shaft fault diagnosis technologies mostly use single feature extraction methods in the time domain or frequency domain, which fail to fully tap the multi-dimensional information in the signal, resulting in insufficient feature expression capabilities. At the same time, due to the complex mechanical structure of the keyboard shaft, its fault manifestations are diverse, and a single signal processing method is difficult to accurately capture the characteristic differences of different types of faults, affecting the reliability of fault diagnosis. Summary of the invention
[0004] The present invention provides a keyboard shaft fault diagnosis method, device, equipment and storage medium, which are used to improve the accuracy of keyboard shaft fault diagnosis.
[0005] In a first aspect, the present invention provides a keyboard shaft fault diagnosis method, the keyboard shaft fault diagnosis method comprising:
[0006] The pressure signal of the keyboard shaft pressing process is collected to obtain a one-dimensional electrical signal sequence, and the vibration response of the keyboard shaft pressing process is collected to obtain a one-dimensional vibration signal sequence;
[0007] Performing square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and performing time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix;
[0008] Performing grid division and transfer probability calculation on the frequency spectrum correlation diagram and the time-frequency energy distribution matrix respectively to obtain a first Markov transfer field image and a second Markov transfer field image;
[0009] The first Markov transfer field image and the second Markov transfer field image are input into a fringe pooling graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
[0010] In a second aspect, the present invention provides a keyboard shaft fault diagnosis device, the keyboard shaft fault diagnosis device comprising:
[0011] The acquisition module is used to acquire the pressure signal of the keyboard shaft pressing process to obtain a one-dimensional electrical signal sequence, and to acquire the vibration response of the keyboard shaft pressing process to obtain a one-dimensional vibration signal sequence;
[0012] An analysis module, used for performing square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and performing time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix;
[0013] A calculation module, used for performing grid division and transfer probability calculation on the frequency spectrum correlation diagram and the time-frequency energy distribution matrix respectively, to obtain a first Markov transfer field image and a second Markov transfer field image;
[0014] A prediction module is used to input the first Markov transfer field image and the second Markov transfer field image into a stripe pooled graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
[0015] The third aspect of the present invention provides a keyboard shaft fault diagnosis device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the keyboard shaft fault diagnosis device executes the above-mentioned keyboard shaft fault diagnosis method.
[0016] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned keyboard shaft fault diagnosis method.
[0017] In the technical solution provided by the present invention, by simultaneously collecting the electrical signal and vibration signal of the keyboard axis, and combining the redistribution spectrum correlation analysis and wavelet packet decomposition technology, the deep fusion of multi-source information is realized, and the expression ability of fault features is enhanced. The Markov transfer field is used to convert the one-dimensional signal into a two-dimensional image, and the stripe pooling module is introduced to effectively extract the long-distance directional characteristics of the signal, overcoming the shortcomings of the traditional method in long-distance spatial feature extraction. A stripe pooling convolutional neural network structure based on the SE attention mechanism is designed, and the model's perception of key features is improved by adaptively adjusting the feature weights. The graph convolutional network is combined with stripe pooling to construct an end-to-end fault diagnosis framework, which improves the diagnostic accuracy under small sample conditions. Through the multi-head attention mechanism and feature fusion strategy, the model's ability to distinguish different types of faults is enhanced, and the reliability of the diagnosis results is improved. Bilinear interpolation and Markov random field models are used to achieve effective transformation and probability modeling of feature space, and improve the robustness of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a keyboard shaft fault diagnosis method provided in an embodiment of the present application;
[0020] Figure 2 A schematic block diagram of the structure of a keyboard shaft fault diagnosis device provided in an embodiment of the present application;
[0021] Figure 3 A schematic block diagram of the structure of the keyboard shaft fault diagnosis device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change based on actual conditions.
[0024] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0025] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] See also Figure 1 , Figure 1A schematic diagram of a keyboard shaft fault diagnosis method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the keyboard axis fault diagnosis method provided in the embodiment of the present application includes steps S100 to S400.
[0028] Step S100, collecting the pressure signal of the keyboard shaft pressing process to obtain a one-dimensional electrical signal sequence, and collecting the vibration response of the keyboard shaft pressing process to obtain a one-dimensional vibration signal sequence;
[0029] It is understandable that the execution subject of the present invention may be a keyboard shaft fault diagnosis device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0030] Specifically, a pressure sensor is installed at the key end of the keyboard shaft. The pressure sensor can convert the mechanical changes generated by the mechanical pressing action into corresponding electrical signals to generate original electrical signals. At the same time, an acceleration sensor is installed at the bottom of the keyboard shaft to monitor the mechanical vibration signal generated during the pressing process. The sensor generates an original vibration signal that can characterize the dynamic characteristics of the keyboard shaft by converting the vibration state into an electrical signal. The original signal is collected. The original electrical signal output by the pressure sensor is sampled by a signal acquisition device to generate an electrical signal sampling sequence, and the original vibration signal output by the acceleration sensor is converted into a vibration signal sampling sequence by the same sampling device. In this process, an appropriate frequency is set according to the characteristics of the keyboard shaft pressing action to ensure that the sampling signal can fully cover the target frequency range, while avoiding data redundancy and resource waste caused by excessively high frequencies. The collected electrical signal sampling sequence and vibration signal sampling sequence contain a certain degree of high-frequency noise, which comes from the hardware characteristics of the sensor or the interference of the external environment, so the signal is preprocessed. A Butterworth low-pass filter is used to filter the signal. The Butterworth filter has a smooth frequency response curve and effectively filters out high-frequency noise without causing excessive amplitude or phase distortion to the low-frequency part of the signal. During the filtering process, the electrical signal sampling sequence is low-pass filtered to generate a filtered electrical signal sequence. At the same time, the vibration signal sampling sequence is processed by a low-pass filter to generate a filtered vibration signal sequence. The filtered electrical signal sequence is subjected to zero-mean normalization to generate a one-dimensional electrical signal sequence by removing the mean of the sequence and normalizing it to a fixed range. Similarly, the filtered vibration signal sequence is subjected to the same normalization to obtain a one-dimensional vibration signal sequence.
[0031] Step S200, performing square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and performing time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix;
[0032] Specifically, the Hilbert transform analysis is performed on the one-dimensional electrical signal sequence to extract the instantaneous frequency and instantaneous amplitude of the signal. These two parameters are the core indicators for describing the characteristics of non-stationary signals. Through the Hilbert transform, the original signal is converted into a complex analytical signal, and the instantaneous frequency and amplitude are calculated through its real and imaginary parts. Based on this information, the electrical signal analytical sequence is constructed to reflect the dynamic characteristics of the signal. The square envelope spectrum is calculated for the electrical signal analytical sequence to enhance the modulation characteristics hidden in the signal, thereby highlighting the key spectral components. The square envelope spectrum is calculated by squaring the signal amplitude and performing Fourier transform in the frequency domain to obtain the energy distribution of each frequency component in the spectrum. In order to more intuitively analyze these energy distributions and the modulation information in the signal, a redistributed spectrum correlation analysis is performed. The coordinates are redistributed according to the square envelope spectrum, and these redistributed coordinates are distributed on the cyclic frequency to obtain the spectrum correlation value, revealing the intrinsic relationship between the spectrum frequency and the cyclic frequency. The spectrum correlation value is plotted according to the two-dimensional distribution, and the spectrum frequency and cyclic frequency are used as the coordinate axes to generate a spectrum correlation diagram, which presents the modulation characteristics and fault-related features in the signal in a visual form. At the same time, another path is adopted to process the one-dimensional vibration signal sequence. The vibration signal is subjected to short-time Fourier transform to obtain the time-frequency distribution of the signal. Short-time Fourier transform is a time-frequency analysis method. By windowing the signal and performing Fourier transform in each time window, the joint distribution of the signal in the time and frequency dimensions is obtained. The time-frequency distribution of the vibration signal shows the frequency change characteristics of the signal at different time points. The time-frequency distribution of the vibration signal is input into the wavelet packet decomposition module, and the db4 wavelet basis function is used for three-layer decomposition. The signal is divided into eight sub-signals with different frequency bands, and more detailed frequency domain information is extracted by analyzing the signal characteristics in each frequency band. The db4 wavelet basis function is a wavelet basis with good compact support and smoothness, which can effectively capture the multi-scale characteristics of the signal. The eight frequency band sub-signals generated after the three-layer wavelet packet decomposition cover different frequency ranges respectively, showing the frequency band energy distribution characteristics of the signal. For each frequency band sub-signal, the mean, variance, kurtosis coefficient and skewness coefficient are calculated. These eigenvalues reflect the energy level, stability, peak characteristics and symmetry of the signal, and are the core indicators for describing the statistical characteristics of the signal. By calculating these eigenvalues, the energy characteristics of each frequency band are extracted, and the frequency band energy eigenvectors are constructed based on these eigenvalues. The energy eigenvectors of the eight frequency bands are integrated to form a time-frequency energy distribution matrix.
[0033] Step S300, gridding and transferring probability calculation are performed on the spectrum correlation diagram and the time-frequency energy distribution matrix respectively to obtain a first Markov transfer field image and a second Markov transfer field image;
[0034] Specifically, the spectrum correlation graph is uniformly gridded. By dividing the two-dimensional space of the spectrum correlation graph into a number of grid units of equal size, a regular first grid matrix is formed. This division can map the complex information of the spectrum correlation graph to a discrete grid space, which is convenient for further analysis. The state transition probability between adjacent grid units is calculated based on the first grid matrix. The calculation is based on the spatial position relationship between the grid units, specifically including the transfer relationship in the four directions of up, down, left and right. The calculation of the state transition probability is completed by counting the value change frequency between adjacent units, generating a first state transition sequence, and recording the dynamic change characteristics of the spectrum correlation graph in different directions. At the same time, the time-frequency energy distribution matrix is transformed in size using the bilinear interpolation method, and the original matrix is adjusted to a unified normalized energy matrix. Bilinear interpolation can recalculate the size of the matrix without losing information by recalculating each element in the matrix using the weighted average of the surrounding elements. The normalized energy matrix facilitates the subsequent state transition probability calculation by retaining the relative value distribution of the original matrix. Based on the normalized energy matrix, the state transition probability between adjacent matrix elements is calculated, and the adjacent relationship includes four directions: up, down, left, and right. Thus, the second state transition sequence is generated, which reflects the dynamic characteristics of the energy distribution matrix in the local space. The first state transition sequence is reorganized according to the directional dimension and the spatial dimension to construct the first transition probability tensor. This tensor is a multidimensional structure that encodes the transition relationship in the sequence according to the directional characteristics, and can fully describe the transition mode of the spectrum correlation diagram. The first transition probability tensor is input into the Markov random field model, and the state transition field is calculated by the maximum likelihood estimation method. The state transition structure that best matches the observed data is found by iterative optimization, and the first Markov transition field image is generated. Similarly, the second state transition sequence is reorganized according to the directional dimension and the spatial dimension to form a second transition probability tensor, which reflects the spatial transfer characteristics of the time-frequency energy distribution matrix. By inputting the second transition probability tensor into the Markov random field model, the state transition field that best matches the observed data is calculated by the maximum likelihood estimation method, and the second Markov transition field image is generated.
[0035] The row and column scale factors of the time-frequency energy distribution matrix are calculated to determine the target scale relationship of the matrix interpolation, and the size of the target matrix is set to a fixed 64×64, and the interpolation scale coefficient is specified. Based on the interpolation scale coefficient, bilinear interpolation is performed on the four adjacent positions of each point in the time-frequency energy distribution matrix. Bilinear interpolation estimates the value of the target point by weighted averaging the horizontal and vertical adjacent values of the point, which combines the contributions of the surrounding points to obtain a smooth and continuous result. In the calculation of each interpolation point, each unit in the original matrix works together with its four neighboring points, and the weighted coefficient is calculated according to the interpolation scale coefficient to generate a bilinear interpolation point set. All interpolation point sets are reconstructed and arranged according to the target matrix size of 64×64 to generate an energy interpolation matrix. After the interpolation operation is completed, the energy interpolation matrix is normalized to normalize all elements of the matrix to a fixed range (such as [0,1]) to eliminate the influence of different scales in the original data and improve the stability and consistency of the calculation. The maximum and minimum normalization method is adopted to remap the value of each element to a uniform range by subtracting the minimum value of the matrix and dividing it by the range of the matrix (i.e., the maximum value minus the minimum value). The normalized energy matrix is obtained. The transition probability calculation window is constructed according to the normalized energy matrix. The transition probability calculation window is used to define the relationship range between adjacent matrix elements and provide structural support for the calculation of the state transition unit. In each state transition unit, the Markov transition probability calculation in the four directions of up, down, left and right is considered. For any element in the matrix, its transition probability in the four directions of up, down, left and right is determined by counting the value change relationship between it and its neighboring elements. For example, the transition probability in the upward direction is determined by the correlation between the value of the current unit and the value of its previous unit, and this relationship is described by a probability density function or a simple frequency statistics. Similar steps are applied to the other three directions to generate a directional transition probability matrix, which fully records the local transition characteristics in the normalized energy matrix in a multi-dimensional form. The directional transition probability matrix is reorganized to construct a multi-dimensional transition probability tensor. By reorganizing the directional transition probability matrix according to the directional dimension and the spatial dimension, the obtained tensor can systematically reflect all possible state transition modes in the normalized energy matrix. In order to adapt to the final state transition sequence construction requirements, the multidimensional transition probability tensor is expanded and concatenated according to the directional dimension. The complex structure of the multidimensional tensor is converted into a serialized form to generate a second state transition sequence, which describes the dynamic characteristics and spatial structure of the time-frequency energy distribution matrix.
[0036] The second state transition sequence is decomposed into four dimensions: up, down, left, and right. The transition relationship in each direction of the original sequence is extracted independently, and the transfer subsequences in four directions are obtained, which represent the transfer characteristics in the up and down directions and the left and right directions respectively. Each subsequence records the probability relationship of each element in the matrix undergoing state transition along a specific direction. The transfer subsequences in the four directions are transformed into a matrix so as to restore the transfer characteristics in each direction in space. The transfer subsequences in each direction are rearranged to generate a spatial transfer matrix consistent with the original spatial structure of the matrix. These spatial transfer matrices correspond to the transfer modes in the up, down, left, and right directions, respectively, and describe the dynamic characteristics of the normalized energy matrix in space. The spatial transfer matrices in the four directions are combined, and the second transition probability tensor is constructed based on their characteristics in the direction and spatial dimensions. The neighborhood potential energy function is calculated for the second transition probability tensor to construct the energy function of the Markov random field. The neighborhood potential energy function is calculated based on the local correlation relationship between each node in the transition probability tensor. The local potential energy matrix is obtained by analyzing the state transfer characteristics between each node and its neighboring nodes. The local potential energy matrix records the potential energy distribution of local nodes in the system and is the core element for describing the local characteristics of the Markov random field. The global energy distribution is calculated based on the local potential energy matrix, and the overall energy function of the Markov random field is obtained by integrating the cumulative effects of all local potential energies. In order to ensure that the energy function can accurately reflect the actual state transition relationship, the maximum likelihood method is used to optimize its parameters. The maximum likelihood method uses iterative optimization to find the parameter value that best matches the observed data and generate the optimized energy parameters. The optimized energy parameters are calculated by Gibbs distribution to establish a probability model of the state transition field. The Gibbs distribution is a probability distribution model that maps the local probability characteristics of the state transition field to the global distribution. Through the calculation of the Gibbs distribution, the global probability distribution of the state transition field is obtained, and a complete state transition field model is constructed. On this basis, the state transition relationship between nodes is calculated according to the state transition field distribution, and the state transition field features are extracted to reflect the spatial and directional characteristics of the entire state transition field. The state transition field features are processed by imaging and converted into a form that is easy to analyze and visualize. A second Markov transition field image is generated by mapping the transition field features into a two-dimensional image.
[0037] Step S400: input the first Markov transfer field image and the second Markov transfer field image into a fringe pooling graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
[0038] Specifically, the first Markov transfer field image is input into the first input branch of the stripe pooling graph convolutional neural network model, and the input image is subjected to initial feature extraction through a 3×3 convolution kernel, and a nonlinear transformation is introduced through a ReLU activation function, so that the feature map can better capture the nonlinear pattern and complex boundary features in the image. Through this step, a first initial feature map is generated. At the same time, the second Markov transfer field image is input into the second input branch of the stripe pooling graph convolutional neural network model, and initial feature extraction is performed through the same 3×3 convolution kernel and ReLU activation function to generate a second initial feature map. Stripe pooling is performed on the first initial feature map and the second initial feature map respectively. Stripe pooling extracts features in the horizontal and vertical directions through 1×7 and 7×1 pooling kernels, which can effectively enhance the resolution of the feature map in a specific direction, and generate a first stripe feature map and a second stripe feature map. After stripe pooling is completed, the first stripe feature map and the second stripe feature map are respectively input into the graph convolution layer for feature aggregation. The graph convolution layer is based on the neighborhood relationship of nodes. It realizes efficient convolution calculation through Chebyshev polynomial approximation and generates a graph feature matrix representing the image structure information. The graph feature matrix is input into the SE attention mechanism module for feature compression and recalibration. Through the global average pooling operation, the global feature distribution of each channel is extracted, and the channel weights are redistributed by two layers of fully connected layers to generate attention-enhanced features. The attention mechanism adjusts the channel weights so that the network can pay more attention to key feature channels and improve the feature expression ability. The attention-enhanced features are input into the multi-head graph attention layer, and 8 attention heads are used to learn feature representations in different subspaces. The multi-head attention mechanism performs multi-view modeling on the features to capture richer feature information. After splicing the outputs of all attention heads, a graph feature matrix with multi-scale feature representation is obtained. Global average pooling and global maximum pooling are performed on the multi-scale graph feature matrix respectively. These two pooling methods can capture global information and extreme value information in the features and enhance the feature expression ability. After the two pooling results are feature fused, they are input into the feature extraction module composed of two layers of fully connected layers. The first and second layers have 1024 and 512 neurons respectively. The gradually reduced structure can compress the fused feature vector step by step while retaining key information to generate a high-dimensional fused feature vector. The fused feature vector is input into the output layer, which contains 4 neurons, corresponding to the four states of the keyboard axis: normal, stuck, poor rebound, and abnormal trigger. The predicted probabilities of these four states are normalized and calculated by the Softmax function to generate a probability distribution, and finally the fault prediction result of the keyboard axis is obtained.
[0039] In the embodiment of the present invention, by simultaneously collecting the electrical signal and vibration signal of the keyboard shaft, and combining the redistribution spectrum correlation analysis and wavelet packet decomposition technology, the deep fusion of multi-source information is achieved, and the expression ability of fault features is enhanced. The Markov transfer field is used to convert the one-dimensional signal into a two-dimensional image, and the stripe pooling module is introduced to effectively extract the long-distance directional characteristics of the signal, overcoming the shortcomings of the traditional method in long-distance spatial feature extraction. A stripe pooling convolutional neural network structure based on the SE attention mechanism is designed, and the model's perception of key features is improved by adaptively adjusting the feature weights. The graph convolutional network is combined with stripe pooling to construct an end-to-end fault diagnosis framework, which improves the diagnostic accuracy under small sample conditions. Through the multi-head attention mechanism and feature fusion strategy, the model's ability to distinguish different types of faults is enhanced, and the reliability of the diagnosis results is improved. Bilinear interpolation and Markov random field models are used to achieve effective transformation and probability modeling of feature space, and improve the robustness of the method.
[0040] In a specific embodiment, the process of executing step S100 may specifically include the following steps:
[0041] The pressure sensor is installed at the key end of the keyboard shaft, and the mechanical pressing motion of the keyboard shaft is converted into an electrical signal through the pressure sensor to obtain an original electrical signal;
[0042] An acceleration sensor is installed at the bottom of the keyboard shaft, and the mechanical vibration of the keyboard shaft is converted into a vibration signal by the acceleration sensor to obtain an original vibration signal;
[0043] Performing signal acquisition on the original electrical signal to obtain an electrical signal sampling sequence, and performing signal acquisition on the original vibration signal to obtain a vibration signal sampling sequence;
[0044] The electrical signal sampling sequence is subjected to Butterworth low-pass filtering to filter out high-frequency noise, thereby obtaining a filtered electrical signal sequence. Meanwhile, the vibration signal sampling sequence is subjected to Butterworth low-pass filtering to filter out high-frequency noise, thereby obtaining a filtered vibration signal sequence.
[0045] The filtered electrical signal sequence is subjected to zero-mean normalization processing to obtain a one-dimensional electrical signal sequence, and the filtered vibration signal sequence is subjected to zero-mean normalization processing to obtain a one-dimensional vibration signal sequence.
[0046] Specifically, the pressure sensor is installed at the key end of the keyboard shaft, and the mechanical change of the pressing action is converted into an electrical signal through the pressure sensor. The pressure sensor can sense the force generated when pressing, and convert this physical quantity into a continuously changing electrical signal through the circuit inside the sensor. This signal is expressed by the function Indicates that is a voltage signal that varies with time. is a time variable that reflects the dynamic characteristics of the mechanical signal during the pressing process. Similarly, the accelerometer is installed at the bottom of the keyboard shaft to capture the vibration caused by the pressing. The accelerometer senses the changes in acceleration and converts these changes into vibration signals, which are recorded as ,in It is an electrical signal that reflects the vibration characteristics. After the pressure sensor and acceleration sensor output the original signal respectively, the signal is collected and the continuous time signal is converted into and At a fixed sampling frequency Discretization is performed to generate an electrical signal sampling sequence and a vibration signal sampling sequence. These discretized signals are respectively used and Indicates that is a discrete time index, representing the sequence number of the sampling point, and the formula is:
[0047] ;
[0048] in Indicates floor operation. is the sampling frequency, which determines the time resolution of the signal discretization. After sampling, the signal contains high-frequency components introduced by external interference or sensor noise, so filtering is performed. The Butterworth low-pass filter is used to effectively filter out these high-frequency noises while retaining the meaningful low-frequency components in the signal. The design of the Butterworth filter is characterized by smooth response, and its transfer function is expressed as:
[0049] ;
[0050] in is the frequency response of the filter, is a complex frequency variable, is the filter cutoff frequency (unit: rad / s), is the filter order. Cutoff frequency and The relationship is:
[0051] ;
[0052] By designing the right and , the electrical signal sampling sequence And vibration signal sampling sequence Filter and obtain the filtered electrical signal sequence And the filtered vibration signal sequence After filtering, in order to eliminate the deviation of signal amplitude and unify the dimension, the signal is normalized to zero mean. The normalization formula is as follows:
[0053] ;
[0054] in, is the normalized signal value, is the original signal value, is the mean of the signal, is the standard deviation of the signal. and standard deviation The calculation formulas are:
[0055] ;
[0056] in, is the number of sampling points of the signal. Through normalization, the electrical signal and vibration signal are respectively obtained as one-dimensional normalized electrical signal sequences and the one-dimensional normalized vibration signal sequence .
[0057] In a specific embodiment, the process of executing step S200 may specifically include the following steps:
[0058] Perform Hilbert transform analysis on the one-dimensional electrical signal sequence to generate instantaneous frequency and instantaneous amplitude, and construct an electrical signal analysis sequence based on the instantaneous frequency and instantaneous amplitude;
[0059] Calculating the square envelope spectrum of the electric signal analysis sequence to obtain the square envelope spectrum;
[0060] The redistributed coordinates are calculated according to the square envelope spectrum, and the redistributed coordinates are distributed on the cyclic frequency to obtain the spectrum correlation value;
[0061] The spectrum correlation values are plotted according to the two-dimensional distribution of the spectrum frequency and the cycle frequency to generate a spectrum correlation diagram;
[0062] Perform short-time Fourier transform on the one-dimensional vibration signal sequence to obtain the time-frequency distribution of the vibration signal;
[0063] The time-frequency distribution of the vibration signal is input into the wavelet packet decomposition module, and the db4 wavelet basis function is selected for three-layer decomposition to obtain eight frequency band sub-signals;
[0064] The mean, variance, kurtosis coefficient and skewness coefficient of the eight frequency band sub-signals are calculated respectively to obtain the frequency band energy eigenvectors, and the time-frequency energy distribution matrix is constructed based on the frequency band energy eigenvectors.
[0065] Specifically, the Hilbert transform analysis is performed on the one-dimensional electrical signal sequence to generate the instantaneous frequency and instantaneous amplitude, and the electrical signal analysis sequence is constructed based on this. The Hilbert transform is a process of converting a real signal into a complex signal, and its formula is:
[0066] ;
[0067] in, is the input one-dimensional electrical signal sequence, is the result of its Hilbert transform. Based on this, the complex analytical signal of the electrical signal is expressed as:
[0068] ;
[0069] in, is the complex analytic signal, is an imaginary unit. The instantaneous amplitude is calculated by the modulus of the complex signal:
[0070] ;
[0071] The instantaneous frequency is defined by the rate of change of phase of the complex signal, as:
[0072] ;
[0073] in, is the phase angle of the complex signal, is the instantaneous frequency. By calculating the instantaneous amplitude and instantaneous frequency , construct the analytical sequence of the electrical signal, including the dynamic amplitude and frequency information of the electrical signal. Calculate the square envelope spectrum of the analytical sequence of the electrical signal to obtain the square envelope spectrum. The square envelope spectrum is obtained by Fourier transforming the square of the amplitude of the signal, and its formula is:
[0074] ;
[0075] in, is the squared envelope spectrum, Represents the Fourier transform operator. The square envelope spectrum can highlight the modulation characteristics of the signal and facilitate the analysis of fault-related features. The coordinates are redistributed based on the square envelope spectrum calculation to more clearly display the modulation components of the signal. and cycle frequency Redistribute and calculate spectrum association value , the formula is:
[0076] ;
[0077] in, is the Dirac function, is an integer multiple of the relationship coefficient. In this way, the spectrum correlation value According to the two-dimensional distribution of spectral frequency and cyclic frequency, the spectral correlation diagram is generated, which provides an intuitive visualization of the signal modulation characteristics. On the other hand, for a one-dimensional vibration signal sequence, its time-frequency distribution is obtained by short-time Fourier transform. The formula for short-time Fourier transform is:
[0078] ;
[0079] in, is the time window function, is the signal at time and frequency The distribution under time-frequency distribution Provides the frequency energy distribution of the signal changing with time. Input the time-frequency distribution into the wavelet packet decomposition module, select the db4 wavelet basis function and perform three-layer decomposition, and generate eight frequency band sub-signals after decomposition. These sub-signals correspond to signal components in different frequency ranges, reflecting the frequency band energy characteristics of the signal. Wavelet packet decomposition is achieved by recursively decomposing low-frequency and high-frequency components, and its formula is:
[0080] ;
[0081] in, It is Tier Sub-signals, and are the low-pass and high-pass filter coefficients of the wavelet decomposition filter respectively. For each frequency band sub-signal, the mean, variance, kurtosis coefficient and skewness coefficient are calculated to extract statistical features. The mean calculation formula is:
[0082] ;
[0083] The variance calculation formula is:
[0084] ;
[0085] The formula for the kurtosis coefficient is:
[0086] ;
[0087] The formula for the skewness coefficient is:
[0088] ;
[0089] in, is the first sampling points, is the total number of sampling points of the sub-signal, is the mean, These features are combined into frequency band energy feature vectors, and the feature vectors of the eight frequency bands are integrated to construct a time-frequency energy distribution matrix, which provides the frequency distribution and energy characteristics of the signal.
[0090] In a specific embodiment, the process of executing step S300 may specifically include the following steps:
[0091] The spectrum correlation graph is uniformly grid-divided to obtain a first grid matrix, and the state transition probability between adjacent grid cells is calculated based on the first grid matrix, including the transition relationship in four directions of up, down, left and right, to obtain a first state transition sequence;
[0092] The time-frequency energy distribution matrix is resized by bilinear interpolation calculation to obtain a normalized energy matrix, and the state transition probability between adjacent matrix elements is calculated based on the normalized energy matrix, including the transfer relationship in the four directions of up, down, left and right, to obtain a second state transition sequence;
[0093] The first state transition sequence is reorganized according to the direction dimension and the space dimension to construct a first transition probability tensor, and the first transition probability tensor is input into the Markov random field model, and the state transition field is calculated by maximum likelihood estimation to obtain a first Markov transition field image;
[0094] The second state transition sequence is reorganized according to the direction dimension and the space dimension to construct the second transition probability tensor, and the second transition probability tensor is input into the Markov random field model. The state transition field is calculated by maximum likelihood estimation to obtain the second Markov transition field image.
[0095] Specifically, the spectrum correlation graph is divided into uniform grids. The spectrum correlation graph is an image represented by a two-dimensional matrix, and its horizontal axis and vertical axis represent the spectrum frequency and the cycle frequency respectively. Assume that the spectrum correlation graph is a The goal of uniform grid partitioning is to divide it into grid cells of equal size, and the size of each grid cell is ,in and is the unit size of the grid division along the rows and columns respectively. Through grid division, the first grid matrix is obtained, which is recorded as ,in and Represent the row index and column index of the grid unit respectively. The formula for grid division is:
[0096] ;
[0097] in, is the midpoint in the spectral correlation graph The value of is the total energy of the corresponding grid cell. The state transition probability between adjacent grid cells is calculated based on the first grid matrix. The state transition probability is defined as the probability that a grid cell transfers its value to its adjacent cells (up, down, left, and right). For example, for a grid cell , and its upward transition probability is defined as:
[0098] ;
[0099] Similarly, define the transition probabilities for downward, left, and right , and By calculating these probabilities, the first state transition sequence is obtained. At the same time, the time-frequency energy distribution matrix is bilinearly interpolated to achieve size transformation. The time-frequency energy distribution matrix is a two-dimensional array that represents the energy distribution of the signal in time and frequency. Assume that the original matrix is , whose size is , the target matrix size is Bilinear interpolation estimates the value of a point in the target matrix by taking the weighted average of the four neighboring points of each point in the original matrix. , the interpolation formula is:
[0100] ;
[0101] in, and is the interpolation coefficient, and is the integer part of the coordinates of the corresponding point in the original matrix. The normalized energy matrix is obtained by interpolation calculation Based on the normalized energy matrix, the state transition probability between adjacent matrix elements is calculated in a similar way to the first grid matrix, including the transfer relationship in the four directions of up, down, left, and right, to obtain the second state transition sequence. The first state transition sequence is reorganized according to the direction dimension and the space dimension to construct the first transition probability tensor. Assume that the first state transition sequence contains directional dimensions, and the state transfer matrix size for each direction is , then the size of the first transition probability tensor is . This tensor is input into the Markov random field model to construct the neighborhood potential energy function It represents the energy distribution of the state transition field, and its formula is:
[0102] ;
[0103] in, Is a node The local energy function of Is a node and The interaction energy function between them is obtained. The parameters are optimized by maximum likelihood estimation, the state transition field is calculated, and the first Markov transition field image is generated. Similarly, the second state transition sequence is reorganized according to the direction dimension and the space dimension, the second transition probability tensor is constructed, and it is input into the Markov random field model. The second Markov transition field image is obtained by the same method.
[0104] In a specific embodiment, the execution step transforms the size of the time-frequency energy distribution matrix by bilinear interpolation calculation to obtain a normalized energy matrix, and calculates the state transition probability between adjacent matrix elements based on the normalized energy matrix, including the transition relationship in the four directions of up, down, left, and right. The process of obtaining the second state transition sequence can specifically include the following steps:
[0105] Calculate the row and column scale factors for the time-frequency energy distribution matrix, set the target matrix size to 64×64, and obtain the interpolation scale coefficient;
[0106] Based on the interpolation scale coefficient, the four adjacent positions of each point in the time-frequency energy distribution matrix are weighted averaged to obtain a bilinear interpolation point set, and the bilinear interpolation point set is reconstructed and arranged according to the size of the 64×64 target matrix to obtain an energy interpolation matrix.
[0107] Performing maximum and minimum value normalization operations on the energy interpolation matrix to obtain a normalized energy matrix, and constructing a transition probability calculation window based on the normalized energy matrix to obtain a state transition unit;
[0108] The Markov transition probabilities of the state transfer unit in the four directions of up, down, left, and right are calculated to obtain the direction transfer probability matrix;
[0109] The direction transfer probability matrix is reorganized to obtain a multi-dimensional transfer probability tensor, and the multi-dimensional transfer probability tensor is expanded and connected in series according to the direction dimension to generate a second state transfer sequence.
[0110] Specifically, the row and column scale factors are calculated for the time-frequency energy distribution matrix to determine the interpolation scale coefficient required when the target matrix size is 64×64. Assuming that the size of the original time-frequency energy distribution matrix is M×N and the row and column size of the target matrix is P×Q (i.e. 64×64), the row scale factor and column scale factor Respectively expressed as:
[0111] ;
[0112] These scaling factors are used to determine the mapping relationship between any position in the original matrix and the corresponding position in the target matrix. Based on the interpolation scaling factor, for each point in the target matrix , weighted average calculation is performed on the four adjacent points around its mapping position in the original matrix to achieve bilinear interpolation. Specifically, let the target matrix point The mapping position in the original matrix is ,in:
[0113] ;
[0114] in and is a real coordinate, taking the integer part and As the nearest upper left corner point index, denoted as . Target point The value of is calculated by the weighted average of its four neighbors:
[0115] ;
[0116] in, and is the interpolation weight, The index in the original matrix is By repeating this process for all points in the target matrix, the complete energy interpolation matrix is obtained. The energy interpolation matrix is normalized to map the values of all elements to the interval [0,1], thereby eliminating the influence of the original data dimension on subsequent analysis. The normalization formula is:
[0117] ;
[0118] in, is the midpoint of the interpolation matrix The value of and are the minimum and maximum values of the interpolation matrix respectively. The normalized matrix With a uniform numerical range, it is more suitable for the calculation of transition probability. Based on the normalized matrix, a transition probability calculation window is constructed to calculate the state transition unit. Assuming that the state of each unit depends on its neighboring relationship in the four directions of up, down, left, and right, for a point in the matrix , its upward transfer probability , downward transfer probability , leftward transfer probability and the probability of rightward transition They are defined as:
[0119] ;
[0120] ;
[0121] in, is the sum of the four neighborhood values of the point in the normalized matrix. Through the above calculations, the up, down, left, and right direction transition probabilities of each point are obtained to form a direction transition probability matrix. The direction transition probability matrix is reorganized and integrated into a multidimensional transition probability tensor according to the direction dimension and space dimension. Assume that the size of the transition probability matrix for each direction is , and the number of directional dimensions is (usually 4, indicating four directions of up, down, left, and right), then the size of the multidimensional transition probability tensor is By expanding and concatenating the tensor along the direction dimension, it is converted into a second state transfer sequence, which contains both the transfer characteristics of the spatial position and the direction information.
[0122] In a specific embodiment, the execution step reorganizes the second state transition sequence according to the direction dimension and the space dimension, constructs a second transition probability tensor, and inputs the second transition probability tensor into the Markov random field model, calculates the state transition field by maximum likelihood estimation, and obtains the second Markov transition field image. The process may specifically include the following steps:
[0123] Decompose the second state transition sequence in four directions: up, down, left, and right, and obtain transition subsequences in four directions;
[0124] Performing matrix deformation on the transfer subsequences in four directions to obtain the spatial transfer matrices in four directions, and constructing a second transfer probability tensor based on the spatial transfer matrices in four directions;
[0125] Calculate the neighborhood potential energy function of the second transition probability tensor, construct the energy function of the Markov random field, and obtain the local potential energy matrix;
[0126] The global energy distribution is calculated based on the local potential energy matrix, and the maximum likelihood method is used to optimize the parameters to obtain the optimized energy parameters.
[0127] The Gibbs distribution calculation is performed on the optimized energy parameters, and the probability model of the state transition field is established to obtain the state transition field distribution;
[0128] The state transition relationship between nodes is calculated according to the state transition field distribution to obtain the state transition field characteristics, and the state transition field characteristics are processed into images to generate a second Markov transition field image.
[0129] Specifically, for the second state transition sequence, it records the state transition information of each node in four directions (up, down, left, and right), which is represented as a three-dimensional matrix ,in It represents the direction dimension (the values are up, down, left, and right), and are the row index and column index of the matrix respectively. Decompose it and get the transfer subsequences in four directions, which are recorded as , , and , these subsequences correspond to the state transition relationship in each direction. Perform matrix transformation on the transfer subsequence in each direction, map the one-dimensional transfer data into a two-dimensional spatial structure, and obtain the spatial transfer matrix in four directions. For example, for , through matrix deformation to generate a size of The two-dimensional matrix ,in and are the number of rows and columns of the matrix respectively. Similarly, for other directions we get , and These spatial transfer matrices fully describe the transition probability distribution of nodes in different directions. The spatial transfer matrices in the four directions are combined to construct the second transition probability tensor , whose size is , which records the state transition probability of the node in all directions and is the core input data of the state transition field. Based on the second transition probability tensor, the neighborhood potential energy function is calculated to construct the energy function of the Markov random field. The energy function of the Markov random field is decomposed into local potential energy terms and neighborhood potential energy terms, and its formula is:
[0130] ;
[0131] in, Is a node status, is the local potential energy function, describing the energy of a single node; is the neighborhood potential energy function, describing the node and its neighbor nodes The interaction energy between is the set of all neighborhood pairs. By calculating the neighborhood relationship of the second transition probability tensor, the local potential matrix is generated. ,in Representation Node After obtaining the local potential energy matrix, the global energy distribution is calculated by summing the local potential energy and neighborhood potential energy of all nodes. The global energy distribution is expressed as:
[0132] ;
[0133] In order to optimize the parameters in the energy function, the maximum likelihood method is used for optimization. The goal is to find the parameter combination that maximizes the probability of observing the data. The objective function of the maximum likelihood estimation is:
[0134] ;
[0135] By logarithmization, the optimization problem is transformed into:
[0136] ;
[0137] in, are model parameters, is the observed data set. Through gradient descent or other optimization methods, the optimized energy parameters are obtained. Based on the optimized energy parameters, Gibbs distribution calculation is performed to establish the probability model of the state transition field. The formula of Gibbs distribution is:
[0138] ;
[0139] in, is the partition function, which is used to normalize the probability distribution. The calculation formula is:
[0140] ;
[0141] Through Gibbs distribution, the probability distribution of the state transition field can fully describe the state transition relationship between nodes. According to the state transition field distribution, the state transition relationship between nodes is calculated and the state transition field features are extracted. For example, by calculating the expected transition probability of each node in four directions, the feature matrix is generated. , whose value is:
[0142] ;
[0143] The state transition field characteristic matrix is processed into a graph, and finally a second Markov transition field image is generated to show the state transition characteristics between different nodes.
[0144] In a specific embodiment, the process of executing step S400 may specifically include the following steps:
[0145] Input the first Markov transfer field image into the first input branch of the stripe pooling graph convolutional neural network model, perform initial feature extraction through a 3×3 convolution kernel, and use a ReLU activation function for nonlinear transformation to obtain a first initial feature map;
[0146] Input the second Markov transfer field image into the second input branch of the stripe pooling graph convolutional neural network model, perform initial feature extraction through a 3×3 convolution kernel, and use a ReLU activation function for nonlinear transformation to obtain a second initial feature map;
[0147] Perform stripe pooling processing on the first initial feature map and the second initial feature map respectively, and use 1×7 and 7×1 pooling kernels to extract features in the horizontal and vertical directions to obtain a first stripe feature map and a second stripe feature map;
[0148] The first stripe feature map and the second stripe feature map are input into the graph convolution layer respectively, feature aggregation is performed based on the neighborhood relationship of the nodes, and convolution calculation is performed using Chebyshev polynomial approximation to obtain the graph feature matrix;
[0149] The graph feature matrix is input into the SE attention mechanism module, and the feature is compressed through global average pooling. The channel weights are recalibrated through two fully connected layers to obtain attention-enhanced features.
[0150] Input the attention-enhanced features into the multi-head graph attention layer, set 8 attention heads, each attention head independently learns the feature representation of different subspaces, and splices the outputs of multiple attention heads to obtain multi-scale graph features;
[0151] Perform global average pooling and global maximum pooling operations on the multi-scale graph features, and perform feature fusion on the pooling results. After passing through two fully connected layers with 1024 and 512 neurons, a fused feature vector is obtained.
[0152] The fused feature vector is input into the output layer with 4 neurons, and the probability distribution of the four states of normal keyboard axis, stuck key, poor rebound and abnormal trigger is calculated by the Softmax function to obtain the fault prediction result.
[0153] Specifically, the first Markov transition field image is input into the first input branch of the stripe pooling graph convolutional neural network model. In this branch, a The convolution kernel of the input image Perform initial feature extraction. The formula for the convolution operation is:
[0154] ;
[0155] in, is the feature map value after convolution, is the weight of the convolution kernel, is the bias term, Represents the coordinates of the image. After the convolution is completed, the ReLU activation function ReLU(z)=max(0,z) is used to perform a nonlinear transformation on the convolution result to enhance the feature expression capability and obtain the first initial feature map. Similarly, the second Markov transfer field image The second input branch of the input model goes through the same The convolution kernel and ReLU activation function are used to process the first and second initial feature maps, respectively, to obtain the second initial feature map. The two initial feature maps reflect the basic features of the two Markov transition field images. Stripe pooling is performed on the first and second initial feature maps to extract directional features. Stripe pooling is an operation specifically targeting the local directional characteristics of an image. and The pooling kernel extracts features in the horizontal and vertical directions of the feature map. The pooling formula is:
[0156] ;
[0157] in, and They are the horizontal and vertical feature maps after stripe pooling. Combine the pooling results in two directions to get the first stripe feature map And the second fringe feature map , these feature maps strengthen the directional feature information of the image. The first and second stripe feature maps are respectively input into the graph convolution layer for feature aggregation. The goal of graph convolution is to calculate graph features based on the neighborhood relationship of nodes. The convolution formula approximated by Chebyshev polynomials is:
[0158] ;
[0159] in, It is Layer graph convolution output, are the parameters that need to be learned. are Chebyshev polynomials, is the normalized graph Laplacian matrix, is the input feature matrix. Through multi-layer graph convolution operations, two graph feature matrices are obtained respectively. and . The graph feature matrix and The input is sent to the SE (Squeeze-and-Excitation) attention mechanism module to enhance the feature expression ability of key channels. The SE module compresses the features through global average pooling:
[0160] ;
[0161] in, It is a channel The compression characteristics of and are the height and width of the feature map, respectively. Then, the channel weights are redistributed through a two-layer fully connected network to generate attention-enhanced features. The attention-enhanced features are input into the multi-head graph attention layer, and 8 attention heads are set. Each head independently learns the feature representation of different subspaces. The formula is:
[0162] ;
[0163] in, It is The output of an attention head is , , are query, key, and value matrices respectively, is the dimension of the key. By concatenating the outputs of all attention heads, a multi-scale graph feature matrix is obtained. Global average pooling and global maximum pooling operations are performed on the multi-scale graph feature matrix respectively, and the formula is:
[0164] ;
[0165] After the pooling results are fused, they are input into a two-layer fully connected network. The first and second layers contain 1024 and 512 neurons respectively. The features are extracted level by level and the dimensions are compressed to finally obtain a fused feature vector. The fused feature vector is input into the output layer with 4 neurons. The Softmax function is used to calculate the probability distribution of the four states of the keyboard axis being normal, stuck, rebounding poorly, and triggering abnormally. The formula is:
[0166] ;
[0167] in, Yes Category The activation value of Yes Category In this way, the model outputs the prediction result of keyboard shaft failure.
[0168] See also Figure 2 , Figure 2 A schematic block diagram of the structure of the keyboard shaft fault diagnosis device 200 provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the keyboard shaft fault diagnosis device 200 includes:
[0169] The acquisition module 210 is used to acquire the pressure signal of the keyboard shaft pressing process to obtain a one-dimensional electrical signal sequence, and to acquire the vibration response of the keyboard shaft pressing process to obtain a one-dimensional vibration signal sequence;
[0170] The analysis module 220 is used to perform square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and perform time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix;
[0171] A calculation module 230 is used to perform grid division and transfer probability calculation on the frequency spectrum correlation diagram and the time-frequency energy distribution matrix respectively to obtain a first Markov transfer field image and a second Markov transfer field image;
[0172] The prediction module 240 is used to input the first Markov transfer field image and the second Markov transfer field image into the fringe pooling graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
[0173] Through the cooperation of the above components, the electrical signal and vibration signal of the keyboard axis are collected simultaneously, and the redistribution spectrum correlation analysis and wavelet packet decomposition technology are combined to achieve the deep fusion of multi-source information and enhance the expression ability of fault features. The Markov transfer field is used to convert the one-dimensional signal into a two-dimensional image, and the stripe pooling module is introduced to effectively extract the long-distance directional characteristics of the signal, overcoming the shortcomings of traditional methods in long-distance spatial feature extraction. The stripe pooling convolutional neural network structure based on the SE attention mechanism is designed, and the model's perception of key features is improved by adaptively adjusting the feature weights. The graph convolutional network is combined with stripe pooling to construct an end-to-end fault diagnosis framework, which improves the diagnosis accuracy under small sample conditions. Through the multi-head attention mechanism and feature fusion strategy, the model's ability to distinguish different types of faults is enhanced, and the reliability of the diagnosis results is improved. Bilinear interpolation and Markov random field models are used to achieve effective transformation and probability modeling of feature space, improving the robustness of the method.
[0174] See also Figure 3 , Figure 3 A schematic block diagram of the structure of a keyboard shaft fault diagnosis device 300 provided in an embodiment of the present application, wherein the keyboard shaft fault diagnosis device 300 includes a processor 301 and a memory 302, wherein the processor 301 and the memory 302 are connected via a device bus 303, wherein the memory 302 may include a non-volatile storage medium and an internal memory.
[0175] The non-volatile storage medium can store a computer program. The computer program includes program instructions, and when the program instructions are executed by the processor 301, the processor 301 can execute any of the above-mentioned keyboard axis fault diagnosis methods.
[0176] The processor 301 is used to provide computing and control capabilities to support the operation of the entire keyboard axis fault diagnosis device 300.
[0177] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 301, the processor 301 can execute any of the above-mentioned keyboard axis fault diagnosis methods.
[0178] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the keyboard axis fault diagnosis device 300 involved in the scheme of the present application. The specific keyboard axis fault diagnosis device 300 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0179] It should be understood that the processor 301 may be a central processing unit (CPU), and the processor 301 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0180] It should be noted that technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the keyboard axis fault diagnosis device 300 described above can refer to the corresponding process of the aforementioned keyboard axis fault diagnosis method, and will not be repeated here.
[0181] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors implement the keyboard shaft fault diagnosis method provided in the embodiment of the present application.
[0182] The computer-readable storage medium may be an internal storage unit of the keyboard shaft fault diagnosis device 300 of the aforementioned embodiment, such as a hard disk or memory of the keyboard shaft fault diagnosis device 300. The computer-readable storage medium may also be an external storage device of the keyboard shaft fault diagnosis device 300, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped with the keyboard shaft fault diagnosis device 300.
[0183] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0184] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0185] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A keyboard shaft fault diagnosis method, characterized in that: include: The pressure signal of the keyboard shaft pressing process is collected to obtain a one-dimensional electrical signal sequence, and the vibration response of the keyboard shaft pressing process is collected to obtain a one-dimensional vibration signal sequence; Performing square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and performing time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix; The spectrum association diagram and the time-frequency energy distribution matrix are respectively gridded and the transfer probability is calculated to obtain a first Markov transfer field image and a second Markov transfer field image; specifically, the method comprises: uniformly gridding the spectrum association diagram to obtain a first grid matrix, and calculating the state transfer probability between adjacent grid units based on the first grid matrix, including the transfer relationship in four directions of up, down, left and right, to obtain a first state transfer sequence; resizing the time-frequency energy distribution matrix through bilinear interpolation calculation to obtain a normalized energy matrix, and calculating the state transfer probability between adjacent matrix elements based on the normalized energy matrix , including transfer relations in four directions of up, down, left and right, to obtain a second state transfer sequence; the first state transfer sequence is reorganized according to the direction dimension and the space dimension to construct a first transfer probability tensor, and the first transfer probability tensor is input into the Markov random field model, and the state transfer field is calculated by maximum likelihood estimation to obtain a first Markov transfer field image; the second state transfer sequence is reorganized according to the direction dimension and the space dimension to construct a second transfer probability tensor, and the second transfer probability tensor is input into the Markov random field model, and the state transfer field is calculated by maximum likelihood estimation to obtain a second Markov transfer field image; The first Markov transfer field image and the second Markov transfer field image are input into a fringe pooling graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
2. The keyboard shaft fault diagnosis method according to claim 1, characterized in that: The pressure signal of the keyboard shaft pressing process is collected to obtain a one-dimensional electrical signal sequence, and the vibration response of the keyboard shaft pressing process is collected to obtain a one-dimensional vibration signal sequence, including: A pressure sensor is installed at the key end of the keyboard shaft, and the mechanical pressing motion of the keyboard shaft is converted into an electrical signal by the pressure sensor to obtain an original electrical signal; An acceleration sensor is installed at the bottom of the keyboard shaft, and the mechanical vibration of the keyboard shaft is converted into a vibration signal by the acceleration sensor to obtain an original vibration signal; Performing signal acquisition on the original electrical signal to obtain an electrical signal sampling sequence, and performing signal acquisition on the original vibration signal to obtain a vibration signal sampling sequence; Performing Butterworth low-pass filtering on the electrical signal sampling sequence to filter out high-frequency noise, thereby obtaining a filtered electrical signal sequence; and at the same time, performing Butterworth low-pass filtering on the vibration signal sampling sequence to filter out high-frequency noise, thereby obtaining a filtered vibration signal sequence; The filtered electrical signal sequence is subjected to zero-mean normalization processing to obtain a one-dimensional electrical signal sequence, and the filtered vibration signal sequence is subjected to zero-mean normalization processing to obtain a one-dimensional vibration signal sequence.
3. The keyboard shaft fault diagnosis method according to claim 1, characterized in that: The one-dimensional electrical signal sequence is subjected to square envelope spectrum calculation and redistribution spectrum correlation analysis to obtain a spectrum correlation diagram, and the one-dimensional vibration signal sequence is subjected to time-frequency analysis and wavelet packet decomposition to obtain a time-frequency energy distribution matrix, including: Performing Hilbert transform analysis on the one-dimensional electrical signal sequence to generate instantaneous frequency and instantaneous amplitude, and constructing an electrical signal analysis sequence according to the instantaneous frequency and the instantaneous amplitude; Performing square envelope spectrum calculation on the electrical signal analysis sequence to obtain a square envelope spectrum; Calculating the reallocated coordinates according to the square envelope spectrum, and allocating the reallocated coordinates on the cyclic frequency to obtain spectrum correlation values; Plotting the spectrum correlation value according to the two-dimensional distribution of spectrum frequency and cycle frequency to generate a spectrum correlation graph; Performing short-time Fourier transform on the one-dimensional vibration signal sequence to obtain a time-frequency distribution of the vibration signal; The time-frequency distribution of the vibration signal is input into the wavelet packet decomposition module, and the db4 wavelet basis function is selected for three-layer decomposition to obtain eight frequency band sub-signals; The mean, variance, kurtosis coefficient and skewness coefficient are calculated for the eight frequency band sub-signals respectively to obtain frequency band energy feature vectors, and a time-frequency energy distribution matrix is constructed based on the frequency band energy feature vectors.
4. The keyboard shaft fault diagnosis method according to claim 1, characterized in that: The time-frequency energy distribution matrix is transformed in size by bilinear interpolation calculation to obtain a normalized energy matrix, and the state transition probability between adjacent matrix elements is calculated based on the normalized energy matrix, including the transition relationship in four directions of up, down, left and right, to obtain a second state transition sequence, including: Calculating row and column scale factors for the time-frequency energy distribution matrix, setting the target matrix size to 64×64, and obtaining interpolation scale coefficients; Based on the interpolation scale coefficient, a weighted average calculation is performed on four adjacent positions of each point in the time-frequency energy distribution matrix to obtain a bilinear interpolation point set, and the bilinear interpolation point set is reconstructed and arranged according to a 64×64 target matrix size to obtain an energy interpolation matrix; Performing a maximum and minimum normalization operation on the energy interpolation matrix to obtain a normalized energy matrix, and constructing a transition probability calculation window according to the normalized energy matrix to obtain a state transition unit; Calculating the Markov transition probabilities of the state transfer unit in four directions, namely, up, down, left, and right, to obtain a direction transfer probability matrix; The directional transfer probability matrix is reorganized to obtain a multidimensional transfer probability tensor, and the multidimensional transfer probability tensor is expanded and connected in series according to the directional dimension to generate a second state transfer sequence.
5. The keyboard shaft fault diagnosis method according to claim 1, characterized in that: The second state transition sequence is reorganized according to the direction dimension and the space dimension to construct a second transition probability tensor, and the second transition probability tensor is input into a Markov random field model, and the state transition field is calculated by maximum likelihood estimation to obtain a second Markov transition field image, including: Decomposing the second state transition sequence in four directions, namely, up, down, left, and right, to obtain transition subsequences in four directions; Performing matrix deformation on the transfer subsequences in the four directions to obtain spatial transfer matrices in the four directions, and constructing a second transfer probability tensor based on the spatial transfer matrices in the four directions; Performing neighborhood potential energy function calculation on the second transition probability tensor, constructing an energy function of a Markov random field, and obtaining a local potential energy matrix; Calculating the global energy distribution based on the local potential energy matrix, and optimizing the parameters using the maximum likelihood method to obtain optimized energy parameters; Performing Gibbs distribution calculation on the optimized energy parameters, establishing a probability model of the state transition field, and obtaining the state transition field distribution; The state transition relationship between nodes is calculated according to the state transition field distribution to obtain state transition field features, and the state transition field features are processed into images to generate a second Markov transition field image.
6. The keyboard shaft fault diagnosis method according to claim 1, characterized in that: The step of inputting the first Markov transfer field image and the second Markov transfer field image into a fringe pooled graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard shaft includes: Inputting the first Markov transfer field image into the first input branch of the stripe pooling graph convolutional neural network model, performing initial feature extraction through a 3×3 convolution kernel, and performing nonlinear transformation using a ReLU activation function to obtain a first initial feature map; Inputting the second Markov transfer field image into the second input branch of the stripe pooled graph convolutional neural network model, performing initial feature extraction through a 3×3 convolution kernel, and performing nonlinear transformation using a ReLU activation function to obtain a second initial feature map; Performing stripe pooling processing on the first initial feature map and the second initial feature map respectively, using 1×7 and 7×1 pooling kernels to extract features in the horizontal and vertical directions, to obtain a first stripe feature map and a second stripe feature map; Inputting the first stripe feature map and the second stripe feature map into the graph convolution layer respectively, performing feature aggregation based on the neighborhood relationship of the nodes, and performing convolution calculation using Chebyshev polynomial approximation to obtain a graph feature matrix; The graph feature matrix is input into the SE attention mechanism module, feature compression is performed through global average pooling, and channel weights are recalibrated through two fully connected layers to obtain attention enhanced features; Input the attention enhancement feature into the multi-head graph attention layer, set 8 attention heads, each attention head independently learns the feature representation of different subspaces, and splice the outputs of multiple attention heads to obtain multi-scale graph features; Performing global average pooling and global maximum pooling operations on the multi-scale graph features, and performing feature fusion on the pooling results, passing through two fully connected layers with 1024 and 512 neurons, to obtain a fused feature vector; The fused feature vector is input into the output layer with 4 neurons, and the probability distribution of the four states of normal keyboard axis, key jamming, poor rebound and abnormal triggering is calculated by the Softmax function to obtain the fault prediction result.
7. A keyboard shaft fault diagnosis device, characterized in that: The method for diagnosing a keyboard shaft fault according to any one of claims 1 to 6 comprises: The acquisition module is used to acquire the pressure signal of the keyboard shaft pressing process to obtain a one-dimensional electrical signal sequence, and to acquire the vibration response of the keyboard shaft pressing process to obtain a one-dimensional vibration signal sequence; An analysis module, used for performing square envelope spectrum calculation and redistribution spectrum correlation analysis on the one-dimensional electrical signal sequence to obtain a spectrum correlation diagram, and performing time-frequency analysis and wavelet packet decomposition on the one-dimensional vibration signal sequence to obtain a time-frequency energy distribution matrix; A calculation module, used for performing grid division and transfer probability calculation on the frequency spectrum correlation diagram and the time-frequency energy distribution matrix respectively, to obtain a first Markov transfer field image and a second Markov transfer field image; A prediction module is used to input the first Markov transfer field image and the second Markov transfer field image into a fringe pooling graph convolutional neural network model for fault analysis to obtain a fault prediction result of the keyboard axis.
8. A keyboard shaft fault diagnosis device, characterized in that: The keyboard shaft fault diagnosis device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the keyboard shaft fault diagnosis device executes the keyboard shaft fault diagnosis method as described in any one of claims 1-6.
9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, the keyboard axis fault diagnosis method as described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Fault diagnosis system and method for gearbox of rolling mill
CN114034481A
Aeroengine bearing fault diagnosis method based on STFT-IncepNext
JP7628356B1