A method for monitoring and early warning algorithm cross-platform cross-language use

By encapsulating and deploying the BP algorithm model as a pmml file in the Spark environment, the problem of monitoring and early warning of Spark MLlib algorithms in complex production environments is solved, realizing efficient deployment of algorithm models across platforms and languages ​​and high-accuracy prediction.

CN117763298BActive Publication Date: 2026-11-27NORTH CHINA INSTITUTE OF SCIENCE & TECHNOLOGY (NATIONAL SAFETY TRAINING CENTER OF COAL MINES) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311556574.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-12-05
Filing Date
2023-11-21
Publication Date
2026-11-27
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

Existing Spark MLlib algorithms cannot meet the monitoring and early warning needs of complex production environments, especially in mining and landslide accident scenarios, where they cannot provide highly accurate predictions.

Method used

By collecting data from mine and landslide scenarios, preprocessing the data, and then training and testing it using multiple classification algorithms from the Spark MLlib library, the BP algorithm model was encapsulated into a pmml file and deployed in the Spark environment to enable cross-platform and cross-language use of the algorithm model. Finally, the BP algorithm model was selected as the best prediction algorithm for prediction.

Benefits of technology

It enables efficient deployment of algorithm models across different platforms and language environments, improving development efficiency and enhancing the accuracy and reliability of predictions in mining and landslide scenarios, while providing monitoring and early warning capabilities in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117763298B_ABST
    Figure CN117763298B_ABST
Patent Text Reader

Abstract

A kind of method for monitoring early warning algorithm cross-platform cross-language use, comprising: S1: each 100 data of mine, landslide scene is collected, and mine, landslide dataset is made;S2: mine, landslide dataset is divided into training set and test set;S3: select the multiple classification algorithms of Spark MLlib library to establish initial algorithm library, and train initial algorithm library by mine, landslide dataset;S4: in Python environment, BP algorithm model generates pmml file;S5: the BP algorithm model of generating pmml file is packaged and deployed to the initial algorithm library of Spark environment as final algorithm library;S6: mine, landslide scene is predicted by final algorithm library.This application can design the algorithm model of mine, landslide scene demand in other platform, through generating pmml file model, it is deployed in real development platform, and cross-platform cross-language prediction of mine, landslide is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of accident scene monitoring and early warning status, specifically a method for using monitoring and early warning algorithms across platforms and languages. Background Technology

[0002] Landslides and mine accidents cause enormous casualties and economic losses in all aspects. In recent years, the continuous development of technologies such as big data, deep learning, and neural network models, as well as the application of various monitoring and early warning algorithms, have led to a continuous improvement in the accuracy of accident and disaster prediction.

[0003] The world is currently in an information age, generating massive amounts of data daily. Therefore, selecting important and reliable data for monitoring potential safety hazards in the current production environment and predicting the probability of accidents in the current scenario through these key data points is crucial. In a sense, researching and establishing a big data monitoring and early warning algorithm library is necessary for monitoring and early warning of the production environment, and is of great significance to the safety and reliability of the scenario. Currently, to meet the needs of monitoring and early warning in the three stages of an accident scenario—before, during, and after—an emergency big data monitoring and early warning algorithm library has been designed. This library mainly consists of algorithms from the Spark MLlib library. However, existing algorithms in Spark MLlib are only suitable for simple testing and learning, and for some simple scenario examples, and cannot meet the needs of complex production environments. Summary of the Invention

[0004] To address the aforementioned issues, the purpose of this invention is to provide a method for cross-platform and cross-language use of monitoring and early warning algorithms, thereby resolving the problem that existing algorithms in Spark MLlib cannot meet the needs of complex production environments.

[0005] To achieve the above objectives, the technical means adopted by the present invention are as follows:

[0006] A method for using a monitoring and early warning algorithm across platforms and languages ​​includes the following steps:

