Fire alarm prediction method and device based on high-order Markov chain
Through the fire alarm prediction method based on high-order Markov chains, the problem of high data requirements and inability to capture complex relationships in the prior art is solved, and the rapid and accurate prediction of short-term fire risk is achieved.
Patent Information
- Application Number
- CN202411995858.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing time series analysis has problems such as high data requirements, sensitive model parameter selection and inability to capture complex relationships in fire protection risk prediction, making it difficult to effectively predict short-term fire protection risks.
Using the fire alarm prediction method based on high-order Markov chains, the high-order Markov chain model is constructed by pre-processing the historical state sequence data of fire equipment, and the model parameters are optimized using a linear planning solver to predict short-term fire alarms. state.
It realizes a rapid analysis of the fuzzy system state under short-term data conditions, can capture the complex relationships of fire protection risks and time delay effects, improves the accuracy and reliability of predictions, and has low computing resource requirements.
Smart Images

Figure CN119397204A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fire safety management technology, and in particular to a fire alarm prediction method and device based on a high-order Markov chain. Background Art
[0002] Since fire is sudden and destructive, it may cause serious casualties and property losses once it occurs. Through scientific and effective fire safety management, prediction and decision-making, we can timely identify and eliminate fire hazards, formulate emergency plans, ensure the normal operation of fire protection facilities and equipment, and improve fire prevention and control and emergency response capabilities. This will not only help reduce the occurrence and harm of fire accidents, but also improve the overall sense of security and ability to respond to emergencies in society, thereby maintaining public safety and social order.
[0003] Currently, a common forecasting method used in fire safety management is time series analysis. Time series analysis is a powerful statistical method used to study data that changes over time. It can identify patterns such as trends, seasonality, and periodicity in the data, thereby predicting future fire risk trends. A time series is a collection of observations arranged in chronological order, such as the number of fire alarms per day. Time series analysis aims to reveal patterns and trends in data for forecasting and decision making.
[0004] However, time series analysis has the following disadvantages: 1: The data requirements are high. Time series analysis requires long enough historical data, and the data should have a certain stability and trend. If the data quality is poor or the historical data is insufficient, it may affect the accuracy and reliability of the analysis. Generally, the input is required to be quantitative data, not fuzzy data, such as the state of the system.
[0005] 2: Sensitive to model parameter selection: Time series analysis involves selecting appropriate models and parameters, including lag order, seasonal cycle, etc. The choice of model parameters has a great impact on the analysis results, but it is usually difficult to determine the best parameters.
[0006] 3: Unable to capture complex relationships: Time series analysis focuses on historical patterns and trends in data, but often fails to capture complex nonlinear relationships and interactions in the data. In fire risk prediction, there may be complex relationships between multiple influencing factors, which are difficult to fully capture with time series analysis.
[0007] Therefore, there is an urgent need for a method to quickly analyze the state of the fuzzy system through short-term data to predict short-term fire risks. Summary of the invention
[0008] In view of this, the present application provides a fire alarm prediction method and device based on a high-order Markov chain, which is used to quickly analyze the fuzzy system state through short-term data to predict short-term fire risks.
[0009] Specifically, the present application is implemented through the following technical solutions: The first aspect of the present application provides a fire alarm prediction method based on a high-order Markov chain, the method comprising: Converting subsequences in the historical state sequence data of the fire-fighting equipment into numerical values to form a first state sequence of the fire-fighting equipment, wherein the historical state sequence data is vector data generated after the fire alarm states are arranged in chronological order, the historical state sequence data includes a plurality of subsequences, each of which represents a fire alarm state at a different time, and the first state sequence includes a plurality of first state numerical values; Determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence; Determine the order of the high-order Markov chain model based on the length of the historical state sequence data, calculate the state transition probability matrix based on the first state sequence, and construct the high-order Markov chain model based on the order and the state transition probability matrix; Solving the objective function under the constraint condition based on a linear programming solver to obtain model parameters of a high-order Markov chain model, and constructing a high-order Markov chain model based on the solution result; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint condition is determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on several first-order subsequences adjacent to the first time period in the first state sequence; The fire alarm status of the first time period is predicted based on a high-order Markov chain model; the length of the first time period is less than the size of the order.
[0010] The second aspect of the present application provides a fire alarm prediction device based on a high-order Markov chain, the device comprising a conversion module, a determination module, a construction module and a prediction module; wherein: The conversion module is used to convert subsequences in the historical state sequence data of the fire-fighting equipment into numerical values to form a first state sequence of the fire-fighting equipment, wherein the historical state sequence data is vector data generated after the fire alarm states are arranged in chronological order, and the historical state sequence data includes a plurality of subsequences, each of which represents the fire alarm state at a different time, and the first state sequence includes a plurality of first state numerical values; The determination module is used to determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence; The determination module is further used to determine the order of the high-order Markov chain model based on the length of the historical state sequence data, calculate the state transition probability matrix based on the first state sequence, and construct the high-order Markov chain model based on the order and the state transition probability matrix; The construction module is used to solve the objective function under the constraint condition based on the linear programming solver to obtain the model parameters of the high-order Markov chain model, and obtain the optimized high-order Markov chain model based on the solution result; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint condition is determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on the first order subsequences adjacent to the first time period in the first state sequence; The prediction module is used to predict the fire alarm status in the first time period based on a high-order Markov chain model; the length of the first time period is smaller than the size of the order.
[0011] The fire alarm prediction method and device based on high-order Markov chain provided by the present application, in the first aspect, by preprocessing the historical state sequence data of the fire equipment, the first state sequence of the fire equipment is obtained, and a Markov chain model is constructed based on the first state sequence, and then the fire alarm state and alarm type of the future date are predicted based on the Markov chain model. Since the historical state sequence data of the fire equipment is fuzzy data, it is difficult to quantify. Compared with the traditional time series analysis that requires quantitative data, the present application realizes the rapid analysis of the fire alarm state based on fuzzy data by processing the fuzzy data. In addition, the present application considers the state of multiple moments, and only needs no more than two weeks of data to achieve short-term prediction, which can capture the time delay effect and long-term trend of fire risk, calculate the state probability in the next few days to weeks, and the computing resource requirements are low. In the second aspect, the Markov chain model constructed by the present application has a more flexible model structure, and can flexibly adjust its own order and state transition probability matrix according to the historical state sequence data to adapt to different data characteristics and prediction requirements, and can more accurately capture the transition relationship between different states, thereby improving the accuracy and reliability of fire risk prediction. In contrast, time series analysis usually requires the selection of specific model types and parameters, which lacks flexibility. Thirdly, since the historical status sequence data of fire-fighting equipment has complex periodic changes and its periodic changes are relatively fast, it may not be possible to fully capture these change patterns through only a first-order Markov chain model. This application uses a high-order Markov chain model and performs linear optimization on the high-order Markov chain model to more accurately capture the dynamic changes and dependencies in the data, thereby improving the accuracy of short-term predictions. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A flowchart of a first embodiment of a fire alarm prediction method based on a high-order Markov chain provided in this application; Figure 2 This is a structural diagram of Example 1 of a fire alarm prediction device based on a high-order Markov chain provided in this application. DETAILED DESCRIPTION
[0013] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0014] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0015] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0016] Specific embodiments are given below to introduce the technical solution of the present application in detail.
[0017] Figure 1 This is a flowchart of the first embodiment of the fire alarm prediction method based on a high-order Markov chain provided by this application. Please refer to Figure 1 , the method provided in this embodiment may include: S101. Convert subsequences in the historical status sequence data of the fire-fighting equipment into numerical values to form a first status sequence of the fire-fighting equipment. The historical status sequence data is vector data generated by arranging the fire alarm status in chronological order. The historical status sequence data includes multiple subsequences, each of which represents the fire alarm status at different times. The first status sequence includes multiple first status numerical values.
[0018] Specifically, the historical state sequence data of the fire-fighting equipment represents the fire alarm state of the fire-fighting equipment at different time points, which is the vector data obtained by arranging the fire alarm state in chronological order. The historical state sequence data includes multiple subsequences, each of which represents the fire alarm state of the fire-fighting equipment at different times, wherein the fire alarm state includes false alarm, alarm, and no alarm, etc. The first state sequence includes multiple first state values, each of which represents a fire alarm state.
[0019] In the specific implementation, each subsequence in the historical state sequence data of the fire-fighting equipment is traversed, and the subsequences are sorted according to the time point recorded in each subsequence. Furthermore, the subsequences are converted into numerical values according to different fire alarm states, that is, the subsequences corresponding to the same fire alarm state are assigned the same numerical value, and the subsequences corresponding to different fire alarm states are assigned different numerical values.
[0020] For example, in combination with the above description, when the fire alarm state is a false alarm, the corresponding value is 0; when the fire alarm state is an alarm, the corresponding value is 1; when the fire alarm state is no alarm, the corresponding value is 2.
[0021] The method provided in this embodiment converts the subsequences in the historical state sequence data into numerical values. On the one hand, numerical data is easier to perform statistical analysis, pattern recognition and predictive modeling. Compared with text or symbols, numerical data can be directly applied to mathematical operations and algorithms, which is convenient for performing complex data processing tasks, such as time series analysis, anomaly detection and trend prediction. On the other hand, since numerical data occupies less storage space, it is faster to read and process. This is particularly important for systems that need to monitor and respond to fire risks in real time. Numerical processing reduces the burden of storage and calculation, and improves the overall performance and response speed of the system. On the third hand, through digitization, the state data of different devices or time points can be standardized, making it easier to compare, summarize and comprehensively analyze. This helps to discover the state change patterns of different devices, or identify the correlation and dependency between multiple devices, thereby improving the accuracy and reliability of fire risk prediction.
[0022] Optionally, the process of acquiring the historical state sequence data includes: (1) Obtaining a target data document; the target data document at least includes historical state sequence data.
[0023] Specifically, the target data document is fire equipment alarm review data, which includes equipment number, equipment type, fire alarm status, alarm type, alarm time, review time, review reason, and review type.
[0024] During specific implementation, the fire equipment alarm review data is read from relevant websites or files.
[0025] (2) The target data files are screened based on the equipment numbers of the fire-fighting equipment to obtain first target data files corresponding to the respective fire-fighting equipment.
[0026] Specifically, the fire equipment alarm review data records data files of different devices, and each device corresponds to a target data file.
[0027] In a specific implementation, based on the equipment number corresponding to the fire-fighting equipment, the equipment number is input in the search bar to filter out the first target data document corresponding to the fire-fighting equipment.
[0028] (3) Extracting status features of the first target data document to obtain historical status sequence data of the fire-fighting equipment.
[0029] Specifically, the historical status sequence data of the fire-fighting equipment includes the fire alarm status and alarm type of the fire-fighting equipment.
[0030] In a specific implementation, the state feature extraction of the first target data document to obtain the historical state sequence data of the fire-fighting equipment includes: format conversion of the historical state sequence data in the first target data document to obtain the first historical state sequence data; the first historical state sequence data includes a date and a fire alarm state corresponding to the date; sorting and classifying the first historical state sequence data based on the date, and numbering the first historical state sequence data based on the result of the sorting and classification; and deduplication and missing processing of the classified first historical state sequence data to obtain the historical state sequence data of the fire-fighting equipment.
[0031] Specifically, the time points recorded in the historical status sequence data include both dates and specific times. When predicting the status of fire-fighting equipment, we only care whether an alarm occurs every day, but not at what specific time of the day the alarm occurs. Therefore, it is necessary to convert the format of the historical status sequence data to remove the specific time. The converted first historical status sequence data only contains the date and the fire alarm status corresponding to the date.
[0032] Further, the first historical state sequence data is sorted in ascending order according to the year, month and day recorded in the date, and each subsequence in the first historical state sequence data is numbered based on the sorting result. Further, the sorted and classified first historical state sequence data is deduplicated, and it is checked whether there are repeated numbers in the first historical state sequence data to eliminate repeated subsequences. The first historical state sequence data after deduplication is processed for missing data, and missing data points are filled or deleted.
[0033] The method provided in this embodiment, on the one hand, removes the moments in the historical state sequence data to obtain the first historical state sequence data containing only the date and the fire alarm state and alarm type corresponding to the date, and represents the time point and state information of each record in a standardized structure, which simplifies the Markov chain model constructed subsequently, and can focus on predicting the alarm probability by day. On the other hand, the first historical state sequence data is sorted and classified based on the date so that the data is arranged in chronological order, which can ensure the temporal continuity and consistency of the data, so as to better analyze the state change trend of the fire-fighting equipment. The classified first historical state sequence data is deduplicated and missing, which can ensure the uniqueness of the data, avoid the deviation of the analysis results due to duplicate data, improve the integrity and reliability of the data, and ensure accurate results in the data analysis and modeling process. In general, by extracting the state features of the first target data document, complete, continuous and accurate historical state sequence data of fire-fighting equipment can be obtained, providing a reliable basis for further analysis and decision-making.
[0034] S102: Determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence.
[0035] Specifically, the state space represents the transition relationship between different first state values, and the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence.
[0036] In specific implementation, the first state sequence is traversed to determine the number of different first state values in the first state sequence. Based on the number of different first state values determined, the number is used as the number of rows and columns of the state space to determine the size of the state space. The transition relationship of different first state values is determined by the row number and column number as the state space value of the corresponding row and column in the state space.
[0037] S103: determining the order of a high-order Markov chain model based on the length of the historical state sequence data, calculating a state transition probability matrix based on the first state sequence, and constructing a high-order Markov chain model based on the order and the state transition probability matrix.
[0038] Specifically, the high-order Markov chain model is used to describe the random changes of a system between a series of states. The order of the high-order Markov chain model determines how many past states the future state of the system is related to. The higher the order, the more states there are, and the complexity increases accordingly. When the order is 1, the future state depends only on the current state and has nothing to do with the previous state. When the order is 2, the future state depends on the current state and the previous state. When the order is k, the future state depends on the current state and the previous k-1 states.
[0039] In a specific implementation, the method of determining the order of a high-order Markov chain model based on the length of the historical state sequence data includes: traversing the historical state sequence data to determine the length of the historical state sequence data; the length represents the number of subsequences contained in the historical state sequence data; determining the range of the order of the Markov chain based on the length of the historical state sequence data; the length of the historical state sequence data is positively correlated with the size of the order; dividing the historical state sequence data into a training set and a validation set according to a preset ratio, cross-validating the high-order Markov chain model corresponding to each order for the range of the order, calculating the average validation error, and determining the order corresponding to the high-order Markov chain model with the smallest average validation error as the order of the high-order Markov chain model.
[0040] Specifically, the length of the historical state sequence data is positively correlated with the order of the high-order Markov chain model. Within a certain range, the longer the length of the historical state sequence data, the greater the order of the high-order Markov chain model, and the shorter the length of the historical state sequence data, the smaller the order of the high-order Markov chain model. The preset ratio is set according to actual needs, and is not limited in this embodiment. For example, in one embodiment, the preset ratio is 4:1.
[0041] In the specific implementation, the historical state sequence data is traversed to determine the number of subsequences contained in the historical state sequence data, that is, the length of the historical state sequence data. By fitting the length of the historical state sequence data, based on the changing relationship between the length and the order of the high-order Markov chain model, the range of the order of the high-order Markov chain model is obtained. Further, the historical state sequence data is divided into a training set and a validation set according to a preset ratio, and the high-order Markov chain model is trained with the training set starting from the minimum value of the order. After the training is completed, the performance of the high-order Markov chain model is verified using the validation set, and its average validation error is calculated. The value of the order is increased, and the training process is repeated until the order reaches the maximum value. By comparing the corresponding average validation errors under all orders, the order corresponding to the high-order Markov chain model with the smallest average validation error is determined as the order of the high-order Markov chain model.
[0042] Optionally, determining the order of the high-order Markov chain model based on the length of the historical state sequence data includes: determining the number of subsequences in the historical state sequence data; determining the order of the high-order Markov chain model as the maximum order according to the number and proportion of the subsequences; determining candidate historical state sequence data within the maximum order time period before the first time period; fitting the changing trend in the candidate historical state sequence data, and eliminating abnormal data in the candidate historical state sequence data according to the changing trend, the difference between the abnormal data and the changing trend is greater than a preset value; determining the order of the high-order Markov chain model according to the historical state sequence data after eliminating the abnormal data.
[0043] The method provided in this embodiment, firstly, through subsequence division and change situation fitting, the high-order Markov chain model can automatically identify the pattern complexity in the historical state sequence data, and then automatically adjust the order to avoid manual adjustment errors, and the generalization effect on different data sets is better. In addition, the reasonable order selection avoids the overfitting problem caused by too large an order. If the order is too large, the high-order Markov chain model will pay attention to too much historical data, and may also learn noise or abnormal states as patterns, affecting the prediction effect. In the second aspect, the generalization ability of the model can be improved by eliminating outliers and reasonable maximum order constraints. By reasonably determining the order of the high-order Markov chain, the high-order Markov chain model can better capture the long-term dependent features in the historical sequence. The high-order Markov chain model predicts future states through longer historical state sequence data, which is particularly effective when there is a complex dependency relationship between states. In addition, there are often outliers or mutations in the historical state sequence data, which directly affect the fitting and order selection of the high-order Markov chain model. After removing these abnormal data, the trend of the data can be reflected more realistically, making the high-order Markov chain model more robust and reducing the interference of noise on the model order.
[0044] Furthermore, the calculating of the state transition probability matrix based on the first state sequence includes: (1) Traversing the first state sequence to determine different categories of fire alarm states included in the first state sequence.
[0045] Specifically, in combination with the above description, the first state sequence includes a plurality of first state values, each of which represents a fire alarm state, that is, the first state sequence includes a plurality of fire alarm states.
[0046] In a specific implementation, each first state value in the first state sequence is traversed to count different types of fire alarm states included in the first state sequence.
[0047] For example, in one embodiment, the first state sequence is {0, 1, 1, 1, 0, 0, 1}, which contains two different types of fire alarm states, namely 0 and 1.
[0048] (2) Based on the first state sequence, all ordered state groups are determined; the ordered state groups represent state transitions between different categories of fire alarm states.
[0049] Specifically, the ordered state group is composed of two consecutive first state values in the first state sequence, which represents the state transition between different categories of fire alarm states.
[0050] For example, in combination with the above example, the first state sequence is {0, 1, 1, 1, 0, 0, 1}, which includes 2 different types of fire alarm states, 0 and 1. At this time, the ordered state group includes (0, 0), (0, 1), (1, 0), (1, 1).
[0051] (3) Traversing the first state sequence and determining the number of each of the ordered state groups.
[0052] In a specific implementation, the first state sequence is traversed to determine the number of each ordered state group in the first state sequence.
[0053] For example, combining with the above example, when the first state sequence is {0, 1, 1, 1, 0, 0, 1}, and the ordered state group includes (0, 0), (0, 1), (1, 0), (1, 1), the number of each ordered state in the first state sequence is: (0, 0) 1 time, (0, 1) 2 times, (1, 0) 1 time, (1, 1) 2 times.
[0054] (4) constructing a state transition frequency matrix based on the number of each ordered state group and the number of fire alarm states of different categories; each element in the state transition frequency matrix represents the number of each state transition situation; and the size of the state transition frequency matrix is related to the number of fire alarm states of different categories.
[0055] Specifically, each element of the state transition frequency matrix represents the number of each ordered state group, that is, the number of each state transition situation. The size of the state transition frequency matrix is positively correlated with the different categories of fire alarm states contained in the first state sequence.
[0056] In specific implementation, according to the number of each ordered state group, the number of each ordered state group is filled into each column of the state transition frequency matrix in order, wherein the number of columns of the state transition frequency matrix is determined by the different types of fire alarm states included in the first state sequence. For example, if the first state sequence includes 2 different fire alarm states, the state transition frequency matrix is a matrix of 2 rows and 2 columns.
[0057] For example, combining the above example, the first state sequence is {0, 1, 1, 1, 0, 0, 1}, the ordered state group includes (0, 0), (0, 1), (1, 0), (1, 1), and the number of each ordered state in the first state sequence is: (0, 0) 1 time, (0, 1) 2 times, (1, 0) 1 time, (1, 1) 2 times. At this time, the state transition frequency matrix is .
[0058] (5) The state transition frequency matrix is normalized to obtain a state transition probability matrix.
[0059] Specifically, each element of the state transition probability matrix represents the probability of each state transition situation accounting for all state transition situations, and the size of the state transition probability matrix is related to the number of different categories of fire alarm states included in the first state sequence.
[0060] In a specific implementation, the state transition frequency matrix is normalized to obtain a state transition probability matrix, including: traversing the state transition frequency matrix to determine the number of each state transition situation and the number of all state transition situations; based on the number of each state transition situation and the number of all state transition situations, calculating the proportion of each state transition situation to all state transition situations; constructing a state transition probability matrix based on the proportion and the number of fire alarm states of different categories; each element in the state transition probability matrix represents the probability of each state transition situation to all state transition situations, and the size of the state transition probability matrix is related to the number of fire alarm states of different categories.
[0061] Specifically, the state transition frequency matrix is traversed to determine the number of each ordered state group, that is, the number of each state transition situation, and then the number of all state transition situations in each column of the state transition frequency matrix is added to obtain the number of all state transition situations in each column. Further, the proportion of each state transition situation to all state transition situations in each column is calculated, and the proportion is filled into each column of the state transition probability matrix in order. Among them, the number of columns of the state transition probability matrix is determined by the different categories of fire alarm states contained in the first state sequence. For example, if the first state sequence contains 2 different states, the state transition probability matrix is a matrix of 2 rows and 2 columns.
[0062] For example, combining the above example, the state transition frequency matrix is When , the state transition probability matrix is .
[0063] Furthermore, a high-order Markov chain model is constructed based on the order of the high-order Markov chain and the state transition probability matrix. The high-order Markov chain model can be determined according to the following formula: ; Among them, the for The Markov chain model of for - The Markov chain model of is the starting time of the historical sequence; The final moment of the historical sequence; is the time of the state to be predicted; is the order of the high-order Markov chain model; is the model parameter of the high-order Markov chain model; for The product of state transition probability matrices; The system status.
[0064] The method provided in this embodiment, the high-order Markov chain model has a more flexible model structure, and can flexibly adjust its order and state transition probability matrix according to the historical state sequence data to adapt to different data characteristics and prediction requirements, and can more accurately capture the transition relationship between different states, thereby improving the accuracy and reliability of fire risk prediction. In contrast, time series analysis usually requires the selection of specific model types and parameters, which lacks flexibility.
[0065] S104. Solve the objective function under the constraint conditions based on a linear programming solver to obtain model parameters of the high-order Markov chain model, and obtain an optimized high-order Markov chain model based on the solution results; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint conditions are determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on several first-order subsequences adjacent to the first time period in the first state sequence.
[0066] Specifically, the model parameters of the high-order Markov chain model represent the linear combination parameters of each subsequence, and the objective function is used to solve the model parameters of the high-order Markov chain model, which is determined by the state transition probability matrix and the first state sequence. The constraint condition is used to constrain the stable state in the first state sequence, which is determined by the first state sequence.
[0067] Furthermore, the constraints include non-negativity constraints, steady state constraints, frequency constraints and probability normalization constraints. On the basis of setting the objective function (such as minimizing the sum of the elements of the state transition probability matrix), non-negativity constraints, steady state constraints, frequency constraints and probability normalization constraints are added, and the optimal transition probability matrix under these constraints is solved by the linear programming solver to obtain the model parameters that meet the requirements.
[0068] In a specific implementation, solving the objective function under the constraint condition based on the linear programming solver includes: (1) Based on the order of the high-order Markov chain model, a first state value in a preset number of continuous stable states is selected from the first state sequence; the difference between the preset number and the order is 1, and the preset number is greater than the order; the stable state represents the probability of different fire alarm states in the first state sequence.
[0069] Specifically, the difference between the preset number and the order of the high-order Markov chain model is 1, and the preset number is greater than the order. Each first state value represents a fire alarm state. The steady state refers to the probability of different fire alarm states in the first state sequence, which can be expressed as: , wherein the For a stable state, the , , Different fire alarm states in the first state sequence.
[0070] In a specific implementation, a preset number of continuous first state values in a stable state are selected from the first state sequence.
[0071] (2) Determining an objective function based on the first state value, the state transition probability matrix, and model parameters corresponding to the state transition probability matrix.
[0072] In a specific implementation, the objective function is determined based on the first state value, the state transition probability matrix, and the model parameters corresponding to the state transition probability matrix, including: determining the product of each first state value except the target first state value and the state transition probability matrix and the model parameters corresponding to the state transition probability matrix as an intermediate parameter; the target first state value is the first state value with the largest number; and determining the difference between the target first state value and each of the intermediate parameters as the objective function.
[0073] Specifically, in combination with the above description, each first state value corresponds to a power representation of a state transition probability matrix. Since the first state values selected from the first state sequence are arranged in order, the target first state value represents the first state value with the largest number among the first state values.
[0074] In specific implementation, taking the second-order Markov chain model as an example, when the training set length is 7 days and the state time unit is day, the objective function can be determined according to the following formula: , ; Wherein, A is the objective function; is the model parameter; , , is a preset number of first state data selected from the first state sequence and arranged in descending order; and P is a state transition probability matrix.
[0075] (3) Determining constraint conditions based on the stable state.
[0076] In specific implementation, the constraints can be determined based on the following formula: ; in, , , ; Among them, the is the first state value; is the power representation of the state transition probability matrix corresponding to the first state value; is the power representation of the state transition probability matrix corresponding to the first state value; is a column vector of all 1s, is the constraint matrix, and the objective function and model parameters Composition, the is the order of the high-order Markov chain model.
[0077] (4) Solving the objective function under the constraint conditions based on a linear programming solver to obtain a solution result; the solution result includes optimal model parameters; the number of the optimal model parameters is the same as the order.
[0078] Specifically, the number of optimal model parameters is determined by the order of the high-order Markov chain model, and the number of optimal model parameters is the same as the order of the high-order Markov chain model.
[0079] In the specific implementation, based on the determined objective function and constraints, the objective function, constraints, and the value range of each variable in the objective function are input into the linear programming solver, and the solution result is output based on the built-in solution method in the linear programming solver.
[0080] The method provided in this embodiment, on the one hand, determines the objective function and constraints based on the state transition probability matrix, and uses a linear programming solver to solve the objective function under the constraints, so as to obtain the optimal model parameters, and constructs a Markov chain model based on the optimal model parameters, which can improve the accuracy and reliability of fire risk prediction. On the other hand, the objective function and constraints are determined based on the state transition probability matrix, which is different from the traditional linear programming solution method, which assumes that the objective function is linear, that is, the relationship between decision variables is addition and multiplication, and the constraints are also required to be linear, which may not be flexible enough for complex real-world problems. The constraints in many practical problems are nonlinear or involve complex relationships. Therefore, the present application is adapted to more complex and dynamic real-world scenarios, and can handle large-scale problems and nonlinear complex relationships.
[0081] S105. Predicting the fire alarm status of the first time period based on the high-order Markov chain model; the length of the first time period is smaller than the order.
[0082] Specifically, the high-order Markov chain model is used to predict the fire alarm state of the first time period based on the first order subsequences adjacent to the first time period in the first state sequence. The first time period is set according to actual needs and is not limited in this embodiment. It should be noted that the length of the first time period is usually less than the order of the high-order Markov chain model. For example, the first time period is 1 day, and the order of the high-order Markov chain model is 4, that is, the fire alarm state of the next day is predicted by the fire alarm state of the past 4 days.
[0083] In a specific implementation, the subsequences of the first state sequence that are arranged in front of the first time period are input into the high-order Markov chain model, and the high-order Markov chain model outputs the state probability of the first time period (including the fire alarm state probability), and the fire alarm state with the largest state probability is determined as the fire alarm state of the first time period.
[0084] The fire alarm prediction method based on high-order Markov chain provided in this embodiment, firstly, by preprocessing the historical state sequence data of the fire equipment, the first state sequence of the fire equipment is obtained, and a Markov chain model is constructed based on the first state sequence, and then the fire alarm state and alarm type of the future date are predicted based on the Markov chain model. Since the historical state sequence data of the fire equipment is fuzzy data, it is difficult to quantify. Compared with the traditional time series analysis which requires quantitative data, this application realizes the rapid analysis of the fire alarm state based on fuzzy data by processing the fuzzy data. In addition, this application considers the state of multiple moments, and only needs no more than two weeks of data to realize short-term prediction, which can capture the time delay effect and long-term trend of fire risk, calculate the state probability in the next few days to weeks, and the computing resource requirements are low. Secondly, the Markov chain model constructed in this application has a more flexible model structure, and can flexibly adjust its own order and state transition probability matrix according to the historical state sequence data to adapt to different data characteristics and prediction requirements, and can more accurately capture the transition relationship between different states, thereby improving the accuracy and reliability of fire risk prediction. In contrast, time series analysis usually requires the selection of specific model types and parameters, which lacks flexibility. On the third hand, since the historical state sequence data of fire-fighting equipment has complex periodic changes and its periodic changes are fast, it may not be possible to fully capture these change patterns only through the first-order Markov chain model. This application uses a high-order Markov chain model and linearly optimizes the high-order Markov chain model to more accurately capture the dynamic changes and dependencies in the data, thereby improving the accuracy of short-term predictions. On the fourth hand, by converting the subsequences in the historical state sequence data into numerical values, the numerical data is easier to perform statistical analysis, pattern recognition and predictive modeling. Compared with text or symbols, numerical data can be directly applied to mathematical operations and algorithms, which is convenient for performing complex data processing tasks such as time series analysis, anomaly detection and trend prediction. Moreover, since numerical data occupies less storage space, it is faster to read and process. This is particularly important for systems that need to monitor and respond to fire risks in real time. Numerical processing reduces the burden of storage and calculation, and improves the overall performance and response speed of the system. In addition, through digitization, the state data of different devices or time points can be standardized, making it easier to compare, summarize and comprehensively analyze. This helps to discover the status change patterns of different equipment, or identify the correlation and dependency between multiple equipment, thereby improving the accuracy and reliability of fire risk prediction.Fifthly, by removing the moments in the historical status sequence data, we obtain the first historical status sequence data containing only the date and the fire alarm status and alarm type corresponding to the date. The time point and status information of each record are represented in a standardized structure, which simplifies the subsequent Markov chain model and allows us to focus on predicting the alarm probability by day, reducing the amount of calculation of the model and improving the accuracy and reliability of the prediction.
[0085] Corresponding to the aforementioned embodiment of a fire alarm prediction method based on a high-order Markov chain, the present application also provides an embodiment of a fire alarm prediction device based on a high-order Markov chain.
[0086] Figure 2 This is a structural diagram of the first embodiment of the fire alarm prediction device based on a high-order Markov chain provided by this application. Figure 2 , the device provided in this embodiment includes a conversion module 210, a determination module 220, a construction module 230 and a prediction module 240; wherein, The conversion module 210 is used to convert subsequences in the historical state sequence data of the fire-fighting equipment into numerical values to form a first state sequence of the fire-fighting equipment, wherein the historical state sequence data is vector data generated after the fire alarm states are arranged in chronological order, and the historical state sequence data includes a plurality of subsequences, each of which represents the fire alarm state at a different time, and the first state sequence includes a plurality of first state numerical values; The determination module 220 is used to determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence; The determination module 220 is further configured to determine the order of the high-order Markov chain model based on the length of the historical state sequence data, calculate a state transition probability matrix based on the first state sequence, and construct a high-order Markov chain model based on the order and the state transition probability matrix; The construction module 230 is used to solve the objective function under the constraint condition based on the linear programming solver to obtain the model parameters of the high-order Markov chain model, and obtain the optimized high-order Markov chain model based on the solution result; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint condition is determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on the first order subsequences adjacent to the first time period in the first state sequence; The prediction module 240 is used to predict the fire alarm status in the first time period based on a high-order Markov chain model; the length of the first time period is smaller than the order.
[0087] The device of this embodiment can be used to perform Figure 1 The steps, specific implementation principles and implementation processes of the method embodiment shown are similar and will not be repeated here.
[0088] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0089] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0090] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A fire alarm prediction method based on a high-order Markov chain, characterized in that: The method comprises: Converting subsequences in the historical state sequence data of the fire-fighting equipment into numerical values to form a first state sequence of the fire-fighting equipment, wherein the historical state sequence data is vector data generated after the fire alarm states are arranged in chronological order, the historical state sequence data includes a plurality of subsequences, each of which represents a fire alarm state at a different time, and the first state sequence includes a plurality of first state numerical values; Determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence; Determine the order of the high-order Markov chain model based on the length of the historical state sequence data, calculate the state transition probability matrix based on the first state sequence, and construct the high-order Markov chain model based on the order and the state transition probability matrix; Solving the objective function under the constraint condition based on a linear programming solver to obtain model parameters of the high-order Markov chain model, and obtaining an optimized high-order Markov chain model based on the solution result; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint condition is determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on several first-order subsequences adjacent to the first time period in the first state sequence; The fire alarm status of the first time period is predicted based on the high-order Markov chain model; the length of the first time period is less than the size of the order.
2. The method according to claim 1, characterized in that The step of solving the objective function under the constraint condition based on the linear programming solver includes: Based on the order of the high-order Markov chain model, a first state value of a preset number of continuous stable states is selected from the first state sequence; the difference between the preset number and the order is 1, and the preset number is greater than the order; the stable state represents the probability of different fire alarm states in the first state sequence; Determine an objective function based on the first state value, the state transition probability matrix, and model parameters corresponding to the state transition probability matrix; determining a constraint condition based on the stable state; The objective function under the constraint condition is solved based on a linear programming solver to obtain a solution result; the solution result includes optimal model parameters; the number of the optimal model parameters is the same as the order.
3. The method according to claim 2, characterized in that The determining of the objective function based on the first state value, the state transition probability matrix, and the model parameters corresponding to the state transition probability matrix includes: Determine the product of each first state value except the target first state value, the state transition probability matrix, and the model parameter corresponding to the state transition probability matrix as an intermediate parameter; the target first state value is the first state value with the largest number; The difference between the target first state value and each of the intermediate parameters is determined as the objective function.
4. The method according to claim 1, characterized in that The process of acquiring the historical state sequence data includes: Acquire a target data document; the target data document at least includes historical state sequence data; The target data files are screened based on the equipment numbers of the fire-fighting equipment to obtain first target data files corresponding to the respective fire-fighting equipment; State feature extraction is performed on the first target data document to obtain historical state sequence data of the fire-fighting equipment.
5. The method according to claim 4, characterized in that The state feature extraction of the first target data document to obtain historical state sequence data of the fire-fighting equipment includes: Performing format conversion on the historical state sequence data in the first target data document to obtain first historical state sequence data; the first historical state sequence data includes a date and a fire alarm state corresponding to the date; Sorting and classifying the first historical state sequence data based on date, and numbering the first historical state sequence data based on the results of the sorting and classification; The classified first historical state sequence data is deduplicated and deleted to obtain historical state sequence data of the fire-fighting equipment.
6. The method according to claim 1, characterized in that The step of determining the order of the high-order Markov chain model based on the length of the historical state sequence data comprises: Traversing the historical state sequence data to determine the length of the historical state sequence data; the length represents the number of subsequences contained in the historical state sequence data; Determining the range of the order of the Markov chain based on the length of the historical state sequence data; the length of the historical state sequence data is positively correlated with the size of the order; The historical state sequence data is divided into a training set and a validation set according to a preset ratio, and a high-order Markov chain model corresponding to each order is cross-validated for the range of the order, and an average validation error is calculated, and the order corresponding to the high-order Markov chain model with the smallest average validation error is determined as the order of the high-order Markov chain model.
7. The method according to claim 1, characterized in that The calculating a state transition probability matrix based on the first state sequence includes: Traversing the first state sequence to determine different types of fire alarm states included in the first state sequence; Based on the first state sequence, determining all ordered state groups; the ordered state groups represent state transitions between different types of fire alarm states; Traversing the first state sequence, and determining the number of each of the ordered state groups; A state transition frequency matrix is constructed based on the number of each ordered state group and the number of fire alarm states of different categories; each element in the state transition frequency matrix represents the number of each state transition situation; and the size of the state transition frequency matrix is related to the number of fire alarm states of different categories; The state transition frequency matrix is normalized to obtain a state transition probability matrix.
8. The method according to claim 7, characterized in that The normalizing process of the state transition frequency matrix to obtain a state transition probability matrix includes: Traversing the state transition frequency matrix to determine the number of each state transition situation and the number of all state transition situations; Based on the number of each state transition situation and the number of all state transition situations, calculate the proportion of each state transition situation to all state transition situations; A state transition probability matrix is constructed based on the ratio and the number of fire alarm states of different categories; each element in the state transition probability matrix represents the probability of each state transition situation accounting for all state transition situations, and the size of the state transition probability matrix is related to the number of fire alarm states of different categories.
9. The method according to claim 1, characterized in that: The step of determining the order of the high-order Markov chain model based on the length of the historical state sequence data comprises: Determining the number of subsequences in the historical state sequence data; Determining the order of the high-order Markov chain model as the maximum order according to the number and proportion of the subsequences; Determine candidate historical state sequence data within the maximum order time period before the first time period; Fitting the change trend in the candidate historical state sequence data, and eliminating abnormal data in the candidate historical state sequence data according to the change trend, wherein the difference between the abnormal data and the change trend is greater than a preset value; The order of the high-order Markov chain model is determined based on the historical state sequence data after removing abnormal data.
10. A fire alarm prediction device based on a high-order Markov chain, characterized in that: The device comprises a conversion module, a determination module, a construction module and a prediction module; wherein, The conversion module is used to convert subsequences in the historical state sequence data of the fire-fighting equipment into numerical values to form a first state sequence of the fire-fighting equipment, wherein the historical state sequence data is vector data generated after the fire alarm states are arranged in chronological order, and the historical state sequence data includes a plurality of subsequences, each of which represents the fire alarm state at a different time, and the first state sequence includes a plurality of first state numerical values; The determination module is used to determine a state space based on the first state sequence of the fire-fighting equipment; the size of the state space is consistent with the number of all change combinations between adjacent data in the first state sequence; The determination module is further used to determine the order of the high-order Markov chain model based on the length of the historical state sequence data, calculate the state transition probability matrix based on the first state sequence, and construct the high-order Markov chain model based on the order and the state transition probability matrix; The construction module is used to solve the objective function under the constraint condition based on the linear programming solver to obtain the model parameters of the high-order Markov chain model, and obtain the optimized high-order Markov chain model based on the solution result; the objective function is determined based on the state transition probability matrix and the first state sequence, the constraint condition is determined based on the first state sequence, and the high-order Markov chain model is used to predict the fire alarm state of the first time period based on the first order subsequences adjacent to the first time period in the first state sequence; The prediction module is used to predict the fire alarm status in the first time period based on a high-order Markov chain model; the length of the first time period is smaller than the size of the order.
Citation Information
Patent Citations
New markovian-sequence generator and new methods of generating markovian sequences
CN101950377A
Prediction method and device for alarm in service operation and maintenance and electronic equipment
CN111124840A
Method for analyzing and predicting machine room fault by utilizing Markov model
CN112132195A
Dynamic map matching method based on high-order hidden Markov model
CN112632202A
Real-time available inertia probability prediction method and system of power system, and medium
CN117394340A
Cited By
Alarm information fault positioning method and system based on Markov reasoning
CN121690995A