Model deployment method, fault diagnosis method, system, equipment and medium
By preprocessing and model optimization of the historical working data of smart cabinets, the training and deployment of fault diagnosis models are simplified, the problem of low fault diagnosis efficiency of smart cabinets is solved, the accuracy and timeliness of fault diagnosis are improved, and the operation and maintenance are improved efficiency.
Patent Information
- Application Number
- CN202411311470.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Smart cabinets have insufficient stability in fault diagnosis. The existing fault diagnosis model relies on manual experience, and the training and deployment process is complicated and complicated, resulting in low operation and maintenance efficiency, poor accuracy and timeliness.
By obtaining the historical working data of the smart cabinet for preprocessing, it is divided into training set, verification set and test set, and trained and tuned based on the initial fault diagnosis model. The model is then compressed and optimized and deployed to the cloud server to simplify the fault diagnosis model. The training and deployment process improves the accuracy and timeliness of fault diagnosis.
This greatly simplifies the training and deployment process of the fault diagnosis model, reduces manual intervention, improves the accuracy and timeliness of fault diagnosis, and improves the operation and maintenance efficiency of smart cabinets.
Smart Images

Figure CN119128396A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a model deployment method, a fault diagnosis method, a system, a device and a medium. Background Art
[0002] With the advancement of technology, smart cabinets have developed rapidly due to their convenience and unmanned features, and have been widely used in various fields. However, smart cabinets also generally have the problem of insufficient stability. If the smart cabinet has equipment failure, it is often not discovered in time and cannot be repaired in time, which affects the normal use of the smart cabinet and increases operation and maintenance costs.
[0003] In the field of fault diagnosis of smart cabinets, the current fault diagnosis model needs to rely on manual experience, the training and deployment process is cumbersome and complicated, the operation and maintenance efficiency is low, and the accuracy and timeliness are poor. Summary of the invention
[0004] Based on this, it is necessary to provide a model deployment method, fault diagnosis method, system, device and medium to address the above technical issues.
[0005] In a first aspect, the present application provides a model deployment method, the model deployment method comprising:
[0006] Obtain historical working data of smart cabinets;
[0007] Preprocessing the historical work data;
[0008] Provide initial fault diagnosis model;
[0009] The preprocessed historical working data is divided into training set data, verification set data and test set data; the initial fault diagnosis model is trained based on the training set data; the trained initial fault diagnosis model is verified and optimized based on the verification set data; the verified and optimized initial fault diagnosis model is tested based on the test set data to obtain the fault diagnosis model to be optimized;
[0010] Performing compression optimization on the fault diagnosis model to be optimized to obtain a fault diagnosis model;
[0011] Configure cloud servers;
[0012] The fault diagnosis model is deployed on the cloud server.
[0013] Optionally, the historical working data includes historical original working data of the smart cabinet in a normal working state and historical original working data of the smart cabinet in a fault state; and the preprocessing of the historical working data includes:
[0014] Performing initial preprocessing on the historical working data, the initial preprocessing comprising: cleaning the historical working data; and marking faults based on the cleaned historical working data;
[0015] Extracting features from the historical working data after the initial preprocessing;
[0016] The extracted features are selected to obtain the target features.
[0017] Optionally, before compressing and optimizing the fault diagnosis model to be optimized to obtain the fault diagnosis model, the method further includes: exporting the fault diagnosis model to be optimized into a general format model, wherein the general format model includes a model structure, weights and configuration information;
[0018] The compressing and optimizing the fault diagnosis model to be optimized to obtain the fault diagnosis model includes:
[0019] Performing weight pruning processing on the general format model;
[0020] Quantizing the general format model after the weight pruning process so that the weights in the general format model are represented with reduced precision;
[0021] Distilling the quantized general format model to obtain a compressed model;
[0022] The calculation graph of the compression model is optimized to obtain the fault diagnosis model.
[0023] Optionally, before the quantization processing, the weight of the universal format model is a single-precision floating point number; the quantization processing of the universal format model after the weight pruning processing includes: converting the weight of the universal format model from a single-precision floating point number to a half-precision floating point number or an 8-bit integer.
[0024] Optionally, the distilling the quantized general format model to obtain a compression model includes:
[0025] The fault diagnosis model to be optimized is used as a teacher model, and the general format model after quantization is used as a student model;
[0026] Based on the teacher model, knowledge distillation learning is performed on the student model to obtain the compression model.
[0027] In a second aspect, the present application further provides a fault diagnosis method, the fault diagnosis method comprising:
[0028] Obtain real-time working data of smart cabinets;
[0029] Transmitting the real-time working data to the cloud server that deploys the fault diagnosis model using the model deployment method described in the first aspect;
[0030] The real-time working data is input into the fault diagnosis model to perform fault diagnosis and generate a fault diagnosis result.
[0031] In a third aspect, the present application further provides a model deployment system, the model deployment system comprising:
[0032] A historical working data acquisition module is used to acquire the historical working data of the smart cabinet;
[0033] A preprocessing module, used for preprocessing the historical working data;
[0034] An initial fault diagnosis model building module, used to build an initial fault diagnosis model;
[0035] The fault diagnosis model to be optimized is constructed by dividing the preprocessed historical working data into training set data, verification set data and test set data; training the initial fault diagnosis model based on the training set data; verifying and tuning the trained initial fault diagnosis model based on the verification set data; and testing the verified and tuned initial fault diagnosis model based on the test set data to obtain the fault diagnosis model to be optimized;
[0036] A compression optimization module, used for compressing and optimizing the fault diagnosis model to be optimized to obtain a fault diagnosis model;
[0037] Cloud servers;
[0038] A deployment tool is used to deploy the fault diagnosis module on the cloud server.
[0039] In a fourth aspect, the present application further provides a fault diagnosis system, the fault diagnosis system comprising:
[0040] A real-time working data acquisition module is used to acquire the real-time working data of the smart cabinet;
[0041] The cloud server of the fault diagnosis model is deployed using the model deployment method as described in the first aspect. The cloud server is used to receive the real-time working data and input the real-time working data into the fault diagnosis model. The fault diagnosis model performs fault diagnosis on the real-time working data and generates a fault diagnosis result.
[0042] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0043] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the methods described above are implemented.
[0044] In the above-mentioned model deployment method, fault diagnosis method, system, device and medium, historical working data of the smart cabinet is obtained; the historical working data is preprocessed; an initial fault diagnosis model is provided; the preprocessed historical working data is divided into training set data, verification set data and test set data; the initial fault diagnosis model is trained based on the training set data; the trained initial fault diagnosis model is verified and tuned based on the verification set data; the verified and tuned initial fault diagnosis model is tested based on the test set data to obtain the fault diagnosis model to be optimized; the fault diagnosis model to be optimized is compressed and optimized to obtain the fault diagnosis model; a cloud server is configured; and the fault diagnosis model is deployed on the cloud server. In the above-mentioned model deployment method, the training and deployment process of the fault diagnosis model can be greatly simplified, and manual intervention can be reduced. When the deployed fault diagnosis model is used for fault diagnosis of the smart cabinet, the accuracy and timeliness of the fault diagnosis can be improved, and the operation and maintenance efficiency of the smart cabinet can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of a model deployment method provided in one embodiment of the present application;
[0046] Figure 2 A schematic diagram of a flow chart of a fault diagnosis method provided in another embodiment of the present application;
[0047] Figure 3 A structural block diagram of a model deployment system provided in yet another embodiment of the present application;
[0048] Figure 4 A structural block diagram of a fault diagnosis system provided in another embodiment of the present application;
[0049] Figure 5 This is a diagram of the internal structure of a computer device in yet another embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] In one embodiment, see Figure 1 , the present application provides a model deployment method, and the model deployment method may include the following steps: S10~S16.
[0052] S10: Obtain historical working data of the smart cabinet.
[0053] S11: Preprocessing the historical working data.
[0054] S12: Provide an initial fault diagnosis model.
[0055] S13: Divide the preprocessed historical working data into training set data, verification set data and test set data; train the initial fault diagnosis model based on the training set data; verify and tune the trained initial fault diagnosis model based on the verification set data; test the verified and tuned initial fault diagnosis model based on the test set data to obtain the fault diagnosis model to be optimized.
[0056] S14: compressing and optimizing the fault diagnosis model to be optimized to obtain a fault diagnosis model.
[0057] S15: Configure the cloud server.
[0058] S16: Deploy the fault diagnosis model on the cloud server.
[0059] In step S10, refer to Figure 1 In step S10, historical working data of the smart cabinet is obtained.
[0060] As an example, the historical working data may include historical original working data of the smart cabinet in a normal working state and historical original working data of the smart cabinet in a fault state.
[0061] As an example, the historical working data may be collected from a historical database of the smart cabinet.
[0062] As an example, the historical working data can be collected and saved based on various sensors set in the smart cabinet. The historical working data can include but is not limited to at least one of temperature data, pressure data, vibration data and voltage data, and the corresponding operation log; the sensor can include a temperature sensor, a pressure sensor, a vibration sensor and a voltage sensor, etc.
[0063] Specifically, the data source of the historical working data may be the log system of the various sensors and the smart cabinet; the type of the historical working data may include the reading values of the various sensors and the corresponding operation events.
[0064] In step S11, refer to Figure 1 In step S11, the historical working data is preprocessed.
[0065] As an example, in step S11, the following steps may be included: S111 to S113.
[0066] S111: performing initial preprocessing on the historical working data, wherein the initial preprocessing includes: cleaning the historical working data; and marking faults based on the cleaned historical working data.
[0067] S112: Extract features from the historical working data after the initial preprocessing.
[0068] S113: Select the extracted features to obtain target features.
[0069] As an example, in step S111, during the cleaning of the historical working data, noise and outliers in the historical working data are removed to ensure the quality of the retained data. Specifically, the historical working data may be initially preprocessed using statistical methods and learning algorithms.
[0070] As an example, fault labeling based on cleaned historical working data may include: classifying and labeling the corresponding historical working data according to the fault type. Fault labeling can be completed by a professional data labeling team to ensure the accuracy and completeness of the labeling. Fault labeling may include: overheating, overvoltage, overload or short circuit, etc.
[0071] As an example, in step S112, data mining technology can be used to extract key features that can characterize the state of the smart cabinet from the historical working data processed in step S111; these features may include, but are not limited to: statistical features, time series features, and waveform features. The statistical features may include mean, variance, standard deviation, skewness, kurtosis, etc., and the statistical features are used to describe the data distribution. The time series features may include trends, periodicity, and autocorrelation functions, etc., and the time series features are used to capture the law of data changes over time. The waveform features may include the frequency components and energy distribution of the signal, etc., and the waveform features are used to analyze the waveform characteristics of the signal. In step S112, during the feature extraction process, features that help distinguish different fault types are extracted from the original data, and each feature obtained after extraction corresponds to an original historical working data.
[0072] As an example, in step S113, algorithms such as principal component analysis (PCA) or model-based feature selection methods (such as Lasso regression) can be used for feature selection to reduce the dimension of features while retaining the most valuable features for fault diagnosis, so as to obtain the features that contribute most to the subsequent fault diagnosis model. Step S113 helps to improve the training efficiency and prediction accuracy of the subsequent fault diagnosis model.
[0073] In step S12, refer to Figure 1 In step S12, an initial fault diagnosis model is provided.
[0074] As an example, a variety of learning algorithm models can be selected as the initial fault diagnosis model. For example, the initial fault diagnosis model can include at least one of a logistic regression model, a support vector machine (SVM) model, a random forest model, a gradient boosted decision tree (GBDT) model, and a neural network model.
[0075] In step S13, refer to Figure 1 In step S13, the preprocessed historical working data is divided into training set data, verification set data and test set data; the initial fault diagnosis model is trained based on the training set data; the trained initial fault diagnosis model is verified and tuned based on the verification set data; the verified and tuned initial fault diagnosis model is tested based on the test set data to obtain the fault diagnosis model to be optimized.
[0076] As an example, the proportion of the training set data, the validation set data and the test set data to the preprocessed historical working data can be adjusted according to actual conditions. For example, after division, 70% of the preprocessed historical working data is used as the training set data, 15% of the preprocessed historical working data is used as the validation set data, and 15% of the preprocessed historical working data is used as the test set data; that is, the training set data accounts for 70% of the preprocessed historical working data, the validation set data accounts for 15% of the preprocessed historical working data, and the test set data accounts for 15% of the preprocessed historical working data.
[0077] As an example, for each selected initial fault diagnosis model, a set of reasonable hyperparameters can be initialized, and the initial fault diagnosis model can be preliminarily trained using the training set data. During the training process, the loss function value of the model is monitored to ensure that the initial fault diagnosis model after training the training set converges.
[0078] As an example, it is possible but not limited to adopting methods such as grid search, random search or Bayesian optimization to optimize the hyperparameters of the initial fault diagnosis model after training based on the verification set data to achieve verification and tuning of the initial fault diagnosis model after training. The grid search is an exhaustive search method that tries all hyperparameter combinations and selects the combination with the best performance on the verification set data. The random search randomly selects hyperparameter combinations in the search space, which reduces the amount of calculation, but may miss the optimal solution.
[0079] As an example, techniques such as cross-validation can be used to evaluate the performance of the initial fault diagnosis model under different parameter combinations.
[0080] As an example, in the process of testing the initial fault diagnosis model after verification and tuning based on the test set data, the evaluation indicators may include: accuracy, recall, precision, F1 score, etc., and the performance of the initial fault diagnosis model is comprehensively evaluated based on the above evaluation indicators. According to the evaluation results on the verification set data, the initial fault diagnosis model with the best performance is selected as the final fault diagnosis model to be optimized.
[0081] In a specific embodiment, a logistic regression model is selected as the initial fault diagnosis model, and the logistic regression model is preliminarily trained using the training set data to obtain a basic model. On the validation set, the regularization parameters (such as C value) and learning rate of the logistic regression model are tuned by grid search. The model performance after parameter adjustment is evaluated, and it is found that when the C value is 1.0 and the learning rate is 0.01, the initial fault diagnosis model has the highest F1 score on the validation set. The logistic regression model under this parameter combination is finally selected as the optimal model (i.e., the fault diagnosis model to be optimized) for subsequent fault diagnosis tasks.
[0082] As an example, after step S13, the method may further include: exporting the fault diagnosis model to be optimized into a general format model, wherein the general format model includes a model structure, weights, and configuration information.
[0083] As an example, the trained fault diagnosis model to be optimized can be exported from the original framework (such as TensorFlow or PyTorch, etc.) to a general format model, such as TensorFlow's SavedModel, ONNX (Open Neural Network Exchange) format model, which is easy to deploy on different platforms and devices. The general format model stores the model structure, weights and configuration information of the fault diagnosis model to be optimized to ensure that the general format model can maintain its original prediction ability after export.
[0084] As an example, after exporting the universal format model, the method further includes: numbering and recording versions of the universal format model to facilitate tracking and management of the iteration process of the universal format model.
[0085] It should be noted that the general format model described in the subsequent steps is the fault diagnosis model to be optimized that is exported into a general format.
[0086] In step S14, refer to Figure 1 In step S14, the fault diagnosis model to be optimized is compressed and optimized to obtain a fault diagnosis model.
[0087] As an example, step S14 may include the following steps: S141 to S144.
[0088] S141: Perform weight pruning processing on the general format model.
[0089] S142: quantizing the general format model after the weight pruning process, so that the weights in the general format model are represented with reduced precision.
[0090] S143: performing distillation processing on the quantized general format model to obtain a compression model.
[0091] S144: Optimizing the calculation graph of the compression model to obtain the fault diagnosis model.
[0092] As an example, in step S141, by performing the weight pruning process on the general format model, unimportant weights in the general format model can be removed, reducing the complexity of the general format model, thereby reducing computing resource consumption.
[0093] As an example, in step S141, a gradient-based importance ranking method may be used to remove connections with smaller absolute weight values.
[0094] As an example, the weights of the general format model may be single-precision floating point numbers (eg, FP32) before quantization.
[0095] As an example, in step S142, during the process of quantizing the general format model after the weight pruning process, the weights in the general format model can be converted into low-precision representation to reduce the size of the general format model and improve computational efficiency.
[0096] Specifically, in step S142, the weight of the general format model may be converted from a single-precision floating point number to a half-precision floating point number (such as FP16) or an 8-bit integer (such as INT8).
[0097] As an example, step S143 may include the following steps: S1431 - S1432 .
[0098] S1431: The fault diagnosis model to be optimized is used as a teacher model, and the general format model after quantization is used as a student model.
[0099] S1432: Perform knowledge distillation learning on the student model based on the teacher model to obtain the compression model.
[0100] As an example, in step S1431, the fault diagnosis model to be optimized obtained in step S13 is used as the teacher model, the teacher model is used as the large model, and the student model is used as the small model.
[0101] As an example, in step S1432, the knowledge of the teacher model is used to train the student model to perform knowledge distillation learning on the student model. It is shown that the student model after distillation learning can simulate the predictive ability of the teacher model.
[0102] As an example, during the knowledge distillation learning process, the output of the teacher model can be used as a soft label to guide the training of the student model.
[0103] As an example, in step S144, after optimizing the computation graph of the compression model, redundant computation nodes may be eliminated and simplified computation steps may be merged.
[0104] As an example, in step S144, the step of automatically optimizing the computational graph of the compression model can be performed using, but is not limited to, a graph optimization tool (such as TensorFlow's GraphTransform Tool).
[0105] In a specific embodiment, the logistic regression model is still used as the initial fault diagnosis model, that is, the fault diagnosis model to be optimized is the logistic regression model after training. First, the fault diagnosis model to be optimized is exported to the SavedModel format; then, through weight pruning, the connections whose absolute values of weights are less than a preset threshold (such as 0.01) in the fault diagnosis model to be optimized in the SavedModel format are removed; then, the fault diagnosis model to be optimized after the weight pruning is quantized, and the weights of FP32 are converted to INT8 to reduce the size of the fault diagnosis model to be optimized and improve the reasoning speed; finally, the optimized fault model after quantization is distilled, and the fault diagnosis model to be optimized obtained in step S13 is used as the teacher model, and a small model with a simpler structure is trained based on the teacher model as the student model to ensure that the prediction performance of the student model is similar to or the same as the teacher model. After these optimization steps, the fault diagnosis model to be optimized is further compressed and accelerated, and is ready for deployment on a cloud server.
[0106] In step S15, refer to Figure 1 In step S15, configure the cloud server.
[0107] As an example, in order to ensure that the fault diagnosis model can run efficiently and stably, the configuration of the cloud server is crucial.
[0108] As an example, in step S15, configuring the cloud server may include the following steps: S151-S152.
[0109] S151: Select an instance type.
[0110] S152: Install the necessary operating environment.
[0111] As an example, in step S151, resource evaluation may be performed first, and then instance selection may be performed.
[0112] Specifically, resource evaluation may include: evaluating the required CPU (Central Processing Unit), GPU (Graphics Processing Unit), memory and other resources according to the requirements of the fault diagnosis model. Considering future scalability and load balancing, instances with appropriate redundant resources should be selected in the future.
[0113] Specifically, instance selection may include: selecting an instance type that meets resource requirements from the instance catalog of a cloud server provider (such as AWS, Azure, and Google Cloud); giving priority to GPU-accelerated instances for fault diagnosis models that require a large amount of parallel computing; and selecting lower-cost CPU instances for fault diagnosis models that do not require high computing.
[0114] As an example, in step S152, the operating system may be configured first, then dependencies may be installed, then the environment may be isolated, and finally the environment may be optimized.
[0115] Specifically, during the process of configuring the operating system, a stable operating system version can be selected, such as the Ubuntu LTS version. Configuring the operating system may include security settings, network configuration, storage mounting, etc. These steps are known to those skilled in the art and will not be repeated here.
[0116] Specifically, during the dependency installation process, the programming language environment required for the operation of the fault vibration model, such as Python or Java, etc., can be installed; and the necessary libraries and frameworks (such as TensorFlow, NumPy, Pandas, etc.) can be installed using a package management tool (such as pip or apt-get).
[0117] Specifically, during the environmental isolation process, container technology (such as Docker) can be used to create an isolated operating environment to ensure the consistency and portability of the fault diagnosis model deployment. Then, a Dockerfile can be written to define the container image building process, including base image selection, dependency installation, model file copying, etc.
[0118] Specifically, during the environment optimization process, the operating environment can be optimized according to the requirements of the fault diagnosis model, such as adjusting operating system parameters, adjusting network configuration, etc., to improve performance. Performance analysis tools (such as TensorFlow Profiler) can be used to monitor and optimize environmental performance.
[0119] In a specific implementation, first, according to the computing requirements of the fault diagnosis model, an instance with at least 4 CPU cores, 16GB of memory and an NVIDIA Tesla V100 GPU is evaluated; a p3.2*large instance that meets the requirements is selected on AWS. Next, the Ubuntu 18.04 LTS operating system is installed on the selected instance, and security reinforcement and network configuration are performed; TensorFlow, Keras and other necessary Python libraries are installed using pip. Then, a Dockerfile is written to build a Docker image containing the model file and all dependencies; after containerized deployment, the TensorFlow Profiler is used to monitor the performance of the operating environment of the fault diagnosis model; and environmental variables and system parameters such as TF_CPP_MIN_LOG_LEVEL and CUDA_VISIBLE_DEVICES are adjusted to optimize performance. Finally, ensure that the cloud server configuration meets the requirements for the operation of the fault diagnosis model, and provide a stable basic environment for the subsequent deployment of the fault diagnosis model and real-time fault diagnosis.
[0120] In step S16, refer to Figure 1 In step S16, the fault diagnosis model is deployed on the cloud server.
[0121] As an example, in order to enable the trained fault diagnosis model to serve the real-time fault diagnosis of smart cabinets, the key step is to deploy the fault diagnosis model as a remotely callable service and develop a corresponding API interface to realize real-time reception and processing of data.
[0122] As an example, in step S16, deploying the fault diagnosis model on the cloud server may include the following steps: S161-S162.
[0123] S161: Model deployment.
[0124] S162: API interface development.
[0125] As an example, in step S161, a deployment tool may be selected first, then a deployment process may be executed, and finally service configuration may be performed.
[0126] Specifically, in the process of selecting a deployment tool, you can select a suitable deployment tool according to the format and requirements of the fault diagnosis model. For example, for a TensorFlow model, you can select TensorFlow Serving; for an ONNX model, you can use ONNX Runtime.
[0127] Specifically, in the process of executing the deployment process, the model file of the exported fault diagnosis model can be first uploaded to the designated directory of the cloud server; then the model service is started using the deployment tool, listening to the preset port and waiting for requests.
[0128] Specifically, during the service configuration process, it is necessary to configure service parameters, such as concurrent processing capability, request timeout, etc., to meet the performance requirements in actual applications. After the service is configured, it is necessary to ensure that the service has sufficient resources, such as memory and computing units, to support the operation of the fault diagnosis model.
[0129] As an example, in step S162, interface design may be performed first, then interface implementation, and finally security processing may be performed.
[0130] Specifically, in the interface design process, you can define the input and output formats of the API interface; the input is usually sensor data, and the output is the fault diagnosis result. Design a RESTful API and specify the URL, request method (such as POST, GET), and JSON format of each interface.
[0131] Specifically, in the process of interface implementation, you can use a Web framework (such as Flask, FastAPI) to write API code and process HTTP requests. In the API processing logic, call the model service, take the sensor data as input, and return the model's diagnostic results to the client.
[0132] Specifically, during the security processing, the API interface can be authenticated and authorized to ensure that only authorized smart cabinets can send data requests. During the communication between the API interface and the smart cabinet, HTTPS encrypted communication can be used to protect the security of data transmission.
[0133] In one embodiment, the fault diagnosis model is deployed on a cloud server using TensorFlow Serving, and the service port is configured as 8501. A RESTful API is designed, in which the predictions interface accepts POST requests and expects the request body to contain sensor data in JSON format. The API code is written using the Flask framework, the received data is parsed, and the prediction interface provided by TensorFlow Serving is called. During the data transmission process, the API authentication and authorization is implemented through OAuth2.0, and HTTPS is used to ensure the security of data transmission.
[0134] In another embodiment, see Figure 2 The present application also provides a fault diagnosis method, which may include the following steps: S20~S22.
[0135] S20: Obtain real-time working data of the smart cabinet.
[0136] S21: The real-time working data is transmitted to the Figure 1 And the model deployment method described in the corresponding embodiment deploys the cloud server of the fault diagnosis model.
[0137] S22: Inputting the real-time working data into the fault diagnosis model to perform fault diagnosis and generate a fault diagnosis result.
[0138] In step S20, refer to Figure 2 In step S20, real-time working data of the smart cabinet is obtained.
[0139] As an example, the real-time operating data of the smart cabinet may be collected in the same manner as in step S10, and the real-time operating data may include but is not limited to at least one of temperature data, pressure data, vibration data and voltage data.
[0140] In step S21, refer to Figure 2 In step S21, the real-time working data is transmitted to the user using Figure 1 And the model deployment method described in the corresponding embodiment deploys the cloud server of the fault diagnosis model.
[0141] As an example, you can first obtain the Figure 1 The model deployment method described in the corresponding embodiment deploys the cloud server of the fault diagnosis model; then the smart cabinet transmits the real-time working data to the cloud server via a wireless network.
[0142] As an example, the API interface in the cloud server may be used to receive the real-time working data, and after receiving the real-time working data, the integrity and correctness of the real-time working data may be verified.
[0143] It should be noted that, before executing step S22, the real-time working data may be preprocessed, and the preprocessing method may include cleaning and feature extraction.
[0144] In step S22, refer to Figure 2 In step S22, the real-time working data is input into the fault diagnosis model for fault diagnosis, and a fault diagnosis result is generated.
[0145] As an example, the fault diagnosis result may include fault type, fault probability, and recommended operation, etc.
[0146] As an example, after the fault diagnosis result is generated, the fault diagnosis result may also be transmitted back to the smart cabinet.
[0147] In one embodiment, the smart cabinet obtains the real-time working data of the smart cabinet through the sensor in real time; the cloud server receives the real-time working data sent by the smart cabinet in real time, and transmits it to the fault diagnosis model for diagnosis through the API interface. The cloud server returns the diagnosis result, specifically, the API interface encapsulates the fault diagnosis result into JSON format and sends it back to the smart cabinet, thus realizing a closed loop of the entire real-time fault diagnosis process.
[0148] It should be understood that although Figure 1 and Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 and Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0149] In yet another embodiment, see Figure 3The present application also provides a model deployment system, which may include: a historical working data acquisition module 100, a preprocessing module 110, an initial fault diagnosis model construction module 120, a fault diagnosis model construction module to be optimized 130, a compression optimization module 140, a deployment tool 150 and a cloud server 160; wherein, the historical working data acquisition module 100 is used to acquire the historical working data of the smart cabinet; the preprocessing module 110 is used to preprocess the historical working data; the initial fault diagnosis model construction module 120 is used to construct an initial fault diagnosis model; the fault diagnosis model construction module to be optimized 130 is used to divide the preprocessed historical working data into training set data, verification set data and test set data; based on the training set data, the initial fault diagnosis model is trained; based on the verification set data, the trained initial fault diagnosis model is verified and tuned; based on the test set data, the verified and tuned initial fault diagnosis model is tested to obtain the fault diagnosis model to be optimized; the compression optimization module 140 is used to compress and optimize the fault diagnosis model to be optimized to obtain the fault diagnosis model; the cloud server 150; the deployment tool 160 is used to deploy the fault diagnosis module on the cloud server.
[0150] As an example, the model deployment system can be used to perform Figure 1 and the steps of the model deployment method described above; for the specific definition of the model deployment system, please refer to the definition of the model deployment method described above, which will not be repeated here. Each module in the above model deployment system can be implemented in whole or in part by software, hardware, and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0151] In yet another embodiment, see Figure 4 The present application also provides a fault diagnosis system, which may include: a real-time working data acquisition module 200 and a cloud server 160. The real-time working data acquisition module 200 is used to acquire the real-time working data of the smart cabinet. The cloud server 160 may be a computer system that adopts the following method: Figure 1 The cloud server 160 of the model deployment method described in the corresponding embodiment deploys the fault diagnosis model, the cloud server 160 is used to receive the real-time working data, and input the real-time working data into the fault diagnosis model, the fault diagnosis model performs fault diagnosis on the real-time working data, and generates a fault diagnosis result
[0152] As an example, the fault diagnosis system can be used to perform the following Figure 2And the steps of the fault diagnosis method as described above; for the specific definition of the fault diagnosis system, please refer to the definition of the fault diagnosis method in the above text, which will not be repeated here. Each module in the above fault diagnosis system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0153] In another embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as deployment strategies. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it is implemented as follows Figure 1 And the model deployment method described in the related embodiments or the implementation as follows Figure 2 And the fault diagnosis method described in the related embodiments.
[0154] In another embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it is implemented as follows Figure 1 And the model deployment method described in the related embodiments or the implementation as follows Figure 2 The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse.
[0155] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0156] In another embodiment, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following is implemented: Figure 1 The steps or implementations of the model deployment method described in the related embodiments are as follows: Figure 2 And the steps of the fault diagnosis method described in the relevant embodiments.
[0157] In another embodiment, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following Figure 1 The steps or implementations of the model deployment method described in the related embodiments are as follows: Figure 2 And the steps of the fault diagnosis method described in the relevant embodiments.
[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A model deployment method, characterized in that: include: Obtain historical working data of smart cabinets; Preprocessing the historical work data; Provide initial fault diagnosis model; The preprocessed historical working data is divided into training set data, verification set data and test set data; the initial fault diagnosis model is trained based on the training set data; and the trained initial fault diagnosis model is verified and tuned based on the verification set data; Testing the initial fault diagnosis model after verification and optimization based on the test set data to obtain a fault diagnosis model to be optimized; Performing compression optimization on the fault diagnosis model to be optimized to obtain a fault diagnosis model; Configure cloud servers; The fault diagnosis model is deployed on the cloud server.
2. The model deployment method according to claim 1, characterized in that: The historical working data includes the historical original working data of the smart cabinet in a normal working state and the historical original working data of the smart cabinet in a fault state; The preprocessing of the historical working data includes: Performing initial preprocessing on the historical working data, the initial preprocessing comprising: cleaning the historical working data; and marking faults based on the cleaned historical working data; Extracting features from the historical working data after the initial preprocessing; The extracted features are selected to obtain the target features.
3. The model deployment method according to claim 1, characterized in that: Before compressing and optimizing the fault diagnosis model to be optimized to obtain the fault diagnosis model, the method further includes: exporting the fault diagnosis model to be optimized into a general format model, wherein the general format model includes a model structure, weights, and configuration information; The compressing and optimizing the fault diagnosis model to be optimized to obtain the fault diagnosis model includes: Performing weight pruning processing on the general format model; Quantizing the general format model after the weight pruning process so that the weights in the general format model are represented with reduced precision; Distilling the quantized general format model to obtain a compressed model; The calculation graph of the compression model is optimized to obtain the fault diagnosis model.
4. The model deployment method according to claim 3, characterized in that: Before the quantization process, the weight of the universal format model is a single-precision floating point number; the quantization process of the universal format model after the weight pruning process includes: converting the weight of the universal format model from a single-precision floating point number to a half-precision floating point number or an 8-bit integer.
5. The model deployment method according to claim 3, characterized in that: The distillation process is performed on the quantized general format model to obtain a compression model, including: The fault diagnosis model to be optimized is used as a teacher model, and the general format model after quantization is used as a student model; Based on the teacher model, knowledge distillation learning is performed on the student model to obtain the compression model.
6. A fault diagnosis method, characterized in that: include: Obtain real-time working data of smart cabinets; Transmitting the real-time working data to the cloud server that deploys the fault diagnosis model using the model deployment method described in any one of claims 1 to 5; The real-time working data is input into the fault diagnosis model to perform fault diagnosis and generate a fault diagnosis result.
7. A model deployment system, characterized in that: The model deployment system comprises: A historical working data acquisition module is used to acquire the historical working data of the smart cabinet; A preprocessing module, used for preprocessing the historical working data; An initial fault diagnosis model building module, used to build an initial fault diagnosis model; The fault diagnosis model to be optimized is constructed by dividing the preprocessed historical working data into training set data, verification set data and test set data; training the initial fault diagnosis model based on the training set data; verifying and tuning the trained initial fault diagnosis model based on the verification set data; and testing the verified and tuned initial fault diagnosis model based on the test set data to obtain the fault diagnosis model to be optimized; A compression optimization module, used for compressing and optimizing the fault diagnosis model to be optimized to obtain a fault diagnosis model; Cloud servers; A deployment tool is used to deploy the fault diagnosis module on the cloud server.
8. A fault diagnosis system, characterized in that: The fault diagnosis system comprises: A real-time working data acquisition module is used to acquire the real-time working data of the smart cabinet; The cloud server of the fault diagnosis model is deployed using the model deployment method described in any one of claims 1 to 5, and the cloud server is used to receive the real-time working data and input the real-time working data into the fault diagnosis model. The fault diagnosis model performs fault diagnosis on the real-time working data and generates a fault diagnosis result.
9. A computer 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 method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Intelligent substation operation and maintenance method and system for cloud large model fault diagnosis and prediction
CN120951127A