[0007] S1: Collect 100 data points each from the two scenarios of mine and landslide, and create mine dataset and landslide dataset respectively. Preprocess the data in the mine dataset and landslide dataset.

[0008] S2: The mine dataset and the landslide dataset are split into 70 training sets and 30 test sets respectively.

[0009] S3: Select multiple classification algorithms from the Spark MLlib library to establish an initial algorithm library. In the local Spark environment, train and test each algorithm in the initial algorithm library using the mine dataset and the landslide dataset mentioned in step S2.

[0010] S4: In the Python environment, the BP algorithm model is encapsulated through Pipeline. The encapsulated BP algorithm model is trained and tested using the mine dataset and the landslide dataset, respectively, to obtain trained BP algorithm models for the two scenarios of mine and landslide. The xgboost_to_pmml method in the nyoka module is used to generate pmml files for the trained BP algorithm models for the two scenarios.

[0011] S5: Package the BP algorithm model that generates the pmml file and deploy it to the initial algorithm library in the Spark environment as the final algorithm library;

[0012] By using the API built into the BP algorithm model that generates .pmml files through native Spark calls, the model can be accessed for prediction in two scenarios: mines and landslides, thus enabling cross-platform use of the BP algorithm model. At the same time, the final algorithm library is compatible with the BP algorithm model written in Python and multiple classification algorithms in the Spark MLlib library written in Scala, realizing the use of cross-language algorithm models in the Spark environment.

[0013] S6: Predict the two scenarios of mine and landslide using the final algorithm library.

[0014] The specific content of step S6 is as follows:

[0015] S61: By comparing the accuracy and AUC values ​​of the algorithms in the final algorithm library, the optimal algorithm is selected as the best prediction algorithm;

[0016] S62: Use the trained best prediction algorithm to predict data in mine scenarios and landslide scenarios, and display the prediction results through a visualization platform.

[0017] Each data point in the mine dataset includes five data items: carbon monoxide concentration, dust concentration, methane concentration, temperature, and wind speed.

[0018] Each data point in the landslide dataset includes five data items: slope shape, slope gradient, slope aspect, slope height, and human factors. The human activity factor is set to 1 or 0. If there are human activities in the corresponding area, it is set to 1; if there are no human activities in the corresponding area, it is set to 0.

[0019] In step S3, the classification algorithms in the initial algorithm library include SVM algorithm and decision tree algorithm, both of which are derived from the Spark MLlib library.

[0020] In step S61, the optimal prediction algorithm is the BP algorithm model for generating PMML files.

[0021] The BP algorithm model has a learning rate of 0.5, 10,000 iterations, 8 intermediate layers, and a network target bias of 0.00001.

[0022] Specifically, in step S1, the preprocessing of the data in the mine dataset and the landslide dataset includes:

[0023] The order of 100 data points from the mine dataset and the landslide dataset is shuffled using the np.random.permutation operation. An attribute with the label "one" is added to each data point. The label of data with the status "nosafe" is set to 1, and the label of data with the status "safe" is set to 0.

[0024] Before creating the landslide dataset, it is necessary to subtract the corresponding initially set thresholds from the slope shape, slope gradient, slope aspect, and slope height of each data point in the collected landslide scene, and then combine the data into a landslide dataset.

[0025] In the xgboost_to_pmml method of the nyoka module, two parameters are set: feature and target. Feature represents the specific data item of each data point in the two scenarios of mine and landslide, and target represents the target state of the data.

[0026] The beneficial effects of this invention are:

[0027] This invention allows us to design algorithm models for mining and landslide scenarios on other platforms. By generating .pmml file models, we can deploy them on our actual development platform, input data, and perform predictions. The final result meets the requirements of the production environment. This invention, while achieving cross-platform and cross-language compatibility, not only fulfills the development objective and improves development efficiency, but also provides examples for future accident scenario prediction algorithms, and is of great significance to the safety and reliability of scenario prediction. Attached Figure Description

