Method, system and device for predicting service life of magnetic reed switch and storage medium
By conducting detailed preprocessing and analysis of the operating data of reed switches and sensors, building a data matrix and calculating relevant parameters, the problem of large life prediction error in the prior art is solved, and a higher accuracy life prediction is achieved.
Patent Information
- Application Number
- CN202411775150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When predicting the life of reed switches, the prior art ignores complex factors in the actual working environment, resulting in large errors and low accuracy in real applications.
By recording the operation data of the reed switch and sensor, data preprocessing is performed, data matrix is constructed, covariance matrix is calculated, life correlation coefficient is sorted, feature roots and feature vectors are calculated, and life prediction is performed based on the environmental parameters to be predicted.
Improves the accuracy of reed switch life prediction, enables more accurate identification of key factors affecting life, and provides more reliable prediction results.
Smart Images

Figure CN119646581A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of reed switches, and in particular to a method, system, device and storage medium for predicting the life of a reed switch. Background Art
[0002] The reed switch works by using the suction force generated by the magnet acting on the reed. When the current passes through the coil, the magnet in the electromagnet disk generates electromagnetic suction and attracts the contact, and the reed moves to realize the open or closed state. It is composed of normally open (or normally closed) contacts, static contact armature, coil, reed switch body, reset device, etc. When the coil is energized, there is magnetic attraction on the static contact armature, and the static contact and normally open (or normally closed) contacts are closed (or separated). When the coil is de-energized, the static contact and normally open (or normally closed) contacts are restored to the initial state under the action of the reset device (spring, elastic element, leaf spring). The reed switch acts in the electromagnet, and its action characteristics are almost not limited by the number of switch actions, and it can close the contacts in a very short time, which is suitable for the fast switching requirements of high-frequency automatic switching circuits. Therefore, the reed switch is used very frequently in industrial production.
[0003] Most of the existing life prediction schemes for reed switches obtain parameters such as voltage, current, power, temperature, humidity, etc. during the operation of the equipment. However, these parameters are only used as reference in the prediction scheme. In the specific implementation process, the reed switch is still tested and replaced after the test. However, in actual use, due to complex environmental factors, the expected service life is sometimes not achieved, which greatly affects the safety and stability of the equipment. Therefore, life evaluation and life prediction of reed switches are very important. However, there is currently no specific life prediction scheme for reed switches during use.
[0004] In the existing technology, the data under laboratory conditions are based on the neglect of the complex factors in the actual working environment, which leads to large errors and low accuracy of the prediction model in real applications. Summary of the invention
[0005] The present invention provides a method, system, device and storage medium for predicting the life of a reed switch, so as to realize the prediction of the life of the reed switch and improve the accuracy of the service life.
[0006] In a first aspect, in order to solve the above technical problems, the present invention provides a method for predicting the life of a reed switch, comprising: According to the existing reed switch and sensor, record the operation data, obtain the sensing data and the life data of the reed switch; Performing data preprocessing operations according to the sensing data and the life data to obtain cleaning data; According to the cleaned data, a data matrix is constructed to obtain a data matrix; Performing covariance calculation according to the data matrix to obtain a covariance matrix; According to the covariance matrix, the life correlation coefficients are sorted to obtain key features; According to the data matrix, characteristic root calculation is performed to obtain characteristic root data and characteristic vector data; A life prediction calculation is performed based on the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result.
[0007] In an optional implementation, performing a data preprocessing operation according to the sensing data and the life data to obtain cleansing data includes: Filling missing values according to the sensing data and the life data to obtain filled data; Outlier processing is performed based on the filled data to obtain cleaned data.
[0008] In an optional implementation, constructing a data matrix based on the cleaned data to obtain a data matrix includes: Performing a data alignment operation according to the cleaned data to obtain an initial feature vector; Performing a data integration operation according to the initial eigenvector to obtain a data matrix; The data matrix is as follows: in, represents a data matrix; Indicates The first feature The value of the parameter; Indicates the type of features including life span data; Indicates the number of parameters recorded.
[0009] In an optional implementation, covariance calculation is performed according to the data matrix to obtain a covariance matrix, including: According to the data matrix, a mean vector is calculated to obtain a mean vector; Performing covariance calculation based on the mean vector and the data matrix to obtain a covariance matrix; The mean vector calculation formula is as follows: in, represents the mean vector; Indicates The average value of the features; The characteristic parameters; The total number of parameters representing the feature; The covariance calculation formula is as follows: in, represents the covariance matrix; is a A vector of all 1s, is the transpose of the mean vector.
[0010] In an optional implementation, the lifespan correlation coefficients are sorted according to the covariance matrix to obtain key features, including: According to the covariance matrix, life-independent vectors are deleted to obtain life-related vectors; According to the life-related vector, a value greater than a predetermined maximum value is deleted to obtain a life-related feature vector; According to the life-related feature vector, the feature with the maximum value is selected to obtain the key feature.
[0011] In an optional implementation, characteristic root calculation is performed according to the data matrix to obtain characteristic root data and characteristic vector data, including: The characteristic root data calculation formula is as follows: in, Represents characteristic root data; represents the identity matrix; represents a data matrix; The calculation formula of the feature vector data is as follows: in, Corresponding to the characteristic root The feature vector data of , and represents the data matrix The direction of the biggest change.
[0012] In an optional implementation, a life prediction calculation is performed based on the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result, including: The life prediction calculation formula is as follows: in, represents the lifespan prediction result; Indicates that the life data in the characteristic root data corresponds to the characteristic root; A feature vector representing the key feature; Represents the mean vector of the environmental parameters to be predicted.
[0013] In a second aspect, the present invention provides a system for predicting the life of a reed switch, comprising: An input module is used to record operation data based on existing reed switches and sensors, and obtain sensing data and life data of the reed switches; A preprocessing module, used for performing data preprocessing operations according to the sensing data and the life data to obtain cleaned data; A data construction module constructs a data matrix according to the cleaned data to obtain a data matrix; A covariance calculation module, used to perform covariance calculation according to the data matrix to obtain a covariance matrix; A key feature selection module, used to sort the life correlation coefficients according to the covariance matrix to obtain key features; A feature calculation module, used to calculate the characteristic root according to the data matrix to obtain the characteristic root data and the characteristic vector data; The prediction module is used to perform life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain the life prediction result.
[0014] In a third aspect, the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any one of the above-mentioned methods for predicting the life of a reed switch when executing the computer program.
[0015] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for predicting the life of a reed switch.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method for predicting the life of a reed switch, comprising: recording operation data according to an existing reed switch and a sensor to obtain sensing data and life data of the reed switch; performing data preprocessing operations according to the sensing data and the life data to obtain cleaned data; constructing a data matrix according to the cleaned data to obtain a data matrix; performing covariance calculation according to the data matrix to obtain a covariance matrix; sorting life correlation coefficients according to the covariance matrix to obtain key features; performing characteristic root calculation according to the data matrix to obtain characteristic root data and characteristic vector data; performing life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result.
[0017] In the present invention, the cleaned data is systematically organized according to features and parameters, and each feature (such as current, voltage, temperature, humidity, etc.) has a corresponding column in the data matrix. Each entry in each column represents the value of the feature in a specific observation, and each row represents a complete observation record, including the values of all feature parameters and the corresponding life data. The data matrix constructed in this way can capture the interactions and correlations between different features, so that the prediction model can more accurately identify the key factors affecting the life of the reed switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of a method for predicting the life of a reed switch provided by an embodiment of the present invention; Figure 2 It is a structural schematic diagram of a system for predicting the life of a reed switch provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The reed switch works by using the suction force generated by the magnet acting on the reed. When the current passes through the coil, the magnet in the electromagnet disk generates electromagnetic suction and attracts the contact, and the reed moves to realize the open or closed state. It is composed of normally open (or normally closed) contacts, static contact armature, coil, reed switch body, reset device, etc. When the coil is energized, there is magnetic attraction on the static contact armature, and the static contact and normally open (or normally closed) contacts are closed (or separated). When the coil is de-energized, the static contact and normally open (or normally closed) contacts are restored to the initial state under the action of the reset device (spring, elastic element, leaf spring). The reed switch acts in the electromagnet, and its action characteristics are almost not limited by the number of switch actions, and it can close the contacts in a very short time, which is suitable for the fast switching requirements of high-frequency automatic switching circuits. Therefore, the reed switch is used very frequently in industrial production.
[0020] Most of the existing life prediction schemes for reed switches obtain parameters such as voltage, current, power, temperature, humidity, etc. during the operation of the equipment. However, these parameters are only used as reference in the prediction scheme. In the specific implementation process, the reed switch is still tested and replaced after the test. However, in actual use, due to complex environmental factors, the expected service life is sometimes not achieved, which greatly affects the safety and stability of the equipment. Therefore, life evaluation and life prediction of reed switches are very important. However, there is currently no specific life prediction scheme for reed switches during use.
[0021] Existing technologies are based on data under laboratory conditions and ignore the complex factors in the actual working environment, which leads to large errors and low accuracy of the prediction models in real-world applications.
[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 only 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] Reference Figure 1 The embodiment of the present invention provides a method for predicting the life of a reed switch, comprising the following steps: S11, recording operation data according to the existing reed switch and sensor, and obtaining sensing data and life data of the reed switch; S12, performing data preprocessing operations according to the sensing data and the life data to obtain cleaning data; S13, constructing a data matrix according to the cleaned data to obtain a data matrix; S14, performing covariance calculation according to the data matrix to obtain a covariance matrix; S15, sorting the lifespan correlation coefficients according to the covariance matrix to obtain key features; S16, performing characteristic root calculation according to the data matrix to obtain characteristic root data and characteristic vector data; S17, performing life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result.
[0024] In step S11, operating data is recorded based on the existing reed switch and sensor to obtain sensing data and life data of the reed switch.
[0025] It should be noted that in step S11, the implementation process involves collecting actual data of the reed switch during operation, which includes environmental parameter data obtained from sensors and life data of the reed switch. Environmental parameters can significantly affect the life of the reed switch, including current parameters, voltage parameters, temperature parameters and humidity parameters. These environmental parameters are monitored and recorded in real time by sensors, while the life data of the reed switch is obtained by recording the total operating time of the reed switch from the beginning of use to failure. After obtaining these data, the next task is to use them to construct a data set, which will serve as the basis for subsequent analysis and model training.
[0026] In step S12, a data preprocessing operation is performed according to the sensing data and the life data to obtain cleansing data, including: Filling missing values according to the sensing data and the life data to obtain filled data; Outlier processing is performed based on the filled data to obtain cleaned data.
[0027] It should be noted that missing value filling is the first step of preprocessing, and its purpose is to solve the problem of missing values in the data set. In the actual sensor data collection process, missing values will appear in the data set due to technical failures, environmental interference or measurement errors. If these missing values are not processed, they will lead to deviations in the analysis results. In order to solve this problem, a variety of methods are used to fill missing values. For example, the mean, median or model-based predicted values are used to fill missing data points. The choice of this method depends on the distribution characteristics of the data to ensure that the filled data is consistent with the actual situation and can maintain the overall consistency of the data set.
[0028] It should be noted that outlier processing is performed, which is the second step of preprocessing. Outliers refer to data points that deviate significantly from other values in the data set. They are caused by measurement errors, data entry errors, or actual extreme events. The existence of outliers will have an adverse effect on data analysis and model training, so they need to be identified and processed. Exemplarily, in an embodiment of the present invention, a method of calculating the characteristic standard deviation is used to find and replace outliers. Once the outliers are identified, these data points can be deleted or replaced according to the specific circumstances. Of course, depending on the actual application scenario and user needs, you can also choose the interquartile range (IQR), Z-score or local outlier factor (LOF)-based outlier detection algorithm to further confirm and process outliers, and the present invention is not limited to this.
[0029] It should be noted that through the above two steps, cleaned data are obtained. These data have removed the influence of missing values and outliers, providing a clean and accurate data basis for subsequent data analysis and model building. For example, in the 1000 data of the embodiment of the present invention, parameters such as current, voltage and temperature, as well as the corresponding reed switch life data are included. During the preprocessing process, it was found that the current values of 50 data points were missing, and the mean of the parameter was chosen to fill these missing values. At the same time, 20 data points were identified to have abnormally high voltage values. After further analysis, it was confirmed that these outliers were caused by sensor failure, so it was decided to delete these data points. After such preprocessing, a more accurate and reliable data set was obtained, which provided solid data support for the prediction of the life of the reed switch.
[0030] In step S13, a data matrix is constructed based on the cleaned data to obtain a data matrix, including: Performing a data alignment operation according to the cleaned data to obtain an initial feature vector; Performing a data integration operation according to the initial eigenvector to obtain a data matrix; The data matrix is as follows: in, represents a data matrix; Indicates The first feature The value of the parameter; Indicates the type of features including life span data; Indicates the number of parameters recorded.
[0031] It should be noted that in step S13, a careful data construction process is performed on the cleaned data to form a data matrix for further analysis. This process first starts with a data alignment operation to ensure that all feature vectors are consistent in dimension and time series. Data alignment is to adjust data collected from different sources or at different time points to a common reference frame so that each data point can correspond to the same features and timestamp. For example, if the sensor data is collected by minutes and the life data is updated by hours, these data need to be adjusted to the same time interval so that each feature vector can reflect the state at the same time point.
[0032] It should be noted that the data integration operation is performed to merge the aligned initial feature vectors into a complete data matrix. Each row of this matrix represents an observation record, and each column represents a specific feature, including parameters such as current, voltage, temperature, humidity, and life data of the reed switch. Exemplarily, the feature type refers to the different types of data contained in the data matrix, which can be sensor parameters and life data, and the number of recorded parameters refers to the number of eigenvalues contained in each observation record.
[0033] It should be noted that, illustratively, in the 1000 data in the embodiment of the present invention, each record contains three parameters: timestamp, current, voltage and temperature, as well as the corresponding reed switch life data. In the data alignment stage, all parameter and life data are adjusted to the timestamp in seconds to ensure that each eigenvector contains the current, voltage, temperature and life information at the same time point. Then, in the data integration stage, these aligned eigenvectors are integrated into a data matrix, in which each row contains all the eigenvalues of an observation record, and each column represents a specific parameter, ultimately forming a data matrix containing 1000 rows and 4 columns (current, voltage, temperature and life). This data matrix provides a structured and standardized data set for subsequent data analysis and model training, so that the relationship between the reed switch life and sensor parameters can be more accurately analyzed.
[0034] In step S14, covariance calculation is performed according to the data matrix to obtain a covariance matrix, including: According to the data matrix, a mean vector is calculated to obtain a mean vector; Performing covariance calculation based on the mean vector and the data matrix to obtain a covariance matrix; The mean vector calculation formula is as follows: in, represents the mean vector; Indicates The average value of the features; The characteristic parameters; The total number of parameters representing the feature; The covariance calculation formula is as follows: in, represents the covariance matrix; is a A vector of all 1s, is the transpose of the mean vector.
[0035] It should be noted that in step S14, the data matrix is subjected to covariance calculation to obtain a covariance matrix. The mean vector provides the average value of each feature and is an important basis for covariance calculation. The covariance matrix describes the linear relationship and variability between different features in the data matrix and is the key to understanding the data structure.
[0036] It should be noted that, exemplarily, in the 1000 observation data of the embodiment of the present invention, each observation value contains 4 features (current, voltage, temperature and life). First, the mean of each feature is calculated to obtain a mean vector containing 4 elements. Then, the covariance matrix is calculated using this mean vector and the data matrix. This covariance matrix will be a 4x4 matrix, in which each element represents the covariance between the corresponding features. Exemplarily, the first row and the first column of the covariance matrix will show the variance of the current feature, and the first row and the second column will show the covariance between the current and voltage features. By analyzing this covariance matrix, the relationship between different features and how they jointly affect the life of the reed switch can be understood.
[0037] In step S15, the life correlation coefficients are sorted according to the covariance matrix to obtain key features, including: According to the covariance matrix, life-independent vectors are deleted to obtain life-related vectors; According to the life-related vector, a value greater than a predetermined maximum value is deleted to obtain a life-related feature vector; According to the life-related feature vector, the feature with the maximum value is selected to obtain the key feature.
[0038] It should be noted that in step S15, the life relevance of the reed switch is deeply analyzed based on the covariance matrix to identify the key features that have the greatest impact on the life. This process first involves extracting vectors related to the life data from the covariance matrix, and then screening out the most relevant features by setting a threshold.
[0039] It should be noted that the covariance matrix is a square matrix that describes the strength and direction of the linear relationship between the variables in the data set. In this step, first remove those vectors that are not related to the life data from the covariance matrix. The covariance values of these vectors are close to zero or statistically insignificant, indicating that they have no significant linear relationship with the life of the reed switch. The purpose of this step is to narrow the scope of analysis and focus on those features that have an impact on life.
[0040] It should be noted that the remaining life-related vectors are further screened. A predetermined correlation maximum value threshold is set, and those feature vector elements whose covariance values are less than the threshold are deleted. Exemplarily, in the embodiment of the present invention, the threshold is set to 1. Of course, other thresholds can be selected according to different actual application scenarios and user needs, because this threshold is set based on statistical significance or business knowledge to ensure that only those features that have a significant impact on life are focused on, and the present invention does not limit this.
[0041] It should be noted that the feature with the largest covariance value is selected from the filtered life-related feature vectors. This maximum value represents the strongest linear relationship between the feature and the life, so the corresponding feature is considered to be a key feature. This feature is directly related to the life of the reed switch, or is an important factor affecting the life.
[0042] It should be noted that, illustratively, in a covariance matrix, it contains data on current, voltage, temperature, and the life of the reed switch. In the analysis, it was found that the covariance values of current and temperature with life were relatively low, so they were excluded from the analysis according to the first step. Then, a threshold is set. illustratively, in an embodiment of the present invention, the threshold is set to 0.5, and those eigenvector elements with covariance values less than 0.5 are further excluded. Of course, according to the actual application scenario and customer needs, it can be set to 0.6, 0.7 or other values, and the present invention is not limited to this. Finally, it was found that the covariance value of the voltage feature was the largest among all the remaining features, so it was determined that voltage was the key feature affecting the life of the reed switch.
[0043] In step S16, characteristic root calculation is performed according to the data matrix to obtain characteristic root data and characteristic vector data, including: The characteristic root data calculation formula is as follows: in, Represents characteristic root data; represents the identity matrix; represents a data matrix; The calculation formula of the feature vector data is as follows: in, Corresponding to the characteristic root The feature vector data of , and represents the data matrix The direction of the biggest change.
[0044] It should be noted that in step S16, the data matrix is subjected to eigenvalue calculation to obtain eigenvalue data and eigenvector data. This process is a key step in understanding the intrinsic structure of the data matrix, which reveals how the data matrix acts on the vector space in which it is located through linear transformation. These eigenvalues provide information about how the data matrix scales different eigenvectors. The eigenvector represents the eigenvector data corresponding to the eigenvalue, which represents the direction in which the data matrix changes the most. For each eigenvalue, solve this equation to obtain the corresponding eigenvector. The eigenvector indicates the direction in which the data matrix acts most significantly, that is, the direction in which the data changes the most.
[0045] It should be noted that, for example, in the 1000 observation data in the embodiment of the present invention, each observation value contains 4 characteristics (current, voltage, temperature and life). First, the characteristic equation is calculated To find the eigenvalues. Currently, 4 eigenvalues are found, each corresponding to a specific feature of the data matrix. Then, for each eigenvalue, solve the equation to find the corresponding eigenvectors. These eigenvectors reveal the variation patterns of the data matrix in different directions. For example, the eigenvectors related to temperature and voltage indicate the direction in which the data varies the most. By analyzing these eigenvectors, the key factors affecting the life of the reed switch can be identified, thus providing important input for the prediction model.
[0046] In step S17, life prediction calculation is performed according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result, including: The life prediction calculation formula is as follows: in, represents the lifespan prediction result; Indicates that the life data in the characteristic root data corresponds to the characteristic root; A feature vector representing the key feature; Represents the mean vector of the environmental parameters to be predicted.
[0047] It should be noted that in step S17, the predicted environmental parameters, characteristic root data, characteristic vector data and key features are used to calculate the predicted life of the reed switch. This calculation process is based on a mathematical model, which aims to accurately predict the impact of environmental parameters on the life of the reed switch by quantifying the impact of environmental parameters on the life of the reed switch.
[0048] It should be noted that, represents the predicted reed switch life results; It is the characteristic root corresponding to the life data in the characteristic root data, which reflects the characteristic vector Scaling factor for data changes in direction; It is the transpose of the eigenvector corresponding to the key feature, which indicates the direction of maximum data change; It is the mean vector of the environmental parameters to be predicted, including the mean values of current, voltage, temperature, humidity and other parameters in the current environment.
[0049] It should be noted that this formula combines the eigenvalues and eigenvectors to quantify the effect of environmental parameters on the life of the reed switch. In this way, the direct effect of environmental parameter changes on the life of the reed switch can be captured and the expected life of the reed switch in a specific environment can be predicted.
[0050] It should be noted that, for example, the characteristic vector most relevant to the life of the reed switch has been determined through the previous steps. , and found the corresponding characteristic root Now, there is a new set of environmental parameters under which the life of the reed switch needs to be predicted. First, the mean vector of these environmental parameters is calculated: , and then compare it with the feature vector Multiply and finally add the characteristic root Get the predicted life span z. For example, if the feature vector Indicating voltage and temperature are the key factors affecting the life of the reed switch. The influence of these two parameters on the life span will be mainly reflected. In this way, a prediction result of the life span of the reed switch can be obtained by comprehensively considering multiple environmental factors, which provides a valuable reference for practical applications.
[0051] In order to facilitate the understanding of the present invention, some preferred embodiments of the present invention are further described below.
[0052] The present invention relates to a method for predicting the life of a reed switch, which aims to predict the expected life of a reed switch in a specific environment by analyzing environmental parameter data recorded by a sensor and the life data of the reed switch. The method ensures the accuracy and reliability of the prediction results through a series of scientific and systematic steps.
[0053] In one implementation, we start with the raw data collected by the sensor, which includes environmental parameters such as current, voltage, temperature, humidity, and the life data of the reed switch. These data are crucial for predicting the life of the reed switch because they are directly related to the performance and reliability of the reed switch under different working conditions. In the data preprocessing stage, these data are cleaned, including missing value filling and outlier processing to ensure the integrity and accuracy of the data. Missing value filling is done by calculating the mean value of each feature and replacing the missing data points with this mean value. Outlier processing is achieved by identifying and removing extreme values that are far away from the center of the data set. These extreme values are caused by measurement errors or equipment failures, which can ensure the accuracy of subsequent analysis.
[0054] Next, a data matrix is constructed to organize all observations into a matrix of rows and columns, where each row represents an observation and each column represents a specific parameter. The purpose of constructing a data matrix is to structure complex data for subsequent mathematical operations and analysis. Then, the covariance matrix is calculated, which is a square matrix that describes the linear relationship between different features in the data matrix. It helps understand how different parameters vary together and the combined effect of these parameters on the life of the reed switch. The calculation of the covariance matrix can reveal the potential relationship between the parameters and provide basic data for feature extraction.
[0055] In the characteristic analysis stage, the characteristic roots and eigenvectors are calculated by solving the characteristic equation. The characteristic roots provide scaling factors for the data changes in different directions, while the eigenvectors indicate the direction of these changes. The characteristic roots and eigenvectors together determine the main change patterns of the data. Special attention is paid to those eigenvectors that are most relevant to the life of the reed switch, which reveal the key factors affecting the life. For example, through characteristic analysis, it is found that voltage and temperature are the key factors affecting the life of the reed switch because they have large eigenvalues in the characteristic equation and represent the main change trends.
[0056] Finally, the eigenvalues and eigenvectors are used to construct a life prediction model. In this model, the eigenvalues most relevant to the life and the corresponding eigenvalues are used, combined with the mean vector of the environmental parameters to be predicted, to calculate the predicted life of the reed switch. This prediction model can capture the impact of environmental parameter changes on the life of the reed switch, thereby providing an accurate life prediction. In this way, a scientific basis can be provided for the design and maintenance of reed switches to ensure the reliability and efficiency of reed switches in water pump control equipment. For example, in practical applications, by accurately predicting the life of a reed switch under specific conditions, a maintenance plan can be made in advance to avoid equipment downtime due to reed switch failures, thereby improving production efficiency and safety.
[0057] For example, in a data set, there are 1000 observation records, each record contains current, voltage, temperature and life data of the reed switch. First, the data is preprocessed to fill in missing values and remove outliers. Then, a data matrix with 1000 rows and 4 columns is constructed, and its covariance matrix is calculated. By analyzing the covariance matrix, the eigenvectors most relevant to the life are identified. For example, it is found that voltage and temperature are the key factors affecting the life of the reed switch. Next, the eigenroots and eigenvectors are calculated, with special attention to those eigenroots associated with the key eigenvectors. Finally, these eigenroots and eigenvectors are used in combination with the mean vector of the new environment parameters to predict the life of the reed switch. For example, if the mean vectors of voltage and temperature of the new environment match the eigenvectors analyzed previously, the prediction model can be used to calculate the expected life of the reed switch in that environment.
[0058] The following describes the working process of the present invention using a common scenario as an example. Figure 2 , which is Figure 1 Schematic diagram of the working scenario of the method.
[0059] To apply the reed switch life prediction method in water pump control equipment, the key raw data is first collected through sensors. These data include environmental parameters such as current, voltage, temperature and humidity, as well as the life data of the reed switch. For example, a specific data set contains 1,000 observation records, each of which contains current, voltage, temperature and the life data of the reed switch. These parameters are indispensable for predicting the life of the reed switch because they are directly related to the performance and reliability of the reed switch under specific working conditions.
[0060] Data preprocessing is an important step to ensure data quality. Missing values are filled by calculating the mean value of each feature, and extreme values far from the center of the data set are identified and removed. These extreme values are caused by measurement errors or equipment failures. In this way, a cleaned data set is obtained, which provides a clean and accurate data basis for subsequent analysis. First, the data are preprocessed to fill missing values and remove outliers. Then, a data matrix with 1000 rows and 4 columns is constructed, and its covariance matrix is calculated. By analyzing the covariance matrix, the eigenvectors most related to life span are identified, and the characteristic roots and eigenvectors are calculated.
[0061] Next, a data matrix is constructed to organize all observations into rows and columns, with each row representing an observation and each column representing a specific parameter. Then, the covariance matrix is calculated, which is a square matrix that describes the linear relationships between different features in the data matrix, which helps understand how different parameters vary together and their joint impact on the life of the reed switch. In the characteristic analysis stage, the characteristic roots and eigenvectors are calculated by solving the characteristic equation. The characteristic roots provide scaling factors for the changes in the data in different directions, while the eigenvectors indicate the direction of these changes. Special attention is paid to those eigenvectors that are most correlated with the life of the reed switch, which reveal the key factors that affect the life. Exemplarily, voltage and temperature were found to be the key factors affecting the life of the reed switch in the analysis.
[0062] Afterwards, the eigenroots and eigenvectors are used to construct a life prediction model. In this model, the eigenvectors most relevant to the life and the corresponding eigenroots are used in combination with the mean vector of the environmental parameters to be predicted to calculate the predicted life of the reed switch. By analyzing the covariance matrix, the eigenvectors most relevant to the life are identified, and the eigenroots and eigenvectors are calculated. Finally, these eigenroots and eigenvectors are used in combination with the voltage and temperature mean vectors of the new environment to predict the life of the reed switch. This method makes the prediction results more reliable by accurately calculating the synergistic relationship between the parameters. This method not only improves the accuracy of the prediction, but also provides valuable guidance for the design and maintenance of reed switches, ensuring the reliability and efficiency of reed switches in water pump control equipment.
[0063] In summary, a method for predicting the life of a reed switch is executed by a computer, including: recording operating data according to an existing reed switch and a sensor to obtain sensing data and life data of the reed switch; performing data preprocessing operations according to the sensing data and the life data to obtain cleaned data; constructing a data matrix according to the cleaned data to obtain a data matrix; performing covariance calculation according to the data matrix to obtain a covariance matrix; sorting life correlation coefficients according to the covariance matrix to obtain key features; performing characteristic root calculation according to the data matrix to obtain characteristic root data and characteristic vector data; performing life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result.
[0064] In the present invention, the cleaned data is systematically organized according to features and parameters, and it is ensured that each feature (such as current, voltage, temperature, humidity, etc.) has a corresponding column in the data matrix. Each entry in each column represents the value of the feature in a specific observation, and each row represents a complete observation record, including the values of all feature parameters and the corresponding life data. The beneficial effect of this processing method is that it can ensure the consistency and integrity of the data, providing a solid foundation for subsequent data analysis and model training. The data matrix constructed in this way can capture the interactions and correlations between different features, so that the prediction model can more accurately identify the key factors affecting the life of the reed switch. In addition, good data organization also helps to improve the efficiency of model training and the accuracy of prediction, making the prediction results more reliable, providing strong data support for the maintenance and life prediction of the reed switch, and improving the prediction accuracy.
[0065] Reference Figure 2 The embodiment of the present invention provides a system for predicting the life of a reed switch, comprising: An input module is used to record operation data based on existing reed switches and sensors, and obtain sensing data and life data of the reed switches; A preprocessing module, used for performing data preprocessing operations according to the sensing data and the life data to obtain cleaned data; A data construction module constructs a data matrix according to the cleaned data to obtain a data matrix; A covariance calculation module, used to perform covariance calculation according to the data matrix to obtain a covariance matrix; A key feature selection module, used to sort the life correlation coefficients according to the covariance matrix to obtain key features; A feature calculation module, used to calculate the characteristic root according to the data matrix to obtain the characteristic root data and the characteristic vector data; The prediction module is used to perform life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain the life prediction result.
[0066] It should be noted that the system for predicting the life of a reed switch provided in an embodiment of the present invention is used to execute all the process steps of the method for predicting the life of a reed switch in the above embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be described in detail.
[0067] The embodiment of the present invention also provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method for predicting the life of the reed switch are implemented, for example Figure 1 Alternatively, the processor implements the functions of each module / unit in the above-mentioned device embodiments when executing the computer program.
[0068] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.
[0069] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0070] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.
[0071] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, 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), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0072] Wherein, if the module / unit integrated in the electronic device 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 such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0073] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0074] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting the life of a reed switch, characterized in that: Executed by a computer, including: According to the existing reed switch and sensor, record the operation data, obtain the sensing data and the life data of the reed switch; Performing data preprocessing operations according to the sensing data and the life data to obtain cleaning data; According to the cleaned data, a data matrix is constructed to obtain a data matrix; Performing covariance calculation according to the data matrix to obtain a covariance matrix; According to the covariance matrix, the life correlation coefficients are sorted to obtain key features; According to the data matrix, characteristic root calculation is performed to obtain characteristic root data and characteristic vector data; A life prediction calculation is performed based on the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain a life prediction result.
2. A method for predicting the life of a reed switch according to claim 1, characterized in that: According to the sensing data and the life data, a data preprocessing operation is performed to obtain cleaned data, including: Filling missing values according to the sensing data and the life data to obtain filled data; Outlier processing is performed based on the filled data to obtain cleaned data.
3. The method for predicting the life of a reed switch according to claim 1, characterized in that: According to the cleaned data, a data matrix is constructed to obtain a data matrix, including: Performing a data alignment operation according to the cleaned data to obtain an initial feature vector; Performing a data integration operation according to the initial eigenvector to obtain a data matrix; The data matrix is as follows: in, represents the data matrix; Indicates The feature of The value of the parameter; Indicates the type of features including life span data; Indicates the number of parameters recorded.
4. The method for predicting the life of a reed switch according to claim 1, characterized in that: According to the data matrix, covariance calculation is performed to obtain a covariance matrix, including: According to the data matrix, a mean vector is calculated to obtain a mean vector; Performing covariance calculation based on the mean vector and the data matrix to obtain a covariance matrix; The mean vector calculation formula is as follows: in, represents the mean vector; Indicates The average value of the features; The characteristic parameters; The total number of parameters representing the feature; The covariance calculation formula is as follows: in, represents the covariance matrix; is a A vector of all 1s, is the transpose of the mean vector.
5. The method for predicting the life of a reed switch according to claim 1, characterized in that: According to the covariance matrix, the life correlation coefficients are sorted to obtain key features, including: According to the covariance matrix, life-independent vectors are deleted to obtain life-related vectors; According to the life-related vector, deleting values greater than a predetermined maximum value of the related value to obtain a life-related feature vector; According to the life-related feature vector, the feature with the maximum value is selected to obtain the key feature.
6. The method for predicting the life of a reed switch according to claim 1, characterized in that: According to the data matrix, characteristic root calculation is performed to obtain characteristic root data and characteristic vector data, including: The characteristic root data calculation formula is as follows: in, Represents characteristic root data; represents the identity matrix; represents the data matrix; The calculation formula of the feature vector data is as follows: in, Corresponding to the characteristic root The feature vector data of , and represents the data matrix The direction of the greatest change.
7. The method for predicting the life of a reed switch according to claim 1, characterized in that: According to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features, life prediction calculation is performed to obtain a life prediction result, including: The life prediction calculation formula is as follows: in, represents the lifespan prediction result; Indicates that the life data in the characteristic root data corresponds to the characteristic root; A feature vector representing the key feature; Represents the mean vector of the environmental parameters to be predicted.
8. A system for predicting the life of a reed switch, characterized in that: include: An input module is used to record operation data based on existing reed switches and sensors, and obtain sensing data and life data of the reed switches; A preprocessing module, used for performing data preprocessing operations according to the sensing data and the life data to obtain cleaned data; A data construction module constructs a data matrix according to the cleaned data to obtain a data matrix; A covariance calculation module, used to perform covariance calculation according to the data matrix to obtain a covariance matrix; A key feature selection module, used to sort the life correlation coefficients according to the covariance matrix to obtain key features; A feature calculation module, used to calculate the characteristic root according to the data matrix to obtain the characteristic root data and the characteristic vector data; The prediction module is used to perform life prediction calculation according to the environmental parameters to be predicted, the characteristic root data, the characteristic vector data and the key features to obtain the life prediction result.
9. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a method for predicting the life of a reed switch as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for predicting the life of a reed switch according to any one of claims 1 to 7.
Citation Information
Patent Citations
Industrial process fault detection method
CN105629959A
Lithium ion battery remaining useful life prediction method and system based on PCA-NARX neural network
CN108535656A
Milling tool remaining life prediction method based on degradation model
CN116070527A
Method and device for predicting service life of spacecraft component
CN116522467A
Method, device and equipment for predicting service life of disconnecting link of disconnecting switch and storage medium
CN117708508A