Data processing method and device, nonvolatile storage medium and electronic equipment

By acquiring characteristic data of gas pipelines and using a random forest model to analyze risks, generating alarm messages and verifying behavioral sequences, the problem of unpredictable dangers in gas safety inspections is solved, improving response capabilities and safety.

CN121009435APending Publication Date: 2025-11-25CHINA TELECOM CORP LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511116144.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

The existing gas safety inspection process cannot effectively predict gas hazards, resulting in insufficient response capabilities.

Method used

By acquiring characteristic data on temperature, pressure, carbon monoxide concentration, and smoke concentration of gas pipelines from the database, the risk probability value is analyzed using a random forest model, alarm messages are generated, and the similarity between the actual behavior sequence and the preset standard behavior sequence is verified to determine the safety risk status.

Benefits of technology

It enables the prediction and verification of gas hazards, improves the ability to respond to gas safety issues, reduces false alarms and missed alarms, and ensures the safety of gas facilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009435A_ABST
    Figure CN121009435A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a nonvolatile storage medium and electronic equipment. The method comprises the following steps: acquiring a feature set; analyzing the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determining a security risk state of the target environment according to the risk probability value; when the security risk state indicates that the target environment has the security risk, generating an alarm message, and sending the alarm message to the target object; receiving an actual behavior sequence and detection data of the gas maintenance personnel, and determining the similarity between the actual behavior sequence and a preset standard behavior sequence; and under the condition that the similarity is greater than a target threshold value, comparing the detection data with a preset standard range, and verifying the security risk state according to a comparison result. According to the method and the device, the technical problem that the capability of coping with the fuel gas safety problem is limited due to the fact that the fuel gas danger cannot be predicted in the related fuel gas safety investigation process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of public safety, in particular, relates to a data processing method and device, a nonvolatile storage medium and an electronic device. BACKGROUND

[0002] The rapid development of gas provides high-quality energy for industrial production and people's life, not only greatly improves the level of industrial production, but also facilitates the people's life, and significantly reduces environmental pollution and improves the urban environmental quality. However, due to the flammable, explosive and toxic characteristics of gas, once an accident occurs, it will cause casualties and property losses. With the rapid increase of urban gas facilities, gas safety problems have become increasingly prominent.

[0003] Figure 1 is a schematic diagram of the gas safety inspection process of the related art, which specifically includes the following steps:

[0004] 1. Formulate an inspection plan: Before starting the inspection, the gas use situation of the inspection area needs to be understood, including the gas source, use equipment, etc., and a detailed inspection plan is formulated, including the time, place, personnel arrangement, etc.

[0005] 2. Manual inspection: The inspection tool contains gas temperature monitoring, gas pressure monitoring, carbon monoxide concentration monitoring and smoke monitoring devices;

[0006] 3. Through the data transmission system, the monitoring data is transmitted into the terminal;

[0007] 4. The terminal processing system analyzes the monitoring data to determine whether each data exceeds the specified threshold, and if it exceeds, it is determined that there is a danger, and an alarm is immediately given;

[0008] 5. The alarm signal is transmitted to the control system, and the electric switch of the dangerous area is cut off;

[0009] 6. The gas management department supervises the rectification according to the report submitted by the inspection group, the hidden danger and problem list;

[0010] 7. According to the relevant legal regulations, industry regulations and historical inspection data, regular re-examination is organized.

[0011] However, the above safety inspection process has problems and deficiencies such as difficulty in formulating an inspection plan, dependence of manual inspection results on the experience of operating personnel, difficulty in predicting and preventing dangers in advance.

[0012] At present, no effective solution has been proposed for the above problems. SUMMARY

[0013] The application provides a data processing method and device, a nonvolatile storage medium and an electronic device to at least solve the technical problem of limiting the response capability to gas safety problems due to the inability to predict gas risks in related gas safety investigation processes.

[0014] According to an aspect of the application, a data processing method is provided, including: obtaining a feature set in a database, wherein the feature set includes: gas temperature and gas pressure in a gas pipeline, carbon monoxide concentration and smoke concentration of a target environment where the gas pipeline is located; using a random forest model to analyze the feature set to obtain a risk probability value corresponding to the feature set, and determining a safety risk state of the target environment according to the risk probability value; in the case that the safety risk state indicates that there is a safety risk in the target environment, generating an alarm message and sending the alarm message to a target object; receiving an actual behavior sequence and detection data of a gas maintenance personnel sent by the target object in response to the alarm message, and determining a similarity between the actual behavior sequence and a preset standard behavior sequence; in the case that the similarity is greater than a target threshold, comparing the detection data with a preset standard range, and verifying the safety risk state according to a comparison result.

[0015] Optionally, the random forest model is obtained by the following method: obtaining a historical data set, wherein the historical data set includes a plurality of target features and safety risk labels corresponding to target combinations formed by different target features, the safety risk label is a binary label, and is used to indicate whether there is a safety risk; the target features include: gas temperature values, gas pressure values, carbon monoxide concentration values and smoke concentration values at historical time points; preprocessing the historical data set to generate a preprocessed historical data set, wherein the preprocessing includes: missing value filling, abnormal value processing and data standardization; generating a plurality of training subsets in the preprocessed historical data set by a bootstrap sampling method; for each training subset, starting from a root node, calculating information gain of all features in a current node; selecting a feature with the maximum information gain as a split feature; repeating the above split process until a preset stop condition is met to generate a decision tree corresponding to each training subset; and aggregating the decision trees corresponding to each training subset to obtain the random forest model.

[0016] Optionally, the similarity between the actual behavior sequence and the preset standard behavior sequence is determined by: constructing a two-dimensional distance comparison table based on the actual behavior sequence and the preset standard behavior sequence, wherein the total number of rows in the two-dimensional distance comparison table is equal to the total number of data points in the actual behavior sequence, the total number of columns is equal to the total number of data points in the preset standard behavior sequence, and each cell stores the absolute difference between the two data points corresponding to the row and column positions; creating an accumulated value table with the same dimensions as the two-dimensional distance comparison table, wherein the value of the top-left cell in the accumulated value table is equal to the value of the same position in the two-dimensional distance comparison table, the value of the first row cell is the sum of the accumulated value of the left cell and the value of the current cell in the two-dimensional distance comparison table, and the value of the first column cell is the sum of the accumulated value of the cell above and the value of the current cell in the two-dimensional distance comparison table; performing the following steps in the accumulated value table in the order from left to right and from top to bottom to obtain a target accumulated value table: selecting the values of the three adjacent cells of the current cell in the accumulated value table, i.e. the top-left, top and left cells, and determining the minimum value among the three values, and adding the value of the same position in the two-dimensional distance comparison table to the minimum value as the accumulated value of the current cell; extracting the final accumulated value of the bottom-right cell in the target accumulated value table, dividing the final accumulated value by the sum of the actual behavior sequence and the preset standard behavior sequence to obtain a standardized difference value; and mapping the standardized difference value to a similarity score through a conversion function.