[0028] Figure 1 : A schematic diagram of the structure of the present invention;

[0029] Figure 2 : Mine safety status prediction results diagram;

[0030] Figure 3 : Landslide safety status prediction results diagram. Detailed Implementation

[0031] like Figure 1 As shown, a method for cross-platform and cross-language use of a monitoring and early warning algorithm according to the present invention includes the following steps:

[0032] S1: Collect 100 data points each from the two scenarios of mine and landslide, and create mine dataset and landslide dataset respectively. Preprocess the data in the mine dataset and landslide dataset.

[0033] S2: The mine dataset and the landslide dataset are split into 70 training sets and 30 test sets respectively.

[0034] S3: Select multiple classification algorithms from the Spark MLlib library to establish an initial algorithm library. In the local Spark environment, train and test each algorithm in the initial algorithm library using the mine dataset and the landslide dataset mentioned in step S2.

[0035] S4: In the Python environment, the BP algorithm model is encapsulated through Pipeline. The encapsulated BP algorithm model is trained and tested using the mine dataset and the landslide dataset, respectively, to obtain trained BP algorithm models for the two scenarios of mine and landslide. The xgboost_to_pmml method in the nyoka module is used to generate pmml files for the trained BP algorithm models for the two scenarios.

[0036] S5: Package the BP algorithm model that generates the pmml file and deploy it to the initial algorithm library in the Spark environment as the final algorithm library. That is, the final algorithm library includes the classification algorithm of the initial algorithm library and the BP algorithm model that generates the pmml file.

[0037] By using the API built into the BP algorithm model that generates .pmml files through native Spark calls, the model can be accessed for prediction in two scenarios: mines and landslides, thus enabling cross-platform use of the BP algorithm model. At the same time, the final algorithm library is compatible with the BP algorithm model written in Python and multiple classification algorithms in the Spark MLlib library written in Scala, realizing the use of cross-language algorithm models in the Spark environment.

[0038] S6: Predict the two scenarios of mine collapse and landslide using the final algorithm library. The specific content of step S6 is as follows:

[0039] S61: By comparing the accuracy and AUC values ​​of the algorithms in the final algorithm library, the optimal algorithm is selected as the best prediction algorithm;

[0040] S62: Use the trained best prediction algorithm to predict data in mine scenarios and landslide scenarios, and display the prediction results through a visualization platform.

[0041] The following is a detailed explanation of each step:

[0042] In step S1, each data point in the mine dataset includes five data items: carbon monoxide concentration, dust concentration, gas concentration, temperature, and wind speed. Each data point in the landslide dataset includes five data items: slope shape, slope gradient, slope aspect, slope height, and human factors (i.e., whether there are human factors in the corresponding area). The human activity factor is set to 1 or 0. If there are human activity factors in the corresponding area, it is set to 1; if there are no human activity factors in the corresponding area, it is set to 0.

[0043] In step S1, the specific content of preprocessing the data in the mine dataset and the landslide dataset includes: shuffling the order of 100 data entries in the mine dataset and the landslide dataset respectively using the np.random.permutation operation, adding an attribute with the label "one" to each data entry, setting the label of data with the status "nosafe" to 1, and setting the label of data with the status "safe" to 0.

[0044] In addition, before creating the landslide dataset, it is necessary to subtract the corresponding initial threshold from the slope shape, slope, slope aspect, and slope height of each data point in the collected landslide scene, and then combine the data into a landslide dataset.

[0045] In step S3, the initial algorithm library includes classification algorithms such as SVM and decision tree algorithms, both of which are derived from the Spark MLlib library. The BP algorithm model has a learning rate of 0.5, 10,000 iterations, 8 intermediate layers, and a network target bias of 0.00001.

[0046] In PMMLpmml, the xgboost_to_pmml method in the nyoka module is called, which sets two parameters: feature and target. Feature represents the specific data item of each data point in the two scenarios of mine and landslide, and target represents the target state of the data.

