Elevator fault diagnosis method based on data driving and related device

By preprocessing and feature extraction of elevator IoT data, combining whale optimization algorithm and random forest algorithm, a WOA-RF fault diagnosis model is built, which solves the problem of low accuracy in elevator fault diagnosis and achieves higher diagnostic accuracy.

CN119903434APending Publication Date: 2025-04-29XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411973241.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, relatively little research on elevator IoT data has led to low accuracy in the diagnosis of elevator faults.

Method used

By obtaining elevator IoT data and normal operation data, preprocessing is performed to merge and clear invalid and redundant data, the training set and test set are constructed, and the hyperparameters of the random forest algorithm model are optimized by using the whale optimization algorithm model to obtain the WOA-RF fault diagnosis model, and train and evaluate it.

Benefits of technology

It improves the accuracy of elevator fault diagnosis, solves the problem of insufficient research on elevator Internet of Things data, and achieves more accurate fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903434A_ABST
    Figure CN119903434A_ABST
Patent Text Reader

Abstract

The invention provides an elevator fault diagnosis method based on data driving and a related device, and belongs to the technical field of elevator fault diagnosis. The method comprises the following steps: constructing a whale optimization algorithm model and a random forest algorithm model, and optimizing hyper-parameters of the random forest algorithm model by adopting the whale optimization algorithm model to obtain a WOA-RF fault diagnosis model; training a WOA-RF fault diagnosis model based on the obtained training set, and evaluating the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; and elevator fault data to be diagnosed are input into the trained WOA-RF fault diagnosis model for elevator fault diagnosis, and an elevator fault diagnosis result is obtained. The problem that in the prior art, the elevator fault diagnosis accuracy is not high due to the fact that the number of research on elevator Internet of Things data is small is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of elevator fault diagnosis, and in particular relates to a data-driven elevator fault diagnosis method and related devices. Background Art

[0002] As a convenient and fast means of vertical transportation, elevators have been widely used in various buildings. However, with the increase in the use and service life of elevators, their safety and reliability have become the focus of increasing attention. If an elevator fails, the life safety of passengers will face a huge threat. Therefore, it is of great significance to establish an effective and accurate fault diagnosis model for various elevator faults to ensure the safe operation of elevators.

[0003] At present, the methods of elevator fault diagnosis mainly include expert system methods based on empirical knowledge, methods based on physical models, and methods based on data-driven methods. The elevator is a complex system with high dimensionality and nonlinearity, and its faults also have the characteristics of diversity and uncertainty, which determines that the elevator fault diagnosis has certain difficulties and complexity, which makes the traditional expert system methods based on empirical knowledge and methods based on physical models have certain limitations in practical applications. In recent years, with the rapid development of artificial intelligence and Internet of Things technology, by deploying various sensors in the elevator system, real-time monitoring and storage of the elevator operation status can be achieved. Therefore, the application of data-driven machine learning methods in elevator fault diagnosis has gradually become mainstream.

[0004] Nowadays, many scholars have applied machine learning algorithms to elevator fault diagnosis, but most researchers only study the faults of a certain subsystem of the elevator, such as the traction system, guide system, and car system, and there is relatively little research on elevator Internet of Things data, resulting in low accuracy in elevator fault diagnosis. Summary of the invention

[0005] The purpose of the present invention is to provide a data-driven elevator fault diagnosis method and related devices, which are used to solve the problem that there is relatively little research on elevator Internet of Things data in the prior art, resulting in low accuracy in elevator fault diagnosis.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a data-driven elevator fault diagnosis method, comprising the following steps: Obtain elevator IoT data and elevator normal operation data, pre-process the obtained elevator IoT data, merge data, and remove invalid data and redundant data; Based on the preprocessed elevator IoT data, the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, and the running time between elevator floors are obtained; The training set and test set are constructed using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data; The whale optimization algorithm model and the random forest algorithm model were constructed, and the hyperparameters of the random forest algorithm model were optimized using the whale optimization algorithm model to obtain the WOA-RF fault diagnosis model. The WOA-RF fault diagnosis model is trained based on the obtained training set, and the performance of the WOA-RF fault diagnosis model is evaluated based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; The elevator fault data to be diagnosed is input into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0007] A further improvement of the present invention is that, in the steps of obtaining elevator Internet of Things data and elevator normal operation data, preprocessing the obtained elevator Internet of Things data, and clearing invalid data and redundant data, the elevator Internet of Things data is obtained specifically through elevator floor sensors, door opening and closing sensors, human body sensors, limit sensors and elevator posture sensors.