[0017] Optionally, the method further comprises: in the case where the similarity is not greater than the target threshold, determining a historical feature set with the greatest similarity to the feature set in the database; determining a risk label corresponding to the historical feature set, and in the case where the risk label indicates that there is a security risk, sending a control instruction to the gas control system, wherein the gas control system is configured to respond to the control instruction to perform a shut-off process on the valve of the gas pipeline.

[0018] Optionally, determining the security risk state of the target environment according to the risk probability value comprises: in the case where the risk probability value is greater than or equal to a first threshold, determining that the target environment has a security risk, and in the case where the risk probability value is less than the first threshold, determining that the target environment does not have a security risk; after verifying the security risk state according to the comparison result, the method further comprises: in a preset time window, counting a first occurrence number of false alarm events, wherein a false alarm event is an event in which the security risk state indicates that the target environment has a security risk and the security risk state fails to pass the verification; in the preset time window, counting a second occurrence number of missed alarm events, wherein a missed alarm event is an event in which a security risk actually occurs and the risk probability value is less than the first threshold; and adjusting the first threshold according to the first occurrence number and the second occurrence number.

[0019] Optionally, the first threshold is adjusted according to the first occurrence number and the second occurrence number, including: in a case where the second occurrence number is zero and the first occurrence number is greater than zero, determining a first adjustment amount according to a formula: δ=0.01×(A / m), where δ is the adjustment amount, A is the first occurrence number, and m is a positive integer determined according to the length of the preset time window; in a case where the first occurrence number is zero and the second occurrence number is greater than zero, determining a second adjustment amount according to a formula: δ=-0.03×B, where B is the second occurrence number; and adjusting the first threshold based on the first adjustment amount or the second adjustment amount.

[0020] Optionally, the detection data includes a detection temperature value, a detection pressure value, a detection carbon monoxide concentration value, and a detection smoke concentration value; and the safety risk state is verified according to the comparison result, including: judging whether the detection temperature value is within a first preset range, whether the detection pressure value is within a second preset range, whether the detection carbon monoxide concentration value is within a third preset range, and whether the detection smoke concentration value is within a fourth preset range; and in a case where the detection temperature value is not within the first preset range and / or the detection pressure value is not within the second preset range and / or the detection carbon monoxide concentration value is not within the third preset range and / or the detection smoke concentration value is not within the fourth preset range, it is determined that the safety risk state passes the verification.

[0021] According to still another aspect of the present application, a data processing apparatus is also provided, including: an acquisition module, configured to acquire a feature set in a database, where the feature set includes: a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment where the gas pipeline is located; a first determination module, configured to analyze the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determine a safety risk state of the target environment according to the risk probability value; a sending module, configured to generate an alarm message in a case where the safety risk state indicates that the target environment has a safety risk, and send the alarm message to a target object; a second determination module, configured to receive an actual behavior sequence of a gas maintenance personnel and detection data sent by the target object in response to the alarm message, and determine a similarity between the actual behavior sequence and a preset standard behavior sequence; and a third determination module, configured to compare the detection data with a preset standard range in a case where the similarity is greater than a target threshold, and verify the safety risk state according to a comparison result.

[0022] According to still another aspect of the present application, a non-volatile storage medium is also provided, including a stored program, where the program controls a device where the storage medium is located to execute the above data processing method when running.

[0023] According to still another aspect of the present application, an electronic device is also provided, comprising a memory and a processor, the processor being configured to execute a program stored in the memory, wherein the program, when executed, implements the above data processing method.

[0024] According to still another aspect of the present application, a computer program is also provided, wherein the computer program, when executed by a processor, implements the above data processing method.

[0025] According to still another aspect of the present application, a computer program product is also provided, comprising a non-volatile computer readable storage medium, wherein the non-volatile computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the above data processing method.

[0026] In the present application, a feature set is obtained in a database, wherein the feature set comprises a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment where the gas pipeline is located; a random forest model is used to analyze the feature set to obtain a risk probability value corresponding to the feature set, and a safety risk state of the target environment is determined according to the risk probability value; in a case where the safety risk state indicates that the target environment has a safety risk, an alarm message is generated and sent to a target object; an actual behavior sequence of a gas maintenance personnel sent by the target object in response to the alarm message and detection data are received, and a similarity between the actual behavior sequence and a preset standard behavior sequence is determined; in a case where the similarity is greater than a target threshold, the detection data are compared with a preset standard range, and the safety risk state is verified according to a comparison result, which achieves the purposes of predicting a gas risk and verifying a prediction result, thereby achieving the technical effect of improving the response capability to a gas safety problem, and further solving the technical problem of limiting the response capability to the gas safety problem due to the inability to predict the gas risk in a related gas safety investigation process. BRIEF DESCRIPTION OF DRAWINGS

[0027] The accompanying drawings, which are included to provide a further understanding of the present application and constitute a part of this application, illustrate certain illustrative embodiments of the present application and together with the description serve to explain the present application. In the drawings:

[0028] Figure 1 is a schematic diagram of a gas safety investigation process of related technology;

[0029] Figure 2 is a flowchart of a data processing method according to an embodiment of the present application;

[0030] Figure 3 is a flowchart of another data processing method according to an embodiment of the present application;

[0031] Figure 4 is a structural diagram of a data processing device according to an embodiment of the application;

[0032] Figure 5 is a hardware structural block diagram of a computer terminal of a data processing method according to an embodiment of the application. DETAILED DESCRIPTION

[0033] In order to enable persons skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.

[0034] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] According to an embodiment of the present application, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0036] Figure 2 is a flowchart of a data processing method according to an embodiment of the present application, as shown in Figure 2 the method comprises the following steps:

[0037] Step S201, obtaining a feature set in a database, wherein the feature set comprises: a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment in which the gas pipeline is located.

[0038] Step S201 extracts necessary feature data from the gas safety big data platform, which constitutes a feature set. Specifically, the feature set includes but is not limited to the following key indicators: gas temperature: monitor the temperature of the gas in the pipeline, which is obtained by the built-in temperature sensor. Changes in gas temperature can be an early sign of gas leakage, system overheating, and other dangerous conditions. Gas pressure: monitor the pressure inside the gas pipeline, collect data through pressure sensors. Abnormal fluctuations in gas pressure may be a sign of pipe damage, blockage, or leakage. Carbon monoxide concentration: measure the concentration of carbon monoxide gas in the target environment, which is done by a dedicated carbon monoxide gas detector. High concentrations of carbon monoxide may indicate insufficient combustion or poor ventilation of the gas. Smoke concentration: detect the concentration of smoke in the target environment using a smoke detector. Rising smoke concentration may indicate a fire or burning event around the gas facility.

[0039] Step S202 uses a random forest model to analyze the feature set and obtains the risk probability value corresponding to the feature set, and determines the safety risk state of the target environment according to the risk probability value.