[0047] The code that calls the xgboost_to_pmml method in the nyoka module can be represented by the following code:

[0048]

[0049] In this example, during step S1, when creating the mine dataset and landslide dataset, threshold processing is also required for the data items in the landslide scenario and the mine scenario. Specifically, thresholds are set for landslide and mine monitoring, serving as indicators of whether a risk exists. This threshold setting also allows for real-time monitoring of relevant data items in the mine and landslide scenarios, and a preliminary assessment of the risk based on the corresponding thresholds. The thresholds for factors causing mine accidents are set as follows: CO concentration... The concentration of methane was 12.5%. The concentration was 5.3%, the temperature (θ) was 26℃, and the dust concentration (ρ) was... DW ) is 20mg / m 3 and wind speed (V) DW The velocity is 4 m / s. The threshold values ​​for landslides are: slope (PD) of 30°, aspect (P) of 4 m / s. X The slope angle (PG) is 135°, the slope aspect (PX) is 150m, and the initial value for slope shape (PX) is 1. Human factors are set to either 1 or 0, where 1 indicates human activity in the area and 0 indicates no human activity. Before creating the landslide dataset, the slope shape, slope angle, slope aspect, and slope height in each collected landslide scene data point need to be subtracted from the corresponding initially set thresholds. Then, the data is compiled into a landslide dataset. In the slope shape processing, the collected value is subtracted from the initially set threshold of 1; a negative value indicates a concave slope, and a positive value indicates a convex slope.

[0050] The meaning of AUC in step S61 is:

[0051] The meaning of AUC value: AUC is used to determine the quality of a classifier (prediction model). Its classification criteria can include: ① AUC = 1, the classifier is a perfect classifier; ② AUC = [0.85, 0.95], the classifier performs well; ③ AUC = [0.7, 0.85], the classifier is generally passable; ④ AUC = [0.5, 0.7], the prediction effect is low; ⑤ AUC <= 0.5, the model has no predictive value.

[0052] The following detailed description uses specific examples to illustrate the invention:

[0053] As shown in Tables 1 and 2, in step S1, 100 data points were collected from each of the two scenarios, namely, a mine and a landslide, and these were made into a mine dataset and a landslide dataset, respectively. The mine dataset and the landslide dataset were then divided into a training set of 70 data points and a test set of 30 data points.

[0054] Table 1 Mine Dataset

[0055]

[0056] Table 2 Landslide Dataset

[0057] serial number PX PD / ° Px / ° PG / m R state 1 0.1225 0.0982 0.2717 0.3674 1 nosafe 2 0.1916 0.2021 0.8095 0.4605 1 nosafe 3 0.0635 0.2286 0.3745 0.2465 1 nosafe 4 0.2069 0.3273 0.0448 0.1349 1 nosafe 5 -0.0278 -0.3004 -0.0775 -0.1535 0 safe ... ... ... ... ... ... ... 96 -0.4215 0.0863 -0.3795 -0.3023 0 safe 97 0.1852 0.5758 0.5545 0.1907 1 nosafe 98 -0.2532 -0.1566 -0.1781 -0.693 0 safe 99 -0.2677 -0.4386 -0.0163 -0.6465 0 safe 100 0.2041 0.041 0.2836 0.3581 1 nosafe