[0008] A further improvement of the present invention is that the calculation formula for the time required for the elevator door to be opened from closing is:

[0009] The calculation formula for the time required for the elevator door to open and close is:

[0010] The calculation formula for the number of times the elevator door opens and closes is:

[0011] The calculation formula for the elevator running time between floors is:

[0012] Among them, F1 represents the time required for the elevator door to open from closing, F2 represents the time required for the elevator door to close from opening, F3 represents the number of times the elevator door opens and closes, and F4 represents the running time between elevator floors. Indicates that the elevator door is closed. Indicates that the elevator door is open. represents the function of computation time, A function representing the number of calculations, Indicates that the floor number has changed.

[0013] A further improvement of the present invention is that, in the step of constructing a whale optimization algorithm model and a random forest algorithm model, optimizing the hyperparameters of the random forest algorithm model using the whale optimization algorithm model, and obtaining the WOA-RF fault diagnosis model, the whale optimization algorithm model is specifically used to optimize the number of decision trees and the maximum number of features of the random forest algorithm model.

[0014] A further improvement of the present invention lies in that, in the step of training the WOA-RF fault diagnosis model based on the obtained training set and evaluating the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain the trained WOA-RF fault diagnosis model, a five-fold cross-validation method is specifically used to evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set.

[0015] A further improvement of the present invention is that, in the step of training the WOA-RF fault diagnosis model based on the obtained training set and evaluating the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain the trained WOA-RF fault diagnosis model, specific indicators for evaluating the performance of the WOA-RF fault diagnosis model include accuracy, macro-average of precision, macro-average of recall and macro-average of F1-score.

[0016] A further improvement of the present invention is that normalized secondary preprocessing is performed on the features that can represent the elevator fault diagnosis state, the time required for the elevator door to be opened from closed, the time required for the elevator door to be closed from open, the number of times the elevator door is opened and closed, the running time between elevator floors, and the normal operation data of the elevator. The calculation formula of the normalized secondary preprocessing is:

[0017] in, is the data before normalization. is the minimum value of the data before normalization. is the maximum value of the data before normalization. The data are normalized.

[0018] In a second aspect, the present invention provides a data-driven elevator fault diagnosis system, comprising a data acquisition module, a data preprocessing module, an elevator-related feature acquisition module, a data set construction module, a WOA-RF fault diagnosis model construction module, a WOA-RF fault diagnosis model training module and an elevator fault diagnosis module; The data acquisition module is used to acquire elevator IoT data and elevator normal operation data; The data preprocessing module is used to preprocess the obtained elevator IoT data, merge data, and remove invalid data and redundant data; The elevator-related feature acquisition module is used to obtain features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, and the running time between elevator floors based on the preprocessed elevator IoT data; The data set construction module is used to construct a training set and a test set using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data; The WOA-RF fault diagnosis model building module is used to build a whale optimization algorithm model and a random forest algorithm model, and the whale optimization algorithm model is used to optimize the hyperparameters of the random forest algorithm model to obtain the WOA-RF fault diagnosis model; The WOA-RF fault diagnosis model training module is used to train the WOA-RF fault diagnosis model based on the obtained training set, and evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; The elevator fault diagnosis module is used to input the elevator fault data to be diagnosed into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0019] In a third aspect, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the data-driven elevator fault diagnosis method introduced above when executing the computer program.