[0040] Step S202 uses a random forest model to analyze the feature set obtained in step S201. Random forest is an ensemble learning method composed of many decision trees, each tree independently classifies or regresses the data, and the final result is the average or majority vote of all tree predictions. In step S202, the feature set is input into the random forest model, which calculates the risk probability value of the target environment facing gas safety risks. The risk probability value represents the possibility of the target environment having a security risk based on the current feature set. According to the threshold set by the risk probability value, the safety state of the target environment is determined, such as if the risk probability value exceeds a certain threshold, it is determined that there is a security risk.

[0041] Step S203, in the case where the safety risk state indicates that the target environment has a security risk, an alarm message is generated and sent to the target object.

[0042] In step S203, if the security risk state indicates that the target environment has a security risk, an alarm message is automatically triggered and sent to a pre-set target object, which includes but is not limited to an account, a terminal device or a specific service system. Specifically, the target object can be a user account pre-registered in the gas safety management system, the terminal device can be a mobile device such as a smartphone or a tablet computer, or a fixedly installed monitoring center computer. These terminal devices have the function of receiving and displaying alarm information, allowing maintenance personnel or monitors to immediately understand the on-site situation, quickly locate problems and respond. The target object can also be part of the gas safety service system, such as an automatic response system or a remote monitoring platform. When the alarm message is sent, such systems can automatically trigger emergency plans, such as closing the gas valve, starting the ventilation equipment, or even sending help information to the fire department or other emergency service agencies, forming a closed-loop safety management and emergency response process.

[0043] Through step S203, relevant personnel can be quickly notified to take emergency measures such as closing the gas valve to prevent disasters.

[0044] In step S204, the actual behavior sequence and detection data of the gas maintenance personnel sent by the target object in response to the alarm message are received, and the similarity between the actual behavior sequence and the pre-set standard behavior sequence is determined.

[0045] Upon receiving the alarm message, step S204 will be started, and the gas maintenance personnel will go to the scene for investigation. In this process, the actual behavior sequence of the maintenance personnel will be recorded, captured and transmitted through the camera on the device, and at the same time, the maintenance personnel will also collect detailed on-site detection data, including but not limited to gas temperature, pressure, carbon monoxide and smoke concentration, etc.

[0046] In step S205, if the similarity is greater than the target threshold, the detection data is compared with the pre-set standard range, and the security risk state is verified according to the comparison result.

[0047] In the above steps S201 to S205, first, a gas safety big data platform is constructed according to the previous safety investigation data, including the monitoring data of the investigation tool and historical safety records, user information, etc. Then, according to the above information, multi-source data fusion and intelligent decision flow technology are used to intelligently customize the investigation plan according to the risk coefficient. The operation personnel are dispatched for inspection, the optimized inspection tool is used, the operation behavior of the personnel is standardized, and the data is transmitted back to the gas safety big data platform for data updating by using Internet of Things technology, etc. The gas safety is analyzed by algorithm, the danger alarm and prediction are made, and the central control system is transmitted, the power switch is cut off in time and the rectification is urged, the accident probability is reduced. Finally, according to the results obtained by prediction, the recheck is carried out regularly, the new inspection plan is made, and the benign cycle of gas safety investigation is realized by this method.

[0048] The steps shown in Figure 1 are exemplarily described and explained below.

[0049] According to some optional embodiments of the present application, the random forest model in step S202 is obtained by the following method: obtaining a historical data set, wherein the historical data set includes a plurality of target features and safety risk labels corresponding to different target feature combinations, the safety risk label is a binary label, and is used to indicate whether there is a safety risk; the target features include historical time point gas temperature value, gas pressure value, carbon monoxide concentration value and smoke concentration value; preprocessing the historical data set to generate a preprocessed historical data set, wherein the preprocessing includes missing value filling, outlier processing and data standardization; generating a plurality of training subsets in the preprocessed historical data set by bootstrap sampling method; for each training subset, starting from the root node, calculating the information gain of all features in the current node; selecting the feature with the maximum information gain as the split feature; repeating the above splitting process until the preset stopping condition is met, generating a decision tree corresponding to each training subset; aggregating the decision trees corresponding to each training subset to obtain the random forest model.

[0050] In the present embodiment, first, a historical data set is obtained from the gas safety big data platform, the historical data set includes a plurality of target features, specifically including gas temperature value, gas pressure value, carbon monoxide concentration value and smoke concentration value collected from each time point in the past, which are important indicators for monitoring gas safety status. In addition, the historical data set also covers the safety risk labels corresponding to each feature combination, the safety risk label here is a binary label, i.e. "there is a safety risk" or "there is no safety risk", which is used to clearly label the safety situation in the historical record.

[0051] To enhance the predictive performance of the model, the historical dataset must undergo a preprocessing phase before entering the model training. Preprocessing includes several key steps: missing value imputation, filling in missing data points through statistical analysis or algorithmic prediction to maintain data continuity and integrity; outlier treatment, identifying and handling those extreme or irregular data points to avoid their adverse impact on model prediction; data standardization, converting each feature value to the same scale to eliminate dimensional effects and ensure that the model treats each feature fairly during training. The preprocessed historical dataset generated through preprocessing is clearer, neater, and easier to analyze later.

[0052] Next, multiple training subsets of the preprocessed historical dataset are generated using the bootstrap sampling method. Bootstrap sampling is a resampling strategy that creates sub-datasets containing repeated samples, which helps the model reduce the risk of overfitting and enhance generalization ability. For each training subset, the model training process starts from the root node, systematically analyzing and calculating the information gain of all features. Information gain is the preferred basis for splitting nodes in decision trees, measuring the importance and discrimination ability of features in classification tasks. By comparison, the feature with the highest information gain is selected as the splitting criterion, and the dataset is divided into smaller subsets based on this feature. This process is recursively performed until the preset stopping conditions are met, such as reaching the maximum tree depth, the number of node samples falling below the threshold, or achieving perfect classification purity. Such splitting logic ensures that each tree can independently and efficiently learn and predict safety risks.

[0053] Finally, the decision trees generated for each training subset are aggregated to form a random forest model. Random forests can more accurately and robustly predict safety risks because they combine the prediction results of multiple decision trees, each trained based on different training subsets and feature subsets. Through the majority voting mechanism, even if individual trees make biased predictions, the overall model can still make accurate risk judgments. The advantage of this model is that it can handle high-dimensional features, adapt to nonlinear relationships, and perform more stably in the face of data noise and omissions, thereby significantly improving the accuracy and reliability of gas safety hazard detection.