[0058] In steps S3 and S4, the existing classification algorithms in the Spark MLlib library are only suitable for simple test learning and some simple scenario examples, and cannot meet the needs of the current complex production environment. To improve the practicality of the algorithm library and the diversity of algorithm types, this invention introduces a BP algorithm model to generate PMML files in step S4. Through cross-platform and cross-language technology, the production model is integrated into the production environment platform. PMML, as a predictive model markup language, is itself a model that can be called across platforms and also supports multiple open-source languages. This invention mainly focuses on cross-software platform integration, encapsulating the algorithm model in PyCharm (a software for writing Python code) into an interface and integrating it into IntelliJ IDEA for practical operation. In this example, the `xgboost_to_pmml` method in the `nyoka` module is called. This method sets two parameters: `feature` and `target`. `feature` represents the specific data items in the scenario, such as carbon monoxide concentration, methane concentration, dust concentration, temperature, and wind speed in a mine. `target` is the final target state. Finally, a file model with the .pmml extension is generated. Simultaneously, the appropriate calling version is configured in the local Spark environment, and the file model is stored in the project. The model is called using the `model` function, and its built-in `predict` function, inputting map-type data, enables monitoring and early warning effects. See the following code for details. The code below shows the prediction of one data point from a mining scenario. The prediction results are shown below. Figure 2 Prediction results diagram:

[0059]

[0060] The following code is for predicting one of the data points in a landslide scenario. The prediction result can be found in the reference below. Figure 3 Prediction results diagram:

[0061]

[0062] In steps S2, S3, and S4, the present invention segments the collected data into 70 training sets and 30 test sets. The two datasets are then input into the SVM algorithm, decision tree algorithm, and BP algorithm model that generates PMML files in the final algorithm library to predict scene accidents. Finally, the prediction accuracy and AUC value of different algorithms are output.

[0063] As shown in Table 3, through a comparative analysis of the prediction accuracy and AUC values ​​of SVM, decision tree, and BP neural network models in the final algorithm library, under the same training and test sets, the average prediction accuracy of SVM is between 80% and 92%, the average prediction accuracy of decision tree is between 86% and 93%, and the accuracy of the BP neural network model exceeds 96%. However, the AUC values ​​of SVM and decision tree are not entirely within the range of [0.9, 1], while the AUC value of the BP neural network model is between [0.96, 1]. Therefore, SVM and decision tree are not considered excellent classifiers for these two scenarios.

[0064] Therefore, this invention ultimately selected the BP algorithm for generating pmml models as the best prediction algorithm for both scenarios. This not only enriches the algorithm library by achieving cross-platform and cross-language compatibility, but also accurately predicts and outputs the probability of different scenario states, achieving true monitoring and early warning.

[0065] Table 3 compares the prediction performance of SVM, decision tree classification algorithm, and BP neural network algorithm for generating PMML files for accident scenarios.

[0066]

[0067] The above comparison demonstrates that we can design algorithm models for specific scenarios on other platforms, generate .pmml file models, deploy them on our actual development platform, input data for prediction, and ultimately achieve the desired results for the production environment. This not only fulfills the development objective and improves development efficiency while achieving cross-platform and cross-language compatibility, but also provides a good example for future accident scenario prediction algorithms. Furthermore, it proves that the BP algorithm model in the algorithm library is the most accurate for predicting and classifying mine and landslide scenarios. Therefore, further optimization of the algorithm can be implemented to predict multiple scenarios.

[0068] In this example, the specific process for implementing the BP algorithm model across platforms and languages ​​is as follows:

[0069] (1) First, you need to import the corresponding pmml dependency for Spark 2.12 into pom.xml. As shown in the following code:

[0070]

[0071]

[0072] (2) The generated pmml file contains the data items to be entered, as well as other relevant information, as shown in the following code (the following code only shows the data dictionary part):

[0073]

[0074] (3) The imported pmml dependency contains a model file package, which includes an abstract class Model.class. This abstract class contains many interfaces (e.g., predict, fromfile). In the following code, it is equivalent to creating a model_co object, which is then used to call the corresponding interface to perform prediction. As shown in the following code:

[0075] package org.pmml4s.model

[0076] abstract class Model()extends scala.AnyRef with

[0077] org.pmml4s.common.HasParent with org.pmml4s.common.HasVersion with

[0078] org.pmml4s.common.HasWrappedModelAtt

[0079] Lazy val inputNames: scala.Array[_root_.scala.Predef.String]={ / *compiled code* / }