[0020] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the data-driven elevator fault diagnosis method introduced above.

[0021] Compared with the prior art, the present invention has the following beneficial effects: The present invention is an improved invention. Compared with the existing data-driven elevator fault diagnosis method, on the one hand, the present invention constructs training sets and test sets based on the features that can represent the state of elevator fault diagnosis, the time required for the elevator door to open from closed to open, the time required for the elevator door to close from open to closed, the number of times the elevator door is opened and closed, the running time between elevator floors, and the normal operation data of the elevator. It can be seen that the present invention considers various fault factors, thereby improving the accuracy of the later elevator fault diagnosis. On the other hand, the present invention uses the whale optimization algorithm model to optimize the hyperparameters of the random forest algorithm model, and can find the best hyperparameters of the random forest algorithm model, thereby also improving the accuracy of the fault diagnosis of the random forest algorithm model, and then effectively solves the problem that the existing technology has relatively little research on elevator Internet of Things data, resulting in low accuracy in elevator fault diagnosis.

[0022] Furthermore, the present invention also discloses the use of a five-fold cross validation method to evaluate the performance of the WOA-RF fault diagnosis model based on a constructed test set, which helps to continuously optimize the WOA-RF fault diagnosis model.

[0023] Furthermore, the present invention also discloses that the indicators for evaluating the performance of the WOA-RF fault diagnosis model include accuracy, macro-average of precision, macro-average of recall and macro-average of F1-score. The present invention adopts accuracy, macro-average of precision, macro-average of recall and macro-average of F1-score as evaluation indicators of the WOA-RF model, which can not only comprehensively evaluate the performance of the WOA-RF model, but also improve the reliability of the evaluation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a flow chart of a data-driven elevator fault diagnosis method according to the present invention; Figure 2 is a schematic diagram of an elevator fault diagnosis system based on data drive according to the present invention; Figure 3 This is a schematic diagram of the elevator Internet of Things data acquisition system of the present invention; Figure 4 Flow chart of optimizing RF model for WOA model of the present invention; Figure 5 It is a curve diagram of fitness value changes under different populations of the present invention; Figure 6 The classification index and confusion matrix diagram of the training set and test set results of the WOA-RF model of the present invention; Figure 7 The figure is a comparison result of the performance of different models of the present invention before and after adding new characteristic variables; Figure 8 Graph showing the performance comparison between the RF model of the present invention and the WOA-RF model; Fig. 9 This is an interface diagram of the elevator system of the present invention; Fig.10 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION

[0025] In order to further understand the content of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.

[0026] The data-driven elevator fault diagnosis method proposed in the present invention trains the WOA-RF fault diagnosis model based on the obtained training set, and evaluates the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; the elevator fault data to be diagnosed is input into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis, and obtain an elevator fault diagnosis result. Compared with the prior art, the present invention effectively solves the problem that the prior art has relatively little research on elevator Internet of Things data, resulting in low accuracy in elevator fault diagnosis.

[0027] Embodiment 1: The flowchart of the elevator fault diagnosis method based on data drive of the present invention is as follows: Figure 1 As shown, the data-driven elevator fault diagnosis method of the present invention includes the following steps: S1. Obtain elevator IoT data and elevator normal operation data, pre-process the obtained elevator IoT data, merge the data, and remove invalid data and redundant data; S2. Based on the preprocessed elevator IoT data, obtain the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, and the running time between elevator floors.

[0028] S3. Construct training and test sets using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data.

[0029] S4. Construct a whale optimization algorithm model and a random forest algorithm model, use the whale optimization algorithm model to optimize the hyperparameters of the random forest algorithm model, and obtain the WOA-RF fault diagnosis model.

[0030] S5. The WOA-RF fault diagnosis model is trained based on the obtained training set, and the performance of the WOA-RF fault diagnosis model is evaluated based on the constructed test set to obtain a trained WOA-RF fault diagnosis model.