[0054] According to some optional embodiments of the present application, the similarity between the actual behavior sequence and the preset standard behavior sequence in step S204 can be determined by the following method: based on the actual behavior sequence and the preset standard behavior sequence, a two-dimensional distance comparison table is constructed, wherein the total number of rows in the two-dimensional distance comparison table is equal to the total number of data points in the actual behavior sequence, the total number of columns is equal to the total number of data points in the preset standard behavior sequence, and each cell stores the absolute difference between the two data points corresponding to the row and column positions; an accumulated value table with the same dimension as the two-dimensional distance comparison table is created, wherein the value of the top-left cell in the accumulated value table is equal to the value of the same position in the two-dimensional distance comparison table, the value of the first row cell is equal to the sum of the accumulated value of the left cell and the value of the current cell in the two-dimensional distance comparison table, and the value of the first column cell is equal to the sum of the accumulated value of the cell above and the value of the current cell in the two-dimensional distance comparison table; the following steps are performed in the accumulated value table in the order from left to right and from top to bottom to obtain a target accumulated value table: the values of the three adjacent cells of the top-left, top and left of the current cell in the accumulated value table are selected, and the minimum value among the three values is determined, and the minimum value is added to the value of the same position in the two-dimensional distance comparison table as the accumulated value of the current cell; the final accumulated value of the bottom-right cell in the target accumulated value table is extracted, and the final accumulated value is divided by the sum of the actual behavior sequence and the preset standard behavior sequence to obtain a standardized difference value; and the standardized difference value is mapped to a similarity score by a conversion function.

[0055] In the present embodiment, first, the absolute difference between each pair of points in the two sequences is calculated based on the actual behavior sequence and the preset standard behavior sequence. In the two-dimensional distance comparison table constructed, the number of rows corresponds to the total number of data points in the actual behavior sequence, and the number of columns corresponds to the total number of data points in the preset standard behavior sequence. Each cell stores the absolute difference between a point in the actual sequence and a point in the standard sequence, which intuitively reflects the difference between the two sequences at different time points.

[0056] Then, an accumulated value table with the same dimension as the distance comparison table is created to record the accumulated difference values. In the accumulated value table, the value of the top-left cell is directly equal to the value of the same position in the distance comparison table. For the other cells in the first row and the first column, the value is equal to the accumulated value of the left or upper adjacent cell plus the absolute difference of the current cell in the distance comparison table. Such a design ensures that the accumulated value table can accumulate the difference values in the horizontal and vertical directions, providing a basis for subsequent calculations.

[0057] Further, in the order from left to right and from top to bottom, each cell of the accumulated value table is traversed, and for each cell, the following operation is performed: the minimum value of the three cells adjacent to the left top, the top and the left of the cell is selected, and then the minimum value is added to the absolute difference value of the current cell in the distance comparison table to obtain the accumulated value of the current cell. This process is essentially to solve the shortest distance path between the actual behavior sequence and the preset standard sequence by dynamic programming, that is, the dynamic time warping path, which can adapt to the stretching and offset of the two sequences in time and find the best match.

[0058] After the calculation of the accumulated value table is completed, the final accumulated value of the right bottom cell in the table is extracted. Considering that the actual behavior sequence and the preset standard behavior sequence may be of different lengths, in order to make the similarity evaluation more fair, a standardized difference value is obtained by dividing the final accumulated value by the sum of the total number of data points of the two sequences. This standardized difference value reflects the degree of difference between the two sequences, but in order to more intuitively represent the similarity, it also needs to be mapped to a similarity score by a conversion function. The conversion function usually converts the standardized difference value to a value between 0 and 1, and the closer the value is to 1, the more similar the two sequences are, and the closer to 0, the greater the difference.

[0059] Through the above steps, not only the degree of difference between the actual behavior of the maintenance personnel and the standard behavior can be obtained, but also the similarity of the behavior can be intuitively presented through standardization and conversion, providing a scientific basis for behavior monitoring and guidance in the gas safety inspection process.

[0060] In some optional embodiments of the present application, the above data processing method further includes the following steps: in the case that the similarity is not greater than the target threshold, determining a historical feature set with the greatest similarity to the feature set in the database; determining a risk label corresponding to the historical feature set, and in the case that the risk label indicates that there is a safety risk, sending a control instruction to a gas control system, wherein the gas control system is used to respond to the control instruction to perform a cutting processing on the valve of the gas pipeline.

[0061] In this embodiment, in the case that the similarity is not greater than the target threshold, the database is traced back to search for a historical feature set most similar to the current feature set (including the gas temperature value, the gas pressure value, the carbon monoxide concentration value, the smoke concentration value, etc.). It is equivalent to finding the processing experience of "similar situation" in history to provide a reference for safety evaluation under the current situation.

[0062] After finding the historical feature set with the highest similarity to the current feature set, the corresponding historical risk label is checked. The historical risk label, as a binary label, explicitly indicates whether a safety risk was detected in the historical case. If the historical risk label shows that there was a safety risk, it indicates that the current monitoring data and environmental features are very similar to the conditions under which a safety problem occurred in the past, and thus may indicate that the current environment also faces similar dangers. In this case, an emergency control instruction is sent to the gas control system, requiring it to take immediate action to shut down the gas pipeline valve involved to quickly cut off the gas supply and avoid potential gas leakage or explosion risks. After receiving the control instruction, the gas control system will respond immediately by automatically or remotely controlling the specified gas pipeline valve to close. By promptly shutting down the valve, the system can effectively prevent further gas leakage and avoid potential fires, explosions, and other serious consequences, protecting the lives and safety of personnel on site and the property of the surrounding environment.

[0063] As some optional embodiments of the present application, the determination of the safety risk state of the target environment according to the risk probability value in step S202 can be realized by the following method: in the case where the risk probability value is greater than or equal to the first threshold value, it is determined that the target environment has a safety risk, and in the case where the risk probability value is less than the first threshold value, it is determined that the target environment does not have a safety risk.

[0064] In this embodiment, the risk probability value is compared with the pre-set first threshold value to determine the safety risk state of the target environment. If the risk probability value is greater than or equal to the first threshold value, the target environment is automatically identified as a state with a safety risk. The first threshold value is an important decision point, which can be set based on a large amount of historical data and expert opinions, aiming to balance the sensitivity and specificity of safety warning, neither missing the real risk situation due to the threshold set too high, nor causing frequent false alarms due to the threshold set too low, affecting normal operation and maintenance efficiency. On the contrary, if the risk probability value is less than the first threshold value, it is determined that the target environment is currently in a state without a safety risk. This means that according to historical data analysis and model prediction, the gas temperature, pressure, carbon monoxide concentration and smoke concentration and other indicators in the current environment are within the safe range, and no alarm will be triggered, but monitoring will continue to ensure the continuity and coherence of gas safety inspection.

[0065] Further, according to the comparison result, after verifying the security risk state, the following step can also be performed: counting a first occurrence number of false alarm events in a preset time window, wherein the false alarm event is an event that the security risk state indicates that the target environment exists a security risk and the security risk state fails to pass the verification; counting a second occurrence number of missed alarm events in the preset time window, wherein the missed alarm event is an event that actually occurs a security risk and a risk probability value is less than the first threshold; and adjusting the first threshold according to the first occurrence number and the second occurrence number.

