Method, system, and device for predicting the life of a reed switch and storage medium
By preprocessing and feature analysis of the operating data of the reed switch, a covariance matrix is constructed and key features are identified, enabling accurate life prediction in complex environments. This solves the problem of large errors in existing technologies and improves the safety and stability of the equipment.
Patent Information
- Application Number
- CN202411775150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In existing technologies, the life prediction schemes for reed switches have large errors and low accuracy in practical applications, and fail to effectively consider complex actual working environment factors.
By recording the operating data of reed switches and sensors, data preprocessing is performed, a data matrix is constructed, the covariance matrix and eigenvalues are calculated, key features are identified, and lifetime prediction is performed in combination with the environmental parameters to be predicted.
It improves the accuracy and reliability of reed switch life prediction, ensures equipment safety and stability, and provides a scientific maintenance plan to avoid failure.
Smart Images

Figure CN119646581B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of magnetic reed switches, and in particular to a magnetic reed switch life prediction method, system, device and storage medium. BACKGROUND
[0002] A magnetic reed switch works by using the magnetic force of a magnetic steel acting on a reed to produce suction. When current passes through the coil, the magnetic steel in the electromagnet disc produces electromagnetic suction and attracts the contact, and the reed moves to realize the on or off state. It is composed of normally open (or normally closed) contacts, static contact armature, coil, magnetic reed switch body, reset device, etc. When the coil is energized, there is a magnetic attraction force on the static contact armature, and the static contact and the normally open (or normally closed) contact are closed (or separated). When the coil is de-energized, the static contact and the normally open (or normally closed) contact are restored to the initial state under the action of the reset device (spring, elastic element, leaf spring). The magnetic reed switch acts on the electromagnet, and its action characteristic is almost not limited by the number of switch actions, and it can close the contact in a very short time, which is suitable for the fast switching requirement of high-frequency automatic switching circuit. Therefore, the magnetic reed switch is used frequently in industrial production.
[0003] The existing magnetic reed switch life prediction scheme mostly obtains parameters such as voltage, current, power, temperature, humidity, etc. during the running of the equipment, but these parameters are only used as a reference in the prediction scheme. In the specific implementation process, the magnetic reed switch is still used for trial, and then replaced after the trial is completed. However, in actual use, due to the complexity of the environmental factors, sometimes the predetermined use time cannot be reached, greatly affecting the safety and stability of the equipment. Therefore, the life evaluation and life prediction of the magnetic reed switch are very important, and there is currently no specific life prediction scheme for the magnetic reed switch in use.
[0004] In the prior art, data under laboratory conditions are used, and complex factors in the actual working environment are ignored, which leads to a large error of the prediction model in real application and low accuracy. SUMMARY
[0005] The present application provides a magnetic reed switch life prediction method, system, device and storage medium to predict the life of the magnetic reed switch and improve the accuracy of the service life.
[0006] In the first aspect, to solve the above technical problems, the present application provides a magnetic reed switch life prediction method, comprising:
[0007] According to the existing magnetic reed switch and sensor, record the running data to obtain sensing data and life data of the magnetic reed switch;
[0008] According to the sensing data and the life data, perform a data preprocessing operation to obtain cleaned data;
[0009] According to the cleaning data, data matrix construction is performed to obtain a data matrix;
[0010] According to the data matrix, covariance calculation is performed to obtain a covariance matrix;
[0011] According to the covariance matrix, life correlation coefficient sorting is performed to obtain a key feature;
[0012] According to the data matrix, eigenvalue calculation is performed to obtain eigenvalue data and eigenvector data;
[0013] According to the to-be-predicted environmental parameter, the eigenvalue data, the eigenvector data, and the key feature, life prediction calculation is performed to obtain a life prediction result.
[0014] In an optional implementation, according to the sensing data and the life data, data preprocessing operation is performed to obtain cleaning data, including:
[0015] According to the sensing data and the life data, missing value filling is performed to obtain filled data;
[0016] According to the filled data, outlier processing is performed to obtain the cleaning data.
[0017] In an optional implementation, according to the cleaning data, data matrix construction is performed to obtain a data matrix, including:
[0018] According to the cleaning data, data alignment operation is performed to obtain an initial eigenvector;
[0019] According to the initial eigenvector, data integration operation is performed to obtain the data matrix;
[0020] The data matrix is as follows:
[0021]
[0022] wherein, denotes a data matrix; denotes a value of a parameter of a feature; denotes a value of a parameter of a feature; denotes a value of a parameter of a feature; denotes a feature type including life data; denotes a number of recorded parameters.
[0023] In an optional implementation, according to the data matrix, covariance calculation is performed to obtain a covariance matrix, including:
[0024] According to the data matrix, mean vector calculation is performed to obtain a mean vector;
[0025] According to the mean vector and the data matrix, covariance calculation is performed to obtain a covariance matrix;
[0026] The mean vector calculation formula is as follows:
[0027]
[0028] wherein, represents a mean vector; represents the average value of the i-th feature; represents the i-th parameter of the feature; represents the total number of parameters of the feature; represents the total number of parameters of the feature; The covariance calculation formula is as follows:
[0029]
[0030]
[0031] wherein, represents a covariance matrix; is a full one vector of the covariance matrix, is the transpose of the mean vector.
[0032] In an optional embodiment, according to the covariance matrix, life-related coefficient sorting is performed to obtain a key feature, including:
[0033] According to the covariance matrix, a life-independent vector is deleted to obtain a life-related vector;
[0034] According to the life-related vector, a value greater than a predetermined maximum correlation value is deleted to obtain a life-related feature vector;
[0035] According to the life-related feature vector, a feature in which the maximum value is located is selected to obtain a key feature.
[0036] In an optional embodiment, according to the data matrix, eigenvalue calculation is performed to obtain eigenvalue data and eigenvector data, including:
[0037] The eigenvalue data calculation formula is as follows:
[0038]
[0039] wherein, represents eigenvalue data; represents an identity matrix; represents a data matrix;
[0040] The eigenvector data calculation formula is as follows:
[0041]
[0042] wherein, denotes eigenvector data corresponding to the eigenvalue , and denotes a data matrix with the largest variation.
[0043] In an alternative embodiment, a life prediction calculation is performed according to the environmental parameter to be predicted, the eigenvalue data, the eigenvector data and the key feature, to obtain a life prediction result, comprising:
[0044] The life prediction calculation formula is as follows:
[0045]
[0046] wherein, denotes the life prediction result; denotes the eigenvalue corresponding to the life data in the eigenvalue data; denotes the eigenvector corresponding to the key feature; denotes the mean vector of the environmental parameter to be predicted.
[0047] In a second aspect, the present application provides a magnetic reed switch life prediction system, comprising:
[0048] An input module is configured to record operation data according to an existing magnetic reed switch and a sensor, to obtain sensor data and life data of the magnetic reed switch;
[0049] A preprocessing module is configured to perform a data preprocessing operation according to the sensor data and the life data, to obtain cleaned data;
[0050] A data construction module is configured to perform data matrix construction according to the cleaned data, to obtain a data matrix;
[0051] A covariance calculation module is configured to perform covariance calculation according to the data matrix, to obtain a covariance matrix;
[0052] A key feature selection module is configured to perform life correlation coefficient sorting according to the covariance matrix, to obtain a key feature;
[0053] An eigenvalue calculation module is configured to perform eigenvalue calculation according to the data matrix, to obtain eigenvalue data and eigenvector data;
[0054] A prediction module is configured to perform a life prediction calculation according to the environmental parameter to be predicted, the eigenvalue data, the eigenvector data and the key feature, to obtain a life prediction result.
[0055] In a third aspect, the present application also 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 the method for predicting the service life of a reed switch according to any one of the preceding method embodiments when executing the computer program.
[0056] In a fourth aspect, the present application also provides a computer-readable storage medium comprising a stored computer program, wherein the computer-readable storage medium controls the device where the computer-readable storage medium is located to execute the method for predicting the service life of a reed switch according to any one of the preceding method embodiments when the computer program is running.
[0057] Compared with the prior art, the present application has the following beneficial effects:
[0058] The present application provides a method for predicting the service life of a reed switch, comprising: recording running data according to an existing reed switch and a sensor to obtain sensing data and service life data of the reed switch; performing data preprocessing operations according to the sensing data and the service life data to obtain cleaning data; performing data matrix construction according to the cleaning data to obtain a data matrix; performing covariance calculation according to the data matrix to obtain a covariance matrix; performing service life correlation coefficient sorting according to the covariance matrix to obtain key features; performing eigenvalue calculation according to the data matrix to obtain eigenvalue data and eigenvector data; and performing service life prediction calculation according to an environment parameter to be predicted, the eigenvalue data, the eigenvector data, and the key features to obtain a service life prediction result.
[0059] In the present application, 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 service life data. The data matrix constructed in this way can capture the interaction and correlation between different features, so that the prediction model can more accurately identify the key factors affecting the service life of the reed switch. BRIEF DESCRIPTION OF DRAWINGS
[0060] Figure 1 is a flowchart of a method for predicting the service life of a reed switch provided by an embodiment of the present application;
[0061] Figure 2 is a structural schematic diagram of a system for predicting the service life of a reed switch provided by an embodiment of the present application. DETAILED DESCRIPTION
[0062] The magnetic spring switch is worked by the magnetic attraction of the magnetic steel on the spring leaf. When the current passes through the coil, the magnetic steel in the electromagnet disc generates electromagnetic attraction and attracts the contact, the spring leaf acts to realize the on or off state. It is composed of normally open (or normally closed) contact, static contact armature, coil, magnetic spring switch body, reset device, etc. When the coil is energized, the static contact armature has magnetic attraction, the static contact and the normally open (or normally closed) contact are closed (or separated), and when the coil is de-energized, the static contact and the normally open (or normally closed) contact are restored to the initial state under the action of the reset device (spring, elastic element, leaf spring). The magnetic spring switch acts on the electromagnet, its action characteristic is almost not limited by the number of switch actions, and it can close the contact in a very short time, which is suitable for the fast switching requirement of high-frequency automatic switching circuit. Therefore, the magnetic spring switch is used frequently in industrial production.
[0063] The existing life prediction scheme of the magnetic spring switch mostly obtains the parameters such as voltage, current, power, temperature and humidity of the equipment in the running process, but these parameters are only used as reference in the prediction scheme. In the specific implementation process, the magnetic spring switch is still used for trial, and then replaced after the trial is completed. However, in the actual use process, due to the complex environmental factors, sometimes the predetermined use time cannot be reached, which greatly affects the safety and stability of the equipment. Therefore, the life evaluation and life prediction of the magnetic spring switch are very important, and there is currently no specific life prediction scheme for the magnetic spring switch in the use process.
[0064] The existing technology ignores the complex factors in the actual working environment based on the data under laboratory conditions, which leads to a large error of the prediction model in real application and low accuracy.
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.
[0066] Referring to Figure 1 The embodiment of the present application provides a magnetic spring switch life prediction method, comprising the following steps:
[0067] S11, according to the existing magnetic spring switch and sensor, recording running data, obtaining sensing data and magnetic spring switch life data;
[0068] S12, according to the sensing data and the life data, performing data preprocessing operation to obtain cleaning data;
[0069] S13, according to the cleaning data, data matrix construction is carried out, and data matrix is obtained;
[0070] S14, according to the data matrix, covariance calculation is carried out, and covariance matrix is obtained;
[0071] S15, according to the covariance matrix, life correlation coefficient sorting is carried out, and key features are obtained;
[0072] S16, according to the data matrix, eigenvalue calculation is carried out, and eigenvalue data and eigenvector data are obtained;
[0073] S17, according to the to-be-predicted environmental parameter, the eigenvalue data, the eigenvector data and the key features, life prediction calculation is carried out, and life prediction result is obtained.
[0074] In step S11, according to the existing magnetic reed switch and sensor, the running data is recorded to obtain the sensing data and the life data of the magnetic reed switch.
[0075] It should be noted that in step S11, the implementation process involves collecting actual data of the magnetic reed switch during operation, which includes environmental parameter data obtained from the sensor and life data of the magnetic reed switch. Environmental parameters can significantly affect the life of the magnetic 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 magnetic reed switch is obtained by recording the total running time from the start 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.
[0076] In step S12, according to the sensing data and the life data, data preprocessing operation is carried out to obtain cleaning data, including:
[0077] According to the sensing data and the life data, missing value filling is carried out to obtain filling data;
[0078] According to the filling data, abnormal value processing is carried out to obtain cleaning data.
[0079] It should be noted that the missing value filling is the first step of preprocessing, and the purpose is to solve the problem of missing values in the data set. In the actual sensor data collection process, due to technical failure, environmental interference or measurement error, etc., there will be missing values in the data set. If these missing values are not processed, it will cause the deviation of the analysis result. In order to solve this problem, a variety of methods are used to fill the missing data points, for example, using the mean, median or model-based predicted value to fill the 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.
[0080] It should be noted that the abnormal value processing is the second step of preprocessing. Abnormal values refer to those data points that deviate significantly from other values in the data set, which are caused by measurement error, data entry error or actual extreme event. The existence of abnormal values will adversely affect data analysis and model training, so it needs to be identified and processed. For example, in the embodiment of the application, the method of calculating the standard deviation of the feature is used to find and replace abnormal values, and once the abnormal values are identified, these data points can be selected to be deleted or replaced according to the specific circumstances. Of course, according to different actual application scenarios and user needs, the interquartile range (IQR), Z-score or local outlier factor (LOF) based abnormal value detection algorithm can also be selected to further confirm and process the abnormal values, which is not limited by the application.
[0081] It should be noted that through the above two steps, the cleaned data is obtained, which has removed the influence of missing values and abnormal values, and provides a clean and accurate data basis for subsequent data analysis and model establishment. For example, in the embodiment of the application, 1000 data contains current, voltage and temperature parameters, and corresponding reed switch life data. In the preprocessing process, it is found that the current value of 50 data points is missing, and the mean value of the parameter is selected to fill these missing values. At the same time, 20 data points of voltage value are identified as abnormally high, and after further analysis, it is confirmed that these abnormal values are caused by sensor failure, so it is decided to delete these data points. After such preprocessing, a more accurate and reliable data set is obtained, which provides a solid data support for the prediction of reed switch life.
[0082] In step S13, according to the cleaned data, a data matrix is constructed to obtain a data matrix, including:
[0083] According to the cleaned data, a data alignment operation is performed to obtain an initial feature vector;
[0084] According to the initial feature vector, a data integration operation is performed to obtain a data matrix;
[0085] The data matrix is as follows:
[0086]
[0087] in, Represents a data matrix; Indicates the first The first feature The values of the parameters; This indicates the types of features, including lifetime data. This indicates the number of parameters recorded.
[0088] It should be noted that in step S13, a meticulous data construction process is performed on the cleaned data to form a data matrix for further analysis. This process begins with data alignment to ensure that all feature vectors are consistent in dimension and time series. Data alignment adjusts data collected from different sources or at different times to a common reference frame, so that each data point can correspond to the same feature and timestamp. For example, if sensor data is collected minute by minute and lifetime data is updated hourly, these data need to be adjusted to the same time interval so that each feature vector reflects the state at the same point in time.
[0089] It should be noted that the data integration operation merges 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, and humidity, as well as the lifespan data of the reed switch. For example, the feature type refers to the different types of data contained in the data matrix, which can be sensor parameters and lifespan data, while the number of parameters in the record refers to the number of feature values contained in each observation record.
[0090] It should be noted that, for example, in the 1000 data entries of this embodiment, each record contains three parameters: timestamp, current, voltage, and temperature, as well as the corresponding reed switch lifespan data. During the data alignment stage, all parameters and lifespan data are adjusted to timestamps in seconds, ensuring that each feature vector contains current, voltage, temperature, and lifespan information at the same point in time. Then, in the data integration stage, these aligned feature vectors are integrated into a data matrix, where each row contains all feature values of an observation record, and each column represents a specific parameter, ultimately forming a data matrix with 1000 rows and 4 columns (current, voltage, temperature, and lifespan). This data matrix provides a structured and standardized dataset for subsequent data analysis and model training, enabling more accurate analysis of the relationship between reed switch lifespan and sensor parameters.
[0091] In step S14, covariance is calculated based on the data matrix to obtain the covariance matrix, including:
[0092] Based on the data matrix, the mean vector is calculated to obtain the mean vector;
[0093] Based on the mean vector and the data matrix, the covariance is calculated to obtain the covariance matrix;
[0094] The formula for calculating the mean vector is as follows:
[0095]
[0096] in, Represents the mean vector; Indicates the first The average of the features; The first characteristic represents the feature One parameter; The total number of parameters representing the feature;
[0097] The formula for calculating covariance is as follows:
[0098]
[0099] in, Represent the covariance matrix; It is A vector of all 1s It is the transpose of the mean vector.
[0100] It should be noted that in step S14, covariance is calculated on the data matrix to obtain the 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 key to understanding the data structure.
[0101] It should be noted that, for example, in the 1000 observation data points of this embodiment of the invention, each observation contains four features (current, voltage, temperature, and lifetime). First, the mean of each feature is calculated, resulting in a mean vector containing four elements. Then, this mean vector and the data matrix are used to calculate the covariance matrix. This covariance matrix will be a 4x4 matrix, where each element represents the covariance between the corresponding features. For example, the first row and first column of the covariance matrix will show the variance of the current feature, while the first row and second column will show the covariance between the current and voltage features. By analyzing this covariance matrix, the relationships between different features can be understood, and how they collectively affect the lifetime of the reed switch.
[0102] In step S15, according to the covariance matrix, the life-related coefficient ranking is performed to obtain the key features, including:
[0103] According to the covariance matrix, the life-independent vector is deleted to obtain the life-related vector;
[0104] According to the life-related vector, values greater than a predetermined maximum correlation value are deleted to obtain a life-related feature vector;
[0105] According to the life-related feature vector, the feature where the maximum value is located is selected to obtain the key feature.
[0106] It should be noted that in step S15, the life-relatedness of the reed switch is analyzed in depth based on the covariance matrix to identify the key feature that has the greatest impact on the life. This process first involves extracting vectors related to life data from the covariance matrix, and then selecting the most relevant features by setting a threshold.
[0107] It should be noted that the covariance matrix is a square matrix that describes the strength and direction of linear relationships between variables in the data set. In this step, first, the vectors that are not related to the life data are deleted from the covariance matrix, and 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 features that have an impact on the life.
[0108] It should be noted that the remaining life-related vectors are further screened. A predetermined maximum correlation threshold is set to delete feature vector elements whose covariance values are less than the threshold. For example, in an embodiment of the present application, the threshold is set to 1, of course, other thresholds can also be selected according to actual application scenarios and user needs, because this threshold is set based on statistical significance or business knowledge to ensure that only features that have a significant impact on the life are focused on, and the present application does not limit this.
[0109] It should be noted that the feature with the largest covariance value is selected from the screened life-related feature vector. This maximum value represents the strongest linear relationship between the feature and the life, so the corresponding feature is considered to be the key feature. This feature is directly related to the life of the reed switch or is an important factor affecting the life.
[0110] It is noted that, exemplary, in one covariance matrix, it contains data of current, voltage, temperature and reed switch lifetime. In the analysis, it is found that the covariance values of current and temperature with lifetime are relatively low, so they are excluded from the analysis according to the first step. Then, a threshold is set, exemplary, in the embodiment of the present application, the threshold is set to 0.5, further excluding those eigenvector elements whose covariance values are less than 0.5, of course, according to different application scenarios and customer needs, it can be set to 0.6, 0.7 or other values, the present application does not limit it. Finally, it is found that the covariance value of the voltage feature is the largest among all the remaining features, so the voltage is determined to be the key feature affecting the lifetime of the reed switch.
[0111] In step S16, according to the data matrix, eigenvalue calculation is performed to obtain eigenvalue data and eigenvector data, including:
[0112] The eigenvalue data calculation formula is as follows:
[0113]
[0114] wherein, represents the eigenvalue data; represents the unit matrix; represents the data matrix;
[0115] The calculation formula of the eigenvector data is as follows:
[0116]
[0117] wherein, represents the eigenvector data corresponding to the eigenvalue , and represents the direction in which the data matrix changes the most.
[0118] It is noted that, in step S16, eigenvalue calculation is performed on the data matrix to obtain eigenvalue data and eigenvector data. This process is a key step to understand the internal structure of the data matrix, which reveals how the data matrix acts on the vector space it is in 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, solving this equation gives 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.
[0119] It is noted that, exemplary, in the 1000 observation data of the embodiment of the present application, each observation value contains 4 features (current, voltage, temperature and lifetime). First, the characteristic equation Let's find the eigenvalues. We've found four eigenvalues so far, each corresponding to a specific feature of the data matrix. Then, for each eigenvalue, we solve the equation... The corresponding eigenvectors are then identified. These eigenvectors reveal patterns of change in the data matrix across different directions; for example, eigenvectors related to temperature and voltage indicate the directions of greatest data variation. By analyzing these eigenvectors, key factors affecting the lifespan of reed switches can be identified, thus providing crucial input for predictive models.
[0120] In step S17, based on the environmental parameters to be predicted, the eigenvalue data, the eigenvector data, and the key features, a lifetime prediction calculation is performed to obtain the lifetime prediction result, including:
[0121] The lifetime prediction calculation formula is as follows:
[0122]
[0123] in, This indicates the lifespan prediction results; This indicates that the lifetime data in the eigenvalue data corresponds to the eigenvalue; This represents the feature vector corresponding to the key feature; This represents the mean vector of the environmental parameters to be predicted.
[0124] It should be noted that in step S17, the predicted lifespan of the reed switch is calculated by comprehensively utilizing the environmental parameters to be predicted, eigenvalue data, eigenvector data, and key features. This calculation process is based on a mathematical model that aims to accurately predict the lifespan of the reed switch by quantifying the impact of environmental parameters.
[0125] It should be noted that, among them, This indicates the predicted lifetime of the reed switch; These are the eigenvalues in the eigenvalue data that correspond to the lifetime data; they reflect the eigenvectors. Scaling factor for directional data changes; It is the transpose of the feature vector corresponding to the key feature, which indicates the maximum direction of data change; It is the mean vector of the environmental parameters to be predicted, which includes the mean values of parameters such as current, voltage, temperature, and humidity under the current environment.
[0126] It should be noted that this formula combines eigenvalues and eigenvectors to quantify the impact of environmental parameters on the lifespan of reed switches. In this way, the direct effect of environmental parameter changes on the lifespan of reed switches can be captured, and the expected lifespan of reed switches under specific environmental conditions can be predicted.
[0127] It is noted that, by way of example, the feature vector most relevant to the life of the reed switch has been determined through the previous steps , and the corresponding eigenvalue has been found. Now, there is a new set of environmental parameters that need to be predicted under which the life of the reed switch is. First, the mean vector of these environmental parameters is calculated , then it is multiplied by the feature vector , and finally the eigenvalue is added to obtain the predicted life z. For example, if the feature vector indicates that voltage and temperature are the key factors affecting the life of the reed switch, then will mainly reflect the impact of these two parameters on the life. In this way, a prediction of the life of the reed switch that takes into account multiple environmental factors can be obtained, providing valuable reference for practical application.
[0128] In order to facilitate the understanding of the present application, some preferred embodiments of the present application will be described further below.
[0129] The present application relates to a method for predicting the life of a reed switch, which aims to predict the expected life of a reed switch under specific environmental conditions by analyzing the environmental parameter data recorded by sensors and the life data of the reed switch. This method ensures the accuracy and reliability of the prediction results through a series of scientific and systematic steps.
[0130] In one implementation, first, raw data collected from sensors are used, which include environmental parameters such as current, voltage, temperature, humidity, etc., and life data of the reed switch. These data are crucial for predicting the life of the reed switch, as 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 average value of each feature and replacing the missing data points with the average value. Outlier processing is achieved by identifying and removing extreme values far from the center of the data set, which are caused by measurement errors or equipment failure, so as to ensure the accuracy of subsequent analysis.
[0131] Next, construct a data matrix, organizing all observation records into rows and columns, where each row represents an observation record and each column represents a specific parameter. The data matrix is constructed to structure complex data for subsequent mathematical operations and analysis. Then, calculate the covariance matrix, which is a square matrix that describes the linear relationships between different features in the data matrix. It helps understand how different parameters vary together and their combined impact on the reed switch lifetime. The calculation of the covariance matrix reveals potential relationships between parameters, providing foundational data for feature extraction.
[0132] In the feature analysis phase, eigenvalues and eigenvectors are calculated by solving the eigen equation. Eigenvalues provide scaling factors for data changes in different directions, while eigenvectors indicate the directions of these changes. Together, eigenvalues and eigenvectors determine the main variation patterns of the data. Pay special attention to eigenvectors that are most relevant to the reed switch lifetime, as they reveal key factors affecting the lifetime. For example, through feature analysis, it is found that voltage and temperature are key factors affecting the reed switch lifetime, as their eigenvalues in the eigen equation are larger, representing the main trend of change.
[0133] Finally, use eigenvalues and eigenvectors to build a lifetime prediction model. In this model, use the eigenvectors most relevant to the lifetime and the corresponding eigenvalues, combined with the mean vector of the environmental parameters to be predicted, to calculate the predicted lifetime of the reed switch. This prediction model can capture the impact of environmental parameter changes on the reed switch lifetime, providing accurate lifetime prediction. Through this method, scientific basis can be provided for the design and maintenance of reed switches, ensuring the reliability and efficiency of reed switches in water pump control equipment. For example, in practical applications, by accurately predicting the lifetime of the reed switch under specific conditions, maintenance plans can be made in advance to avoid equipment downtime due to reed switch failure, thereby improving production efficiency and safety.
[0134] For example, in a dataset containing 1000 observation records, each record contains current, voltage, temperature and reed switch lifetime data. First, preprocess the data by filling in missing values and removing outliers. Then, construct a 1000 row by 4 column data matrix and calculate its covariance matrix. By analyzing the covariance matrix, identify the eigenvectors most relevant to the lifetime, for example, find that voltage and temperature are key factors affecting the reed switch lifetime. Then, calculate the eigenvalues and eigenvectors, paying special attention to those associated with the key eigenvectors. Finally, use these eigenvalues and eigenvectors, combined with the mean vector of new environmental parameters, to predict the lifetime of the reed switch. For example, if the mean vector of voltage and temperature in the new environment matches the eigenvectors analyzed earlier, the prediction model can be used to calculate the expected lifetime of the reed switch in that environment.
[0135] The working process of the present application is described below with a more common scenario as an example. Please refer to Figure 2 , which is Figure 1 the working scenario diagram of the method.
[0136] In the water pump control device, the magnetic reed switch life prediction method is applied. First, the key raw data is collected through the sensor, including environmental parameters such as current, voltage, temperature and humidity, as well as the life data of the magnetic reed switch. For example, a specific data set contains 1000 observation records, each record contains current, voltage, temperature and magnetic reed switch life data. These parameters are indispensable for predicting the life of the magnetic reed switch, because they are directly related to the performance and reliability of the magnetic reed switch under certain working conditions.
[0137] Data preprocessing is an important step to ensure data quality. Missing values are filled by calculating the mean of each feature, and extreme values far from the center of the data set are identified and removed, which are caused by measurement errors or equipment failure. In this way, a cleaned data set is obtained, which provides a clean and accurate data basis for subsequent analysis. First, the data is preprocessed to fill in missing values and remove outliers. Then, a 1000-row 4-column data matrix is constructed, and its covariance matrix is calculated. By analyzing the covariance matrix, the most relevant feature vector to life is identified, and the eigenvalue and eigenvector are calculated.
[0138] Next, a data matrix is constructed, organizing all observation records into rows and columns, with each row representing an observation record and each column representing a specific parameter. Then, the covariance matrix is calculated, which is a square matrix describing the linear relationship between different features in the data matrix, helping to understand how different parameters change together and their common influence on the life of the magnetic reed switch. In the feature analysis stage, the eigenvalue and eigenvector are calculated by solving the characteristic equation. Eigenvalues provide scaling factors for data changes in different directions, while eigenvectors indicate the direction of these changes. Special attention is paid to the eigenvectors most relevant to the life of the magnetic reed switch, which reveal the key factors affecting life. For example, in the analysis, it is found that voltage and temperature are key factors affecting the life of the magnetic reed switch.
[0139] After that, eigenvalues and eigenvectors are used to construct a life prediction model. In this model, the eigenvectors most related to the life and the corresponding eigenvalues 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 related to the life are identified, and the eigenvalues and eigenvectors are calculated. Finally, using these eigenvalues and eigenvectors, in combination with the voltage and temperature mean vector of the new environment, the life of the reed switch is predicted. This method makes the prediction result more reliable by accurately calculating the synergistic relationship between each parameter. This method not only improves the accuracy of the prediction, but also provides valuable guidance for the design and maintenance of the reed switch, ensuring the reliability and efficiency of the reed switch in the water pump control device.
[0140] In summary, a method for predicting the life of a reed switch is executed by a computer, including: recording running data to obtain sensor data and life data of the reed switch according to existing reed switches and sensors; performing data preprocessing operations to obtain cleaned data according to the sensor data and the life data; constructing a data matrix to obtain a data matrix according to the cleaned data; calculating a covariance to obtain a covariance matrix according to the data matrix; sorting life correlation coefficients to obtain key features according to the covariance matrix; calculating eigenvalues to obtain eigenvalue data and eigenvector data according to the data matrix; and performing life prediction calculations to obtain a life prediction result according to the to-be-predicted environmental parameters, the eigenvalue data, the eigenvector data, and the key features.
[0141] In the present application, 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, while each row represents a complete observation record, including the values of all feature parameters and the corresponding life data. The beneficial effects of this processing method are that it can ensure the consistency and completeness of the data, and provide a solid foundation for subsequent data analysis and model training. The data matrix constructed in this way can capture the interaction and correlation 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 helps to improve the efficiency of model training and the accuracy of prediction, making the prediction result more reliable, providing strong data support for the maintenance and life prediction of the reed switch, and improving the prediction accuracy.
[0142] With reference to Figure 2 , the present application provides a reed switch life prediction system, comprising:
[0143] The input module is used for recording operation data according to the existing magnetic reed switch and sensor, obtaining sensing data and life data of the magnetic reed switch;
[0144] The preprocessing module is used for performing data preprocessing operation according to the sensing data and the life data, and obtaining cleaning data.
[0145] The data construction module is used for performing data matrix construction according to the cleaning data, and obtaining a data matrix.
[0146] The covariance calculation module is used for performing covariance calculation according to the data matrix, and obtaining a covariance matrix.
[0147] The key feature selection module is used for performing life correlation coefficient sorting according to the covariance matrix, and obtaining a key feature.
[0148] The feature calculation module is used for performing eigenvalue calculation according to the data matrix, and obtaining eigenvalue data and eigenvector data.
[0149] The prediction module is used for performing life prediction calculation according to a to-be-predicted environmental parameter, the eigenvalue data, the eigenvector data and the key feature, and obtaining a life prediction result.
[0150] It should be noted that the prediction system for the life of the magnetic reed switch provided in the embodiments of the present application is used to perform all process steps of the prediction method for the life of the magnetic reed switch in the above embodiments, and the working principles and beneficial effects of the two are one-to-one correspondence, thus no longer being repeated.
[0151] The embodiments of the present application further provide an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor implements the steps in the above-mentioned various prediction methods for the life of the magnetic reed switch when executing the computer program, such as Figure 1 The processor implements the functions of the modules / units in the above-mentioned various devices when executing the computer program.
[0152] For example, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.
[0153] The electronic device can be a computing device such as a desktop computer, a notebook computer, a palm computer, a smart tablet, etc. The electronic device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that the above components are only examples of the electronic device and do not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than the above, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc.
[0154] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the electronic device, and connects various parts of the electronic device through various interfaces and lines.
[0155] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the electronic device by running or executing the computer program and / or modules stored in the memory, and calling 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, at least one application required by a function (such as a sound playing function, an image playing 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, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory device.
[0156] The modules / units integrated in the electronic device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the contents included 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, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0157] It should be noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be realized as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.
[0158] The above-described specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above-described specific embodiments are only for the specific embodiments of the present application and are not used to limit the protection scope of the present application. It is particularly pointed out that any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for predicting the lifespan of a reed switch, characterized in that, Executed by a computer, including: Based on existing reed switches and sensors, record operating data to obtain sensor data and reed switch lifespan data; Based on the sensor data and the lifetime data, data preprocessing operations are performed to obtain cleaning data; Based on the cleaning data, a data matrix is constructed to obtain the data matrix; Based on the data matrix, covariance is calculated to obtain the covariance matrix; Based on the covariance matrix, the lifetime correlation coefficients are sorted to obtain key features; Based on the data matrix, eigenvalues are calculated to obtain eigenvalue data and eigenvector data; Based on the lifetime prediction calculation formula, lifetime prediction calculation is performed to obtain the lifetime prediction result. The lifetime prediction calculation formula is as follows: in, This indicates the predicted lifetime of the reed switch; These are the eigenvalues in the eigenvalue data that correspond to the lifetime data; they reflect the eigenvectors. Scaling factor for directional data changes; It is the transpose of the feature vector corresponding to the key feature, which indicates the maximum direction of data change; It is the mean vector of the environmental parameters to be predicted, which includes the mean values of current, voltage, temperature and humidity parameters under the current environment; Based on the cleaning data, a data matrix is constructed to obtain a data matrix, including: Based on the cleaned data, a data alignment operation is performed to obtain an initial feature vector; Based on the initial feature vector, a data integration operation is performed to obtain a data matrix; The data matrix is as follows: in, Represents a data matrix; Indicates the first The first feature The values of the parameters; This indicates the types of features, including lifetime data. Indicates the number of parameters recorded; Each row of this matrix represents an observation record, and each column represents a specific feature, including current, voltage, temperature, humidity parameters, and the lifespan data of the reed switch. Feature types refer to the different types of data contained in the data matrix, including sensor parameters and lifetime data, while the number of recorded parameters refers to the number of feature values contained in each observation record. This data matrix provides a structured and standardized dataset for subsequent data analysis and model training; Specifically, based on the data matrix, eigenvalue calculation is performed to obtain eigenvalue data and eigenvector data, including: The formula for calculating the eigenvalue data is as follows: in, Represents eigenvalue data; Represents the identity matrix; Represents a data matrix; The formula for calculating the feature vector data is as follows: in, This indicates the corresponding characteristic root. The feature vector data, and the data matrix. The direction of the greatest change.
2. The method for predicting the lifespan of a reed switch according to claim 1, characterized in that, Based on the sensor data and the lifetime data, data preprocessing operations are performed to obtain cleaned data, including: Based on the sensor data and the lifetime data, missing values are filled in to obtain filled data; Based on the filled data, outlier processing is performed to obtain cleaned data.
3. The method for predicting the lifespan of a reed switch according to claim 1, characterized in that, Based on the data matrix, covariance is calculated to obtain the covariance matrix, which includes: Based on the data matrix, the mean vector is calculated to obtain the mean vector; Based on the mean vector and the data matrix, the covariance is calculated to obtain the covariance matrix; The formula for calculating the mean vector is as follows: in, Represents the mean vector; Indicates the first The average of the features; The first characteristic represents the feature One parameter; The total number of parameters representing the feature; The formula for calculating covariance is as follows: in, Represent the covariance matrix; It is A vector of all 1s It is the transpose of the mean vector.
4. The method for predicting the lifespan of a reed switch according to claim 1, characterized in that, Based on the covariance matrix, the lifetime correlation coefficients are sorted to obtain key features, including: Based on the covariance matrix, lifetime-irrelevant vectors are removed to obtain lifetime-related vectors; Based on the lifetime-related vector, delete values that are greater than the predetermined maximum correlation value to obtain the lifetime-related feature vector; Based on the lifespan-related feature vector, the feature with the largest value is selected to obtain the key feature.
5. A system for predicting the lifespan of a reed switch, used to implement the method for predicting the lifespan of a reed switch as described in any one of claims 1 to 4, characterized in that, include: The input module is used to record operating data based on existing reed switches and sensors, and obtain sensor data and reed switch lifespan data. The preprocessing module is used to perform data preprocessing operations based on the sensor data and the lifetime data to obtain cleaned data; The data construction module constructs a data matrix based on the cleaned data to obtain the data matrix; The covariance calculation module is used to calculate the covariance based on the data matrix to obtain the covariance matrix. The key feature selection module is used to sort the lifetime correlation coefficients according to the covariance matrix to obtain key features; The feature calculation module is used to calculate the feature roots based on the data matrix to obtain feature root data and feature vector data. The prediction module is used to perform lifetime prediction calculations based on the environmental parameters to be predicted, the eigenvalue data, the eigenvector data, and the key features, and obtain the lifetime prediction result.
6. An electronic device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a method for predicting the lifetime of a reed switch as described in any one of claims 1 to 4.
7. 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, it controls the device on which the computer-readable storage medium is located to perform a method for predicting the lifetime of a reed switch as described in any one of claims 1 to 4.
Citation Information
Patent Citations
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