[0031] S6. Input the elevator fault data to be diagnosed into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0032] Embodiment 2: The schematic diagram of the data-driven elevator fault diagnosis system of the present invention is as follows: Figure 2 As shown, the data-driven elevator fault diagnosis system of the present invention includes a data acquisition module, a data preprocessing module, an elevator-related feature acquisition module, a data set construction module, a WOA-RF fault diagnosis model construction module, a WOA-RF fault diagnosis model training module and an elevator fault diagnosis module.

[0033] The data acquisition module is used to obtain elevator IoT data and elevator normal operation data.

[0034] The data preprocessing module is used to preprocess the obtained elevator IoT data, merge data, and remove invalid data and redundant data.

[0035] The elevator-related feature acquisition module is used to obtain features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, and the running time between elevator floors based on the preprocessed elevator IoT data.

[0036] The dataset construction module is used to construct training and test sets using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data.

[0037] The WOA-RF fault diagnosis model construction module is used to construct the whale optimization algorithm model and the random forest algorithm model. The whale optimization algorithm model is used to optimize the hyperparameters of the random forest algorithm model to obtain the WOA-RF fault diagnosis model.

[0038] The WOA-RF fault diagnosis model training module is used to train the WOA-RF fault diagnosis model based on the obtained training set, and to evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain a trained WOA-RF fault diagnosis model.

[0039] The elevator fault diagnosis module is used to input the elevator fault data to be diagnosed into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0040] Embodiment 3: S1. Obtain elevator IoT data and elevator normal operation data, pre-process the obtained elevator IoT data, and remove invalid data and redundant data.

[0041] First, the elevator IoT data and the elevator normal operation data are obtained, and then the obtained elevator IoT data is preprocessed to merge the data and remove invalid data and redundant data.

[0042] Specifically, elevator IoT data is acquired through elevator floor sensors, door opening and closing sensors, human body sensors, limit sensors and elevator posture sensors in the elevator IoT data acquisition system. The elevator IoT data collection system installs the elevator IoT terminal on the top of the elevator car and collects elevator operation data through various external sensors. The data collection process of the system is as follows: Figure 3 As shown. The elevator data collector sends data to the elevator IoT platform through the network for display and storage. Once the elevator operation status changes or an alarm occurs, the data will be reported immediately. If the elevator is in a stationary state or the operation status remains unchanged, the heartbeat time will be set to report the data. The system mainly collects the equipment information, elevator status and fault code data of the elevator. The elevator status mainly includes real-time data and trigger data. Real-time data mainly includes the running speed of the elevator, the front and rear and left and right offset angles of the elevator, whether there is someone in the car, three-axis acceleration, temperature and humidity, etc. Trigger data mainly includes upper limit and lower limit signals, current floor, operation status and door opening and closing status, etc. Since the original data obtained is in JSON format, the original data is shown in Table 1, and the data distribution in different attributes is not conducive to model building, it is necessary to merge the original data and merge the data in all attributes into the same table. Through the sorted table, it is found that the equipment information in the obtained elevator data is invalid data, and the temperature and humidity of the elevator in the elevator status have no actual "contribution" to the elevator fault diagnosis, so for the effect of later model training, it is necessary to discard it (also called clearing invalid data). In addition, considering that the number of fault samples in the actual operation of the elevator is far less than the number of normal samples, and there are a large number of duplicate samples in the normal number of samples, in order to reduce the impact of data imbalance on the subsequent model training, redundant data is cleared when exporting data.

[0043] Table 1. Original data obtained

[0044] S2. Based on the preprocessed elevator IoT data, obtain the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, and the running time between elevator floors.

[0045] The calculation formula for the time required for the elevator door to open from closing is:

[0046] The calculation formula for the time required for the elevator door to open and close is:

[0047] The calculation formula for the number of times the elevator door opens and closes is:

[0048] The calculation formula for the elevator running time between floors is:

[0049] Among them, F1 represents the time required for the elevator door to open from closing, F2 represents the time required for the elevator door to close from opening, F3 represents the number of times the elevator door opens and closes, and F4 represents the running time between elevator floors. Indicates that the elevator door is closed. Indicates that the elevator door is open. represents the function of computation time, A function representing the number of calculations, Indicates that the floor number has changed.

[0050] In this embodiment, the characteristics that can represent the elevator fault diagnosis state, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door is opened and closed, and the running time between elevator floors are shown in Table 2, wherein the characteristics that can represent the elevator fault diagnosis state (such as the characteristic vectors X1-X14 in Table 2), the time required for the elevator door to open from closing (such as the characteristic vector X15 in Table 2), the time required for the elevator door to close from opening (such as the characteristic vector X16 in Table 2), the number of times the elevator door is opened and closed (such as the characteristic vector X17 in Table 2), and the running time between elevator floors (such as the characteristic vector X18 in Table 2).

[0051] Table 2 Elevator related feature data table

[0052] S3. Construct training and test sets using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data.

[0053] Specifically, in this step, the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed to open, the time required for the elevator door to close from open to closed, the number of times the elevator door opens and closes, the running time between elevator floors, and the normal operation data of the elevator are divided into training sets and test sets in a ratio of 7:3.

[0054] This embodiment also performs normalization secondary preprocessing on the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, the running time between elevator floors, and the normal operation data of the elevator, and maps all the data to The calculation formula for the normalized secondary preprocessing is:

[0055] in, is the data before normalization. is the minimum value of the data before normalization. is the maximum value of the data before normalization. The data are normalized.

[0056] S4. Construct a whale optimization algorithm model and a random forest algorithm model, use the whale optimization algorithm model to optimize the hyperparameters of the random forest algorithm model, and obtain the WOA-RF fault diagnosis model.

[0057] Specifically, in this step, the Whale Optimization Algorithm (WOA) model is used to optimize the number of decision trees and the maximum number of features of the Random Forest (RF) model. The flowchart of the WOA model optimizing the RF model is as follows: Figure 4 The specific optimization process is described as follows: A. Set the parameters of the RF model and set the search upper and lower limits of the parameters to be optimized (the number of decision trees and the maximum number of features).

[0058] The WOA model mainly simulates three types of humpback whale predation behaviors: encircling prey, attacking with bubble nets, and searching for prey. In the process of predation, an individual whale can represent a solution. The entire process of searching for solutions by the whale optimization algorithm can be regarded as a process of continuously updating the positions of several whales until a satisfactory solution is found. Its mathematical model is shown below. (1) Surrounding prey: The whale will move to the optimal position, and the position calculation formula is as follows:

[0059] in, is the distance between the whale and its prey, is the current position of the whale, The best position for whales. is the number of iterations; and is the coefficient vector, and the calculation formula is as follows:

[0060] in, To control the parameters, is the maximum number of iterations, and for A random vector of .

[0061] (2) Bubble net attack: Bubble net attack is a unique predation behavior of humpback whales. The whales circle around the food and spit out bubbles to surround the food. As the range of the bubble circle becomes smaller and smaller, the food is finally eaten. The mathematical expression of spiral predation is:

[0062] in, is the logarithmic spiral shape constant; for A random number.

[0063] When a whale approaches its food, it will attack both by contraction and spiral simultaneously, with a probability of Decide, , the specific model description is:

[0064] (3) Search and prey: In order to increase the whale's search range, the individual whale will not approach the best individual whale, but will randomly select a whale from the whale group to approach. The mathematical expression of the whale's position at this time is:

[0065] in, To randomly select the distance from the whale to the prey, to a random location.

[0066] B. Initialize the whale population, the calculation formula is as follows:

[0067] in, is the position of whale individual i, and denote the upper and lower bounds of individual motion, respectively. is a random function with a value range of [0,1].

[0068] C. Calculate the fitness value and determine whether the algorithm meets the termination conditions.

[0069] The termination condition is set to the current maximum number of iterations. If it is met, the result is output and the algorithm ends. Otherwise, proceed to step D.

[0070] D. Update whale position.

[0071] Update the whale position according to the above 5 formulas.

[0072] E. If the termination condition cannot be met, return to step C and iterate.

[0073] In this embodiment, the population size is set to 20, 60 and 100, and the maximum number of iterations is set to 25. The fitness value change curves under different populations are as follows: Figure 5 As shown in Figure 3, when the population is 100, the convergence speed is slightly better than other population numbers, so this embodiment selects the population number as 100. When the fitness value no longer changes with the number of iterations, the iteration ends, and the optimal hyperparameter combination is obtained to construct the optimal WOA-RF fault diagnosis model. The optimal hyperparameters of the WOA-RF fault diagnosis model are shown in Table 3.

[0074] Table 3 Optimal hyperparameters of WOA-RF fault diagnosis model

[0075] S5. The WOA-RF fault diagnosis model is trained based on the obtained training set, and the performance of the WOA-RF fault diagnosis model is evaluated based on the constructed test set to obtain a trained WOA-RF fault diagnosis model.

[0076] Specifically, in this step, the five-fold cross validation method is used to evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set. The indicators for evaluating the performance of the WOA-RF fault diagnosis model include accuracy, macro-average of precision, macro-average of recall, and macro-average of F1-score.

[0077] Specifically, the confusion matrix is ​​used to calculate the accuracy, macro-average of precision, macro-average of recall, and macro-average of F1-score of the WOA-RF fault diagnosis model.

[0078] The confusion matrix is ​​a Through the confusion matrix, multiple classification performance indicators can be calculated. Since elevator fault diagnosis is a multi-classification problem, the bias problem caused by different sample numbers is taken into account.

[0079] The calculation formulas for the macro-average of accuracy, precision, recall, and F1-score are as follows:

[0080]

[0081]

[0082]

[0083] in, Indicates the number of fault categories, Indicates the actual fault type is The sample is predicted to be The number of samples, represents the accuracy of the model prediction, represents the macro-average of recall (also called overall precision), represents the macro-average of recall (also called overall recall), Represents the macro average of F1-score (also called and harmonic mean of ).

[0084] The classification index and confusion matrix of the training set and test set results of the WOA-RF model (also WOA-RF fault diagnosis model) of the present invention are shown in the figure below: Figure 6 As shown, from Figure 6 It can be seen that there are only 14 and 7 sample prediction errors in the training set and test set respectively, indicating that the established hybrid model (WOA-RF fault diagnosis model) has good performance for elevator fault diagnosis. The classification indicators are calculated by the confusion matrix. The accuracy of the training set is 99.39%, the precision is 98.98%, the recall is 99.90%, and the F1-score is 99.43%, indicating that the WOF-RF model training effect is good. The accuracy of the test set is 99.29%, the precision is 99.00%, the recall is 99.70%, and the F1-score is 99.34%, indicating that the trained WOF-RF model has good generalization performance.

[0085] S6. Input the elevator fault data to be diagnosed into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0086] In order to verify the effectiveness and feasibility of the data-driven elevator fault diagnosis method proposed in the present invention, this embodiment compares the performance of different models (support vector machine SVM, naive Bayes NB, K nearest neighbor algorithm KNN, artificial neural network ANN and decision tree DT) before and after adding new feature variables (the time required for the elevator door to open from closing to opening F1, the time required for the elevator door to close from opening to closing F2, the number of times the elevator door opens and closes F3 and the running time between elevator floors F4). The comparison results are as follows: Figure 7 As shown, from Figure 7 It can be seen that after adding new feature variables (the time required for the elevator door to open from closing to opening F1, the time required for the elevator door to close from opening to closing F2, the number of times the elevator door opens and closes F3, and the running time between elevator floors F4), the accuracy of each model has been improved to varying degrees, proving the necessity of adding new feature variables. In addition, whether before or after adding new feature variables, the two evaluation indicators (accuracy) of the RF model are better than those of the DT, indicating that the RF model integrated by the DT can improve the prediction performance of the model.

[0087] This embodiment compares the performance of the RF model and the WOA-RF model. The comparison results are as follows: Figure 8 As shown in the figure, by comparing the performance of the RF model and the WOA-RF model on the test set, it can be seen that after the WOA model optimizes the parameters of the RF model, the accuracy, precision, recall and F1-score are all improved to varying degrees, proving that the WOA model is effective in improving the performance of the RF model.

[0088] After verifying the effectiveness and feasibility of the WOA-RF fault diagnosis model, the WOA-RF fault diagnosis model is combined with the actual elevator system. First, a suitable cloud service platform is selected, and dependent environments such as Python, TensorFlow, PyTorch, and scikit-learn are configured on the cloud service platform. Frameworks such as Flask or FastAPI are installed to create API services. A Web service interface is created using frameworks such as Flask or FastAPI. The API receives data from elevator sensors as input and returns the results of elevator fault diagnosis. The elevator data collector of the elevator system regularly collects relevant data and sends real-time data to the cloud through the MQTT protocol. After receiving the data, the API on the cloud server performs data preprocessing and fault feature extraction, and passes the data after fault feature extraction to the trained model (WOA-RF fault diagnosis model) for diagnosis. According to the output results of the WOA-RF fault diagnosis model, it is determined whether the elevator has a fault. If a fault is detected in the elevator, the elevator system interface will issue an alarm to facilitate timely notification of the operation and maintenance personnel for inspection and repair. The interface of the elevator system is as follows: Fig. 9 shown.

[0089] Embodiment 4: See also Fig.10 As shown, the present invention also provides an electronic device 100 based on a data-driven elevator fault diagnosis method; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.

[0090] The memory 101 can be used to store the computer program 103. The processor 102 implements the steps of the data-driven elevator fault diagnosis method described in Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101. The memory 101 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 (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 101 can 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 (FlashCard), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0091] The at least one processor 102 may be a central processing unit (CPU), or 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. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and uses various interfaces and lines to connect various parts of the entire electronic device 100.

[0092] The memory 101 in the electronic device 100 stores a plurality of instructions to implement a data-driven elevator fault diagnosis method, and the processor 102 can execute the plurality of instructions to implement: Obtain elevator IoT data and elevator normal operation data, pre-process the obtained elevator IoT data, and remove invalid and redundant data; Based on the preprocessed elevator IoT data, the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, and the running time between elevator floors are obtained; The training set and test set are constructed using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data; The whale optimization algorithm model and the random forest algorithm model were constructed, and the hyperparameters of the random forest algorithm model were optimized using the whale optimization algorithm model to obtain the WOA-RF fault diagnosis model. The WOA-RF fault diagnosis model is trained based on the obtained training set, and the performance of the WOA-RF fault diagnosis model is evaluated based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; The elevator fault data to be diagnosed is input into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

[0093] Embodiment 5: If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process 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 method embodiments when executed by the processor. Among them, 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 that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).

[0094] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0095] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0096] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A data-driven elevator fault diagnosis method, characterized in that: The following steps are involved: Obtain elevator IoT data and elevator normal operation data, pre-process the obtained elevator IoT data, merge data, and remove invalid data and redundant data; Based on the preprocessed elevator IoT data, the features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, and the running time between elevator floors are obtained; The training set and test set are constructed using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data; The whale optimization algorithm model and the random forest algorithm model were constructed, and the hyperparameters of the random forest algorithm model were optimized using the whale optimization algorithm model to obtain the WOA-RF fault diagnosis model. The WOA-RF fault diagnosis model is trained based on the obtained training set, and the performance of the WOA-RF fault diagnosis model is evaluated based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; The elevator fault data to be diagnosed is input into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

2. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: In the steps of obtaining elevator IoT data and elevator normal operation data, preprocessing the obtained elevator IoT data, and clearing invalid data and redundant data, the elevator IoT data is obtained specifically through elevator floor sensors, door opening and closing sensors, human body sensors, limit sensors and elevator posture sensors.

3. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: The calculation formula for the time required for the elevator door to open from closing is: The calculation formula for the time required for the elevator door to open and close is: The calculation formula for the number of times the elevator door opens and closes is: The calculation formula for the elevator running time between floors is: Among them, F1 represents the time required for the elevator door to open from closing, F2 represents the time required for the elevator door to close from opening, F3 represents the number of times the elevator door opens and closes, and F4 represents the running time between elevator floors. Indicates that the elevator door is closed. Indicates that the elevator door is open. represents the function of computation time, A function representing the number of calculations, Indicates that the floor number has changed.

4. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: In the step of constructing a whale optimization algorithm model and a random forest algorithm model, optimizing the hyperparameters of the random forest algorithm model using the whale optimization algorithm model, and obtaining the WOA-RF fault diagnosis model, the whale optimization algorithm model is specifically used to optimize the number of decision trees and the maximum number of features of the random forest algorithm model.

5. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: In the step of training the WOA-RF fault diagnosis model based on the obtained training set, and evaluating the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain the trained WOA-RF fault diagnosis model, a five-fold cross validation method is specifically used to evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set.

6. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: In the step of training the WOA-RF fault diagnosis model based on the obtained training set and evaluating the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain the trained WOA-RF fault diagnosis model, specific indicators for evaluating the performance of the WOA-RF fault diagnosis model include accuracy, macro-average of precision, macro-average of recall and macro-average of F1-score.

7. The data-driven elevator fault diagnosis method according to claim 1, characterized in that: The features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, the running time between elevator floors and the normal operation data of the elevator are also normalized and preprocessed. The calculation formula of the normalized secondary preprocessing is: in, is the data before normalization. is the minimum value of the data before normalization. is the maximum value of the data before normalization. The data are normalized.

8. A data-driven elevator fault diagnosis system, characterized in that: It includes data acquisition module, data preprocessing module, elevator related feature acquisition module, data set construction module, WOA-RF fault diagnosis model construction module, WOA-RF fault diagnosis model training module and elevator fault diagnosis module; The data acquisition module is used to acquire elevator IoT data and elevator normal operation data; The data preprocessing module is used to preprocess the obtained elevator IoT data, merge data, and remove invalid data and redundant data; The elevator-related feature acquisition module is used to obtain features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closing, the time required for the elevator door to close from opening, the number of times the elevator door opens and closes, and the running time between elevator floors based on the preprocessed elevator IoT data; The data set construction module is used to construct a training set and a test set using features that can represent the elevator fault diagnosis status, the time required for the elevator door to open from closed, the time required for the elevator door to close from open, the number of times the elevator door opens and closes, the elevator running time between floors, and the elevator normal operation data; The WOA-RF fault diagnosis model building module is used to build a whale optimization algorithm model and a random forest algorithm model, and the whale optimization algorithm model is used to optimize the hyperparameters of the random forest algorithm model to obtain the WOA-RF fault diagnosis model; The WOA-RF fault diagnosis model training module is used to train the WOA-RF fault diagnosis model based on the obtained training set, and evaluate the performance of the WOA-RF fault diagnosis model based on the constructed test set to obtain a trained WOA-RF fault diagnosis model; The elevator fault diagnosis module is used to input the elevator fault data to be diagnosed into the trained WOA-RF fault diagnosis model to perform elevator fault diagnosis and obtain the elevator fault diagnosis result.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the data-driven elevator fault diagnosis method according to any one of claims 1 to 7 are implemented.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data-driven elevator fault diagnosis method according to any one of claims 1 to 7 are implemented.