[0066] It can be understood that, in order to further improve and optimize the accuracy of the security risk assessment, the embodiment introduces a feedback adjustment mechanism after the preliminary state judgment based on the risk probability value, to verify and fine-tune the risk assessment threshold. This mechanism first focuses on the frequency of false alarm events and missed alarm events. The statistics of false alarm events refer to the situation that, in a specific time period, the target environment is determined to exist a security risk by the random forest model, but after further verification in step S205, it is confirmed that there is no such risk. False alarms can lead to unnecessary emergency responses and resource consumption, so the first occurrence number of such events is recorded and counted, which is referred to as the "first occurrence number". By analyzing the frequency of false alarms, it can be evaluated whether the current first threshold is set too low, i.e. whether it is too easy to judge a safe or normal environment as existing a risk. Similarly, the second occurrence number of missed alarm events is also counted in the preset time window, i.e. the situation that a security risk actually occurs, but the judgment based on the current risk probability value and the first threshold fails to issue an alarm in time. According to the first occurrence number of false alarm events and the second occurrence number of missed alarm events, the first threshold will be dynamically adjusted. If the number of false alarms is large, it may mean that the threshold is set too low, and the threshold will be appropriately increased to reduce unnecessary alarms. On the contrary, if it is found that the missed alarm situation is frequent, it indicates that the threshold may be set too high, and the threshold needs to be appropriately reduced to ensure that a response can be made in time when facing a security risk.

[0067] Further, according to the first occurrence number and the second occurrence number, the first threshold can be adjusted by the following method: in the case that the second occurrence number is zero and the first occurrence number is greater than zero, the first adjustment amount is determined according to the following formula: δ = 0.01 x (A / m), wherein δ is the adjustment amount, A is the first occurrence number, and m is a positive integer determined according to the length of the preset time window.

[0068] This formula means that as the number of false alarm events A increases, the first threshold will be moderately adjusted upwards to reduce possible future false alarms. The size of the adjustment amount is proportional to the number of false alarm events, but it is smoothed by dividing by m to avoid sharp fluctuations in the threshold.

[0069] In the case that the first occurrence number is zero and the second occurrence number is greater than zero, the second adjustment amount is determined according to the following formula: δ = -0.03 * B, wherein B is the second occurrence number; and the first threshold value is adjusted based on the first adjustment amount or the second adjustment amount.

[0070] The formula shows that for each false negative, the first threshold value is moderately adjusted downward to improve the sensitivity and identification rate of the true security risk. The size of the adjustment amount is proportional to the number of false negative events B, ensuring the pertinence and effectiveness of the threshold adjustment.

[0071] The above-mentioned threshold fine-tuning mechanism based on event statistics can ensure that the security warning system learns and optimizes itself in actual operation, and continuously improves the accuracy of risk identification. By dynamically adjusting the first threshold value, false positives can be reduced while false negatives are effectively avoided, and a more stable and reliable gas safety hidden danger investigation mechanism is built.

[0072] In some optional embodiments of the present application, the detection data includes: a detection temperature value, a detection pressure value, a detection carbon monoxide concentration value, and a detection smoke concentration value.

[0073] The verification of the security risk state according to the comparison result in step S205 can be realized by the following method: judging whether the detection temperature value is within the first preset range, whether the detection pressure value is within the second preset range, whether the detection carbon monoxide concentration value is within the third preset range, and whether the detection smoke concentration value is within the fourth preset range; in the case that the detection temperature value is not within the first preset range and / or the detection pressure value is not within the second preset range and / or the detection carbon monoxide concentration value is not within the third preset range and / or the detection smoke concentration value is not within the fourth preset range, it is determined that the security risk state passes the verification.

[0074] It can be understood that when the detected temperature value exceeds the first preset range, the pressure value exceeds the second preset range, the carbon monoxide concentration value exceeds the third preset range, or the smoke concentration value exceeds the fourth preset range, or any combination of the above occurs, it is automatically determined that the current security risk state passes the verification, i.e., it is confirmed that there is a security risk.

[0075] Figure 3 is a flowchart of another data processing method according to an embodiment of the present application, as shown in Figure 3 The method includes the following steps:

[0076] Step 1, build a gas safety big data platform.

[0077] (1) Obtain the following information from relevant departments responsible for gas safety inspection: user information; monitoring data of inspection tools, including gas temperature, pressure, carbon monoxide concentration, smoke concentration, gas pipeline pipe age; historical safety records and other factors.

[0078] (2) Organize and structure the various data obtained from the internal and external factors related to gas safety, and finally form a positive and negative sample database including internal and external factor data. Given the gas temperature value X1, gas pressure value X2, carbon monoxide concentration X3, and smoke concentration X4, pipe historical age X5, etc., use KNN algorithm to classify them, and the related formula is:

[0079]

[0080] Step 1: Efficient data collection and transmission based on multi-source data fusion, making the acquisition of gas safety data more real-time and comprehensive: In gas safety hazard inspection, real-time data acquisition and comprehensive perception are the key to improving management efficiency. Through multi-source data fusion technology, various data generated during gas use can be obtained in real time, including temperature, pressure, carbon monoxide concentration, smoke concentration, etc., making data acquisition more real-time and comprehensive. This technology not only improves the comprehensive understanding and perception of the gas use environment, but also deeply utilizes existing sensor data, linking the data of the entire gas system to provide more rich information support. Real-time and comprehensive data acquisition helps to timely discover and solve problems, improving the response speed and effect of management.

[0081] Step 2: Input data into the big data analysis module, use decision tree, random forest algorithm, DTW algorithm, etc. to build intelligent decision flow, and get the risk prediction result of gas, and intelligently formulate the inspection plan.

[0082] (1) Define the target and features of the prediction model: For gas safety risk prediction, the target variable (response variable) is a binary classification variable, indicating whether there is a safety risk (for example, 1 indicates risk, 0 indicates no risk). Feature variables include gas temperature value, gas pressure value, carbon monoxide concentration, and smoke concentration.

[0083] (2) Data set preparation: Divide the data set into feature set X and target variable Y, set gas temperature value X1, gas pressure value X2, carbon monoxide concentration X3, and smoke concentration X4; target variable Y includes risk and no risk.

[0084] X = {X1, X2, X3, X4}

[0085]

[0086] (3) Construct decision tree: for each tree, randomly select a subset of features and samples; for each node, select a feature and a value of the feature to split the data to maximize information gain or reduce Gini impurity. The relevant formulas involved are: Gini(Y) = 1 - ∑

[0087] y∈Y p(y) 2

[0088] (4) Construct random forest: repeat the above process to construct multiple decision trees. Each tree uses a different subset of features and samples during training.

[0089] (5) Prediction: for classification problems, each tree gives a prediction result, and the final prediction result is the majority vote result of all tree prediction results. For specific use, if more than half of the trees predict the result as "at risk", the final prediction result is "at risk"; otherwise, it is "no risk". Thus, the risk prediction result of gas safety is obtained, and according to the risk prediction result, an intelligent inspection plan is made.

[0090] Step 3, arrange staff to carry out manual inspection with optimized inspection tools.

[0091] Step 4, build intelligent monitoring and inspection system.

[0092] (1) First-level monitoring system: in the first-level monitoring system of the inspection tool, through the built-in high-sensitivity gas leakage sensor, infrared thermal imager and other technologies, the tool is installed with gas temperature monitoring unit, gas pressure monitoring unit, carbon monoxide concentration monitoring unit and smoke monitoring unit to collect various data of the inspection area.

[0093] (2) Second-level monitoring system: use dynamic time warping (DTW) algorithm to help compare the similarity between the actual behavior sequence of the operator and the preset standard behavior sequence to standardize the operation behavior of the inspection personnel during inspection to ensure the accuracy of the inspection. Through the camera, the first perspective operation video of the operator is obtained, and the target tracking algorithm is used to obtain the relative time coordinate sequence of the hand trajectory of the operator, with a length of m:

[0094] H={h1,h2…h i …h m}

[0095] The relative time coordinate sequence of the standard operation behavior trajectory is defined as n, and the following is obtained:

[0096] D={D1,D2…D j… D n} ​

[0097] The DTW distance calculation formula is as follows:

[0098]

[0099] wherein X and Y are two time series, m and n are their lengths respectively, d(h i , D j ) is the distance (such as the Euclidean distance) between the corresponding points h i and D j in the two sequences, σ is an angle constraint, which ensures that no future information is leaked to the past during comparison, and θ is a parameter, which is defined according to the influence degree of the field situation on the DTW distance, so as to improve the accuracy.

[0100] If the DTW distance is below a certain threshold, it can be considered that the behavior of the operating personnel is in line with the standard; if the threshold is exceeded, it may indicate that the behavior deviates.

[0101] Step 5, data transmission: through the Internet of Things, big data and other technologies, the data obtained in the above monitoring process is transmitted to the gas safety big data platform, the platform is updated, and is used for subsequent data analysis.

[0102] Step 6, the big data analysis module performs the following steps:

[0103] (1) Risk warning: the monitoring temperature threshold is G1, the monitoring pressure threshold is G2, the monitoring carbon monoxide concentration threshold is G3, and the monitoring smoke concentration threshold is G4. The input monitoring data including the monitoring temperature value g1, the monitoring pressure value g2, the monitoring carbon monoxide concentration g3 and the monitoring smoke concentration g4 are compared with the threshold, if the monitoring value is within the threshold range, it indicates no risk; if the monitoring value exceeds the threshold range, it indicates danger. The related formula is:

[0104] No risk

[0105] On the contrary, there is a risk and an alarm needs to be processed.

[0106] (2) Risk prediction: repeat the above-mentioned second step for the updated gas safety platform data to obtain the prediction result of the risk.

[0107] Step 7, central control system: control according to the risk warning and risk prediction results input by the big data analysis module.

[0108] (1) According to the risk warning result, for the gas area with danger, the related switch is cut off through the control system, and the relevant department is notified to rectify immediately.

[0109] (2) According to the risk prediction results, for the gas area with high risk, immediately join the gas safety inspection plan, and kill the danger in the cradle.

[0110] Step 8, supervision and rectification, regular review: according to the output results of the central control system, rectification and intelligent review plan are made to form a virtuous cycle.

[0111] It should be noted that in gas safety management, data processing and decision support are closely related. The above steps use intelligent decision flow technology, which can process health data from different gas facilities and different formats. By considering the different degrees of influence of various data on gas safety and using different parameters for data processing, it can be more close to practical application and improve the scientificity and execution efficiency of decision-making. This technology not only improves the availability of data, but also enhances the flexibility and adaptability of the system, providing strong technical support for gas safety management. Through intelligent decision flow, problems can be accurately identified and scientific decision suggestions can be provided, thereby improving the effectiveness and quality of management.

[0112] Figure 4 is a structural diagram of a data processing device according to an embodiment of the present application, as shown in Figure 4 , the device comprises:

[0113] The acquisition module 41 is configured to acquire a feature set in the database, wherein the feature set comprises: the gas temperature and the gas pressure in the gas pipeline, and the carbon monoxide concentration and the smoke concentration of the target environment where the gas pipeline is located.

[0114] The first determination module 42 is configured to analyze the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determine a safety risk state of the target environment according to the risk probability value.

[0115] The sending module 43 is configured to generate an alarm message in the case that the safety risk state indicates that the target environment has a safety risk, and send the alarm message to the target object.

[0116] The second determination module 44 is configured to receive an actual behavior sequence and detection data of a gas maintenance personnel sent by the target object in response to the alarm message, and determine a similarity between the actual behavior sequence and a preset standard behavior sequence.

[0117] The third determination module 45 is configured to compare the detection data with a preset standard range in the case that the similarity is greater than a target threshold, and verify the safety risk state according to a comparison result.

[0118] Optionally, the random forest model is trained by the following method: obtaining a historical data set, wherein the historical data set includes a plurality of target features and a safety risk label corresponding to a target combination formed by different target features, the safety risk label is a binary label, and is used to indicate whether there is a safety risk; the target features include a gas temperature value, a gas pressure value, a carbon monoxide concentration value, and a smoke concentration value at a historical time point; preprocessing the historical data set to generate a preprocessed historical data set, wherein the preprocessing includes missing value filling, outlier processing, and data standardization; generating a plurality of training subsets in the preprocessed historical data set by a bootstrap sampling method; for each training subset, starting from a root node, calculating the information gain of all features in the current node; selecting the feature with the maximum information gain as the split feature; repeating the above splitting process until a preset stopping condition is met to generate a decision tree corresponding to each training subset; and aggregating the decision trees corresponding to each training subset to obtain the random forest model.

[0119] Optionally, the similarity between the actual behavior sequence and the preset standard behavior sequence is determined, and specifically includes the following steps: based on the actual behavior sequence and the preset standard behavior sequence, a two-dimensional distance comparison table is constructed, wherein the total number of rows in the two-dimensional distance comparison table is equal to the total number of data points of the actual behavior sequence, the total number of columns is equal to the total number of data points of the preset standard behavior sequence, and each cell stores the absolute difference between the two data points at the corresponding row and column positions; an accumulated value table with the same dimension as the two-dimensional distance comparison table is created, wherein the value of the top left cell in the accumulated value table is equal to the value of the same position in the two-dimensional distance comparison table, the value of the first row cell is equal to the sum of the accumulated value of the left cell and the value of the current cell in the two-dimensional distance comparison table, and the value of the first column cell is equal to the sum of the accumulated value of the cell above and the value of the current cell in the two-dimensional distance comparison table; in the accumulated value table, the following steps are performed in the order from left to right and from top to bottom to obtain a target accumulated value table: selecting the values of the three adjacent cells of the top left, top, and left of the current cell in the accumulated value table, and determining the minimum value among the three values; adding the minimum value to the value of the same position in the two-dimensional distance comparison table to obtain the accumulated value of the current cell; extracting the final accumulated value of the bottom right cell in the target accumulated value table, dividing the final accumulated value by the sum of the actual behavior sequence and the preset standard behavior sequence to obtain a standardized difference value; and mapping the standardized difference value to a similarity score by a conversion function.

[0120] Optionally, the data processing device is further configured to perform the following steps: in the case that the similarity is not greater than a target threshold, determining a historical feature set with the greatest similarity to the feature set in the database; determining a risk label corresponding to the historical feature set, and in the case that the risk label indicates that there is a safety risk, sending a control instruction to a gas control system, wherein the gas control system is configured to respond to the control instruction to perform a cutting process on a valve of a gas pipeline.

[0121] Optionally, the safety risk state of the target environment is determined according to the risk probability value, specifically including the following steps: in the case that the risk probability value is greater than or equal to a first threshold value, it is determined that the target environment has a safety risk; in the case that the risk probability value is less than the first threshold value, it is determined that the target environment does not have a safety risk; and according to the comparison result, the safety risk state is verified, and further including the following steps: within a preset time window, a first occurrence number of false alarm events is counted, wherein the false alarm event is an event in which the safety risk state indicates that the target environment has a safety risk and the safety risk state fails to pass the verification; within the preset time window, a second occurrence number of missed alarm events is counted, wherein the missed alarm event is an event in which a safety risk actually occurs and the risk probability value is less than the first threshold value; and according to the first occurrence number and the second occurrence number, the first threshold value is adjusted.

[0122] Optionally, the first threshold value is adjusted according to the first occurrence number and the second occurrence number, specifically including the following steps: in the case that the second occurrence number is zero and the first occurrence number is greater than zero, a first adjustment amount is determined according to the following formula: δ = 0.01 × (A / m), wherein δ is the adjustment amount, A is the first occurrence number, and m is a positive integer determined according to the length of the preset time window; in the case that the first occurrence number is zero and the second occurrence number is greater than zero, a second adjustment amount is determined according to the following formula: δ = -0.03 × B, wherein B is the second occurrence number; and the first threshold value is adjusted based on the first adjustment amount or the second adjustment amount.

[0123] Optionally, the detection data includes a detection temperature value, a detection pressure value, a detection carbon monoxide concentration value, and a detection smoke concentration value; and according to the comparison result, the safety risk state is verified, specifically including the following steps: it is judged whether the detection temperature value is within a first preset range, whether the detection pressure value is within a second preset range, whether the detection carbon monoxide concentration value is within a third preset range, and whether the detection smoke concentration value is within a fourth preset range; and in the case that the detection temperature value is not within the first preset range and / or the detection pressure value is not within the second preset range and / or the detection carbon monoxide concentration value is not within the third preset range and / or the detection smoke concentration value is not within the fourth preset range, it is determined that the safety risk state passes the verification.

[0124] It should be noted that the above Figure 4 Each of the modules described above can be a program module (for example, a collection of program instructions that implement a certain specific function) or a hardware module. For the latter, it can be in the form of, but not limited to, a processor, or the functions of the above-mentioned modules are implemented by a processor.

[0125] It should be noted that Figure 4The preferred implementation of the illustrated embodiment can be seen with reference to Figure 2 The relevant description of the illustrated embodiment will not be repeated here.

[0126] Figure 5 A hardware structure block diagram of a computer terminal for implementing the data processing method is shown. As shown in Figure 5 The computer terminal 50 can include one or more processors 502 (the processor 502 can include but is not limited to a microprocessor MCU or a programmable logic device FPGA processing device), a memory 504 for storing data, and a transmission module 506 for communication functions. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 5 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 50 can include more or less components than those shown in Figure 5 or have a different configuration than Figure 5 shown.

[0127] It should be noted that the one or more processors 502 and / or other data processing circuits described above can be referred to herein as "data processing circuits" in general. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any other combination. In addition, the data processing circuit can be a single independent processing module, or all or part of any one of the other elements combined into the computer terminal 50. As referred to in the embodiments of the present application, the data processing circuit serves as a processor control (for example, selection of a variable resistance terminal path connected to an interface).

[0128] The memory 504 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data processing method in the embodiments of the present application. The processor 502 executes various functional applications and data processing by running the software programs and modules stored in the memory 504, that is, implements the above-mentioned data processing method. The memory 504 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memories. In some examples, the memory 504 can further include a memory remotely disposed with respect to the processor 502, which can be connected to the computer terminal 50 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0129] The transmission module 506 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the computer terminal 50. In an example, the transmission module 506 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In an example, the transmission module 506 can be a radio frequency (RF) module configured to communicate with the Internet wirelessly.

[0130] The display can be a liquid crystal display (LCD) that is touch screen, for example, which can enable a user to interact with a user interface of the computer terminal 50.

[0131] It should be noted that, in some optional embodiments, the above Figure 5 The computer terminal shown can include hardware elements (including circuitry), software elements (including computer code stored on a computer readable medium), or a combination of both hardware and software elements. It should be noted that, Figure 5 is merely one example of a particular implementation and is intended to illustrate the types of components that can be present in the computer terminal described above.

[0132] It should be noted that, Figure 5 The computer terminal shown is configured to perform Figure 2 The data processing method shown, and thus the related explanations of the method of executing the above commands also apply to the electronic device, which will not be described again here.

[0133] The embodiments of the present application also provide a non-volatile storage medium, which includes a stored program, wherein the program controls a device in which the storage medium is located to execute the above data processing method when running.

[0134] The non-volatile storage medium executes the following functions: obtaining a feature set in a database, wherein the feature set includes a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment in which the gas pipeline is located; analyzing the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determining a safety risk state of the target environment according to the risk probability value; in a case where the safety risk state indicates that the target environment has a safety risk, generating an alarm message and sending the alarm message to a target object; receiving an actual behavior sequence of a gas maintenance personnel and detection data sent by the target object in response to the alarm message, and determining a similarity between the actual behavior sequence and a preset standard behavior sequence; in a case where the similarity is greater than a target threshold, comparing the detection data with a preset standard range, and verifying the safety risk state according to a comparison result.

[0135] The embodiment of the application further provides an electronic device, comprising a memory and a processor, wherein the processor is used to run a program stored in the memory, and the program performs the data processing method.

[0136] The processor is used to run a program performing the following functions: obtaining a feature set in a database, wherein the feature set comprises a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment where the gas pipeline is located; analyzing the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determining a safety risk state of the target environment according to the risk probability value; in the case that the safety risk state indicates that the target environment has a safety risk, generating an alarm message and sending the alarm message to a target object; receiving an actual behavior sequence of a gas maintenance personnel and detection data sent by the target object in response to the alarm message, and determining a similarity between the actual behavior sequence and a preset standard behavior sequence; in the case that the similarity is greater than a target threshold, comparing the detection data with a preset standard range, and verifying the safety risk state according to a comparison result.

[0137] The serial numbers of the above embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0138] In the above embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0139] In the above embodiments of the application, the collected information is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary protection measures are taken, public order and good customs are not violated, and appropriate operation entrances are provided for the user to select authorization or refusal.

[0140] In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit described as separate units can be combined or integrated into another system, and some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection between each other can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.

[0141] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0142] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0143] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part that contributes to the related art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various program code storage media.

[0144] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A data processing method, characterized by, The method comprises the following steps: obtaining a feature set in a database, wherein the feature set comprises: a gas temperature and a gas pressure in a gas pipeline, a carbon monoxide concentration and a smoke concentration of a target environment in which the gas pipeline is located; analyzing the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determining a safety risk state of the target environment according to the risk probability value; in the case that the safety risk state indicates that there is a safety risk in the target environment, generating an alarm message and sending the alarm message to a target object; receiving an actual behavior sequence and detection data of a gas maintenance personnel sent by the target object in response to the alarm message, and determining a similarity between the actual behavior sequence and a preset standard behavior sequence; in the case that the similarity is greater than a target threshold, comparing the detection data with a preset standard range, and verifying the safety risk state according to a comparison result.

2. The method of claim 1, wherein, The random forest model is obtained by the following method: obtaining a historical data set, wherein the historical data set comprises a plurality of target features and safety risk labels corresponding to target combinations formed by different target features, the safety risk label is a binary label, and is used for indicating whether there is a safety risk; the target features comprise a gas temperature value, a gas pressure value, a carbon monoxide concentration value and a smoke concentration value at a historical time point; preprocessing the historical data set to generate a preprocessed historical data set, wherein the preprocessing comprises missing value filling, abnormal value processing and data standardization; generating a plurality of training subsets in the preprocessed historical data set by using a bootstrap sampling method; for each training subset, starting from a root node, calculating information gain of all features in a current node; selecting a feature with maximum information gain as a split feature; repeating the above split process until a preset stop condition is met to generate a decision tree corresponding to each training subset; aggregating the decision trees corresponding to each training subset to obtain the random forest model.

3. The method of claim 1, wherein, Determining the similarity between the actual behavior sequence and the preset standard behavior sequence comprises: based on the actual behavior sequence and the preset standard behavior sequence, constructing a two-dimensional distance comparison table, wherein the total number of rows in the two-dimensional distance comparison table is equal to the total number of data points of the actual behavior sequence, the total number of columns is equal to the total number of data points of the preset standard behavior sequence, and each cell stores the absolute difference between the two data points at the corresponding row and column positions; creating an accumulated value table with the same dimension as the two-dimensional distance comparison table, wherein the value of the top left cell in the accumulated value table is equal to the value of the same position in the two-dimensional distance comparison table, the value of the first row cell is equal to the sum of the accumulated value of the left cell and the value of the current cell in the two-dimensional distance comparison table, and the value of the first column cell is equal to the sum of the accumulated value of the upper cell and the value of the current cell in the two-dimensional distance comparison table; According to the order from left to right and from top to bottom, the following steps are performed in the cumulative value table to obtain a target cumulative value table: selecting values of three cells adjacent to the current cell in the cumulative value table, i.e., the cell above-left, the cell above, and the cell left of the current cell, determining a minimum value among the values of the three cells, and adding a value at the same position in the two-dimensional distance comparison table to the minimum value as a cumulative value of the current cell; extracting a final cumulative value of a cell at a lower-right corner of the target cumulative value table, dividing the final cumulative value by a sum of the actual behavior sequence and the preset standard behavior sequence to obtain a standardized difference value; mapping the standardized difference value to a similarity score through a conversion function.

4. The method of claim 1, wherein, The method further comprises: in a case where the similarity is not greater than the target threshold, determining a historical feature set with the greatest similarity to the feature set in the database; determining a risk label corresponding to the historical feature set, and in a case where the risk label indicates that a security risk exists, sending a control instruction to a gas control system, wherein the gas control system is configured to respond to the control instruction to perform a shutoff process on a valve of the gas pipeline.

5. The method of claim 1, wherein determining the security risk state of the target environment according to the risk probability value comprises: in a case where the risk probability value is greater than or equal to a first threshold, determining that the target environment has a security risk, and in a case where the risk probability value is less than the first threshold, determining that the target environment does not have a security risk; after verifying the security risk state according to the comparison result, the method further comprises: in a preset time window, counting a first occurrence number of false alarm events, wherein the false alarm event is an event in which the security risk state indicates that the target environment has a security risk and the security risk state fails to pass verification; in the preset time window, counting a second occurrence number of missed alarm events, wherein the missed alarm event is an event in which an actual security risk occurs and the risk probability value is less than the first threshold; adjusting the first threshold according to the first occurrence number and the second occurrence number.

6. The method of claim 5, wherein, Adjusting the first threshold according to the first occurrence number and the second occurrence number comprises: in a case where the second occurrence number is zero and the first occurrence number is greater than zero, determining a first adjustment amount according to a formula: δ = 0.01 × (A / m), wherein δ is the adjustment amount, A is the first occurrence number, and m is a positive integer determined according to a length of the preset time window; in a case where the first occurrence number is zero and the second occurrence number is greater than zero, determining a second adjustment amount according to a formula: δ = -0.03 × B, wherein B is the second occurrence number; adjusting the first threshold based on the first adjustment amount or the second adjustment amount.

7. The method of claim 1, wherein the detection data comprises a detection temperature value, a detection pressure value, a detection carbon monoxide concentration value, and a detection smoke concentration value; verifying the security risk state according to the comparison result comprises: determining whether the detected temperature value is within a first preset range, whether the detected pressure value is within a second preset range, whether the detected carbon monoxide concentration value is within a third preset range, and whether the detected smoke concentration value is within a fourth preset range; in a case where the detected temperature value is not within the first preset range, and / or the detected pressure value is not within the second preset range, and / or the detected carbon monoxide concentration value is not within the third preset range, and / or the detected smoke concentration value is not within the fourth preset range, determining that the safety risk state is verified.

8. A data processing apparatus, characterized by, comprising: an acquisition module, configured to acquire a feature set in a database, wherein the feature set comprises a gas temperature and a gas pressure in a gas pipeline, and a carbon monoxide concentration and a smoke concentration in a target environment where the gas pipeline is located; a first determination module, configured to analyze the feature set by using a random forest model to obtain a risk probability value corresponding to the feature set, and determine a safety risk state of the target environment according to the risk probability value; a sending module, configured to generate an alarm message in a case where the safety risk state indicates that there is a safety risk in the target environment, and send the alarm message to a target object; a second determination module, configured to receive an actual behavior sequence and detection data of a gas maintenance personnel sent by the target object in response to the alarm message, and determine a similarity between the actual behavior sequence and a preset standard behavior sequence; a third determination module, configured to compare the detection data with a preset standard range in a case where the similarity is greater than a target threshold, and verify the safety risk state according to a comparison result.

9. A non-volatile storage medium, comprising: The non-volatile storage medium comprises a stored program, wherein the program controls a device where the non-volatile storage medium is located to perform the data processing method in any one of claims 1 to 7 when the program is running.

10. An electronic device, comprising: comprising: a memory and a processor, the processor being used to run a program stored in the memory, wherein the program performs the data processing method in any one of claims 1 to 7 when the program is running.

11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method in any one of claims 1 to 7.

Citation Information

Cited By

  • LDAR compliance auditing method and system based on data traceability

    CN122022104A