[0080] Lazy val inputFields: scala.Array[org.pmml4s.metadata.Field]={ / *compiled code* / }

[0081] Lazy val inputDerivedFields: scala.Array[org.pmml4s.metadata.Field]={ / *compiled code* / }

[0082] Lazy val implicitInputDerivedFields: scala.Array[org.pmml4s.metadata.Field]={ / *compiled code* / }

[0083] Lazy val targetNames:scala.Array[_root_.scala.Predef.String]={ / *compiled code* / }

[0084] Lazy val targetFields:scala.Array[org.pmml4s.metadata.Field]={ / *compiled code* / }

[0085] Lazy val targetField:org.pmml4s.metadata.Field={ / *compiled code* / }def fieldsOfusageType(typ:org.pmml4s.metadata.UsageType.UsageType):scala.Array[org.pmml4s.metadata.Field]={ / *compiled code* / }

[0086] Lazy val opType:org.pmml4s.common.OpType={ / *compiled code* / }

[0087] def opType(name:_root_.scala.Predef.String):

[0088] org.pmml4s.common.OpType={ / *compiled code* / }

[0089] Lazy val classes:scala.Array[scala.Any]={ / *compiled code* / }

[0090] def inferclasses:scala.Array[scala.Any]={ / *compiled code* / }

[0091] Lazy val numclasses:scala.Int={ / *compiled code* / }

[0092] Lazy val targetclasses:_root_.scala.Predef.Map[_root_.scala.Predef.String,scala.Array[scala.Any]]={ / *compiled code* / }

[0093] Lazy val inputSchema:org.pmml4s.common.StructType={ / *compiledcode* / }

[0094] def candidateOutputSchema:org.pmml4s.common.StructType={ / *compiledcode* / }

[0095] def outputSchema:org.pmml4s.common.StructType={ / *compiled code* / }

[0096] def classes(name:_root_.scala.Predef.String):scala.Array[scala.Any]={ / *compiled code* / }

[0097] def numClasses(name:_root_.scala.Predef.String):scala.Int={ / *compiled code* / }

[0098] override def isClassification:scala.Boolean={ / *compiled code* / }

[0099] def isClassification(name:_root_.scala.Predef.String):scala.Boolean={ / *compiled code* / }

[0100] override def isRegression:scala.Boolean={ / *compiled code* / }

[0101] def isRegression(name:_root_.scala.Predef.String):scala.Boolean={ / *compiled code* / }

[0102] def isBinary:scala.Boolean={ / *compiled code* / }

[0103] def isOrdinal:scala.Boolean={ / *compiled code* / }

[0104] def importances:_root_.scala.Predef.Map[_root_.scala.Predef.String,

[0105] scala.Double]={ / *compiled code* / }

[0106] def header:org.pmml4s.common.Header={ / *compiled code* / }

[0107] def dataDictionary:org.pmml4s.metadata.DataDictionary={ / *compiledcode* / }

[0108] def transformationDictionary:scala.Option[org.pmml4s.transformations.Tr

[0109] ansformationDictionary]={ / *compiled code* / }

[0110] def modelElement:org.pmml4s.model.ModelElement

[0111] def predict(values:_root_.scala.Predef.Map[_root_.scala.Predef.String,

[0112] scala.Any]):_root_.scala.Predef.Map[_root_.scala.Predef.String,scala.Any]

[0113] .

[0114] In step S62, the specific operations involved in using the trained optimal prediction algorithm to predict data from both the mine scene and the landslide scene, and then displaying the prediction results through a visualization platform, are as follows:

[0115] Input: Build a visualization platform, read the data to be monitored from files with the .csv extension, display the data on the front-end interface using Echarts, and read the prediction results into the front-end as JSON strings, outputting the prediction results in a visual form.

[0116] Output: pie chart, probability graph, line chart, etc.

[0117] The final prediction is shown as follows Figure 2 , Figure 3 As shown.

[0118] The above description is merely a preferred embodiment of the present invention and is intended to aid in understanding the method and core concept of this application. The scope of protection of the present invention is not limited to the above examples; all technical solutions falling within the scope of the present invention's concept are within its protection. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for using a monitoring and early warning algorithm across platforms and languages, characterized in that, Includes the following steps: S1: Collect 100 data points each from the two scenarios of mine and landslide, and create mine dataset and landslide dataset respectively. Preprocess the data in the mine dataset and landslide dataset. S2: The mine dataset and the landslide dataset are split into 70 training sets and 30 test sets respectively. S3: Select multiple classification algorithms from the Spark MLlib library to establish an initial algorithm library. In the local Spark environment, train and test each algorithm in the initial algorithm library using the mine dataset and the landslide dataset mentioned in step S2. The classification algorithms in the initial algorithm library include SVM algorithm and decision tree algorithm, both of which are from the Spark MLlib library. S4: In the Python environment, the BP algorithm model is encapsulated through Pipeline. The encapsulated BP algorithm model is trained and tested using the mine dataset and the landslide dataset, respectively, to obtain trained BP algorithm models for the two scenarios of mine and landslide. The xgboost_to_pmml method in the nyoka module is used to generate pmml files for the trained BP algorithm models for the two scenarios. S5: Package the BP algorithm model that generates the pmml file and deploy it to the initial algorithm library in the Spark environment as the final algorithm library; By using the API built into the BP algorithm model that generates .pmml files through native Spark calls, the model can be accessed for prediction in two scenarios: mines and landslides, thus enabling cross-platform use of the BP algorithm model. At the same time, the final algorithm library is compatible with the BP algorithm model written in Python and multiple classification algorithms in the Spark MLlib library written in Scala, realizing the use of cross-language algorithm models in the Spark environment. S6: Predict the two scenarios of mine and landslide using the final algorithm library: S61: By comparing the accuracy and AUC values ​​of the algorithms in the final algorithm library, the optimal algorithm is selected as the best prediction algorithm; S62: Use the trained best prediction algorithm to predict data in mine scenarios and landslide scenarios, and display the prediction results through a visualization platform.

2. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 1, characterized in that, Each data point in the mine dataset includes five data items: carbon monoxide concentration, dust concentration, methane concentration, temperature, and wind speed. Each data point in the landslide dataset includes five data items: slope shape, slope gradient, slope aspect, slope height, and human factors. The human activity factor is set to 1 or 0. If there are human activities in the corresponding area, it is set to 1; if there are no human activities in the corresponding area, it is set to 0.

3. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 1, characterized in that, In step S61, the optimal prediction algorithm is the BP algorithm model for generating PMML files.

4. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 1, characterized in that, The BP algorithm model has a learning rate of 0.5, 10,000 iterations, 8 intermediate layers, and a network target bias of 0.00001.

5. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 1, characterized in that, In step S1, the specific content of preprocessing the data in the mine dataset and landslide dataset includes: The order of 100 data points from the mine dataset and the landslide dataset is shuffled using the np.random.permutation operation. An attribute with the label "one" is added to each data point. The label of data with the status "nosafe" is set to 1, and the label of data with the status "safe" is set to 0.

6. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 2, characterized in that, Before creating the landslide dataset, the slope shape, slope gradient, slope aspect, and slope height of each data point in the collected landslide scene need to be subtracted from the corresponding initially set thresholds before the data can be compiled into a landslide dataset.

7. The method for cross-platform and cross-language use of the monitoring and early warning algorithm according to claim 1, characterized in that, In the xgboost_to_pmml method of the nyoka module, two parameters are set: feature and target. Feature represents the specific data item of each data point in the two scenarios of mine and landslide, and target represents the target state of the data.

Citation Information

Patent Citations

  • Underground pipeline leakage description method and device based on cross-language image change description

    CN113239886A

  • Mining area environment safety early warning method based on BP neural network

    CN114417729A