Intelligent city central data fusion calculation model training method, early warning method and equipment based on MOE architecture
The MOE architecture's smart city hub data fusion computing model solves the difficulty of monitoring complex urban problems with existing technologies, achieves multi-dimensional data fusion early warning, and improves the efficiency and accuracy of urban management.
Patent Information
- Application Number
- CN202410833176.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Existing urban event early warning methods based on keywords and emotional values of historical events are difficult to effectively monitor and warn complex and common problems such as traffic congestion and environmental pollution. They lack intelligent multi-modal data fusion technology to improve urban management efficiency.
Adopt a smart city hub data fusion computing model based on MOE architecture, build a multi-modal event early warning model through multi-dimensional data collection, preprocessing, feature extraction and gated network fusion, and dynamically adjust the weight of the expert model to improve prediction accuracy and versatility sex.
It realizes the integrated monitoring and early warning of multi-dimensional urban data, improves the accuracy and efficiency of urban management, and can promptly detect and respond to high-frequency problems such as transportation and environment.
Smart Images

Figure CN118734247A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of urban event warning, and in particular to a smart city hub data fusion computing model training method, warning method and equipment based on MOE architecture. Background Art
[0002] With the acceleration of urbanization, traditional urban management methods can no longer meet the increasingly complex urban management needs. Urban management is facing more and more management challenges and problems. Frequent and frequent practical problems such as traffic congestion, environmental pollution, and safety hazards have seriously affected the operation efficiency of the city and the quality of life of residents. Monitoring and early warning of these frequent and frequent problems have become the key links of urban management.
[0003] With the acceleration of the construction of smart cities, early warning schemes based on data classification or risk level division based on semantic recognition have also begun to be applied to urban management and prevention. However, these existing early warning methods can only classify and warn key risk types based on keywords and sentiment values in historical urban events; obviously, this classification and warning of key risk types is very one-sided, and it is difficult to apply it to relatively daily and common urban management issues such as traffic congestion and environmental pollution. Therefore, there is an urgent need for an intelligent multimodal event data fusion monitoring and early warning technology to achieve timely discovery, analysis and response to problems in urban operations, so as to improve the level and efficiency of urban management. Summary of the invention
[0004] In order to overcome the deficiencies of the prior art, the present invention provides a city event warning model training method, a warning method and a device based on multimodal event data fusion monitoring and MOE as the architecture.
[0005] In order to achieve the above-mentioned purpose, the present invention provides a method for training a data fusion computing model of a smart city hub based on an MOE architecture, the method comprising: collecting and preprocessing multi-dimensional raw data involved in urban operation management, and constructing a corresponding dimensional data monitoring network based on multiple sub-dimensional data contained in each dimension after preprocessing, wherein the multi-dimensional data includes a traffic dimension, an environmental dimension, and a safety dimension;
[0006] Obtain sub-dimensional data of multiple samples of each dimensional data monitoring network within a set historical time period to form sample data;
[0007] Extract features from sample data. Feature extraction includes temporal feature extraction and spatial feature extraction for each sample sub-dimensional data in each dimension, and event-related feature extraction that characterizes the association between multiple dimensions of the same sample. Event-related features refer to the association between one or more sub-dimensions in one dimension and the sub-dimensions of the sample in other dimensions.
[0008] Constructing an early warning model based on the MOE architecture, the early warning model includes multiple expert models corresponding to the extracted features and a gating network that dynamically assigns prediction weights to each expert model based on its output;
[0009] The early warning model is trained based on multiple features of the extracted sample data, and the parameters of each expert model and the weight bias parameters of the gating network are determined to form an urban event early warning model. The output of the early warning model is the result of weighted fusion of multiple expert models based on the prediction weights dynamically assigned by the gating network.
[0010] According to one embodiment of the present invention, when performing spatial feature extraction, the city is divided into grids or regions, and spatial feature extraction is performed in each grid or region through sample similarity based on Euclidean distance and sample clustering based on spatial autocorrelation analysis. The spatial features include spatial location data of traffic congestion points and spatial location data of accident-prone areas that characterize the traffic dimension, pollution source location data and air quality monitoring site data that characterize the environmental dimension, and crime hotspot location data and camera monitoring coverage data that characterize the safety dimension.
[0011] According to an embodiment of the present invention, the similarity feature extraction between samples based on Euclidean distance is calculated using the following formula:
[0012]
[0013] Among them, x i ,x j represents the sample data of sample point i and sample point j in the sub-dimension x; i,k ,x j,k represents the coordinate values of sample points i and j in spatial dimension k; h represents the number of spatial dimensions, d(x i ,x j ) The smaller the value, the smaller the x i ,x j The closer the positions of two sample data in the feature space are, the higher their similarity is. The larger the d(xi,xj) value is, the closer the position of two sample data in the feature space is, the higher their similarity is. i ,x j The farther two sample data are located in the feature space, the lower their similarity is.
[0014] According to an embodiment of the present invention, the following formula is used to perform spatial autocorrelation analysis to determine the aggregation or dispersion of sample data in space:
[0015]
[0016] Where n represents the sample data size; x i ,x jRepresents the sample data of sample point i and sample point j in the sub-dimension x; Represents the mean of all sample data in the x dimension; ω ij It represents the spatial weight, with a value of 0 or 1. The non-spatial proximity value is 0, and the spatial proximity value is 1. I represents the Moran index, with a value range of [-1,1]. The closer |I| is to 1, the more obvious the spatial correlation is, and the closer |I| is to 0, the less relevant the spatial correlation is.
[0017] According to an embodiment of the present invention, when extracting event-related features:
[0018] Acquire multiple historical warning events, and extract sub-dimension data of each historical warning event under multiple dimensions to construct an initial associated item set;
[0019] Calculate the support of each sub-dimension in the initial associated item set based on multiple historical warning events;
[0020] Based on the preset confidence threshold, the initial associated item set is scanned to obtain sub-dimensions with support higher than the support threshold and are combined in pairs to form new candidate associated item sets;
[0021] Scan new candidate associated item sets based on a preset support threshold to generate new candidate associated item sets again, and repeat the above steps until no new candidate associated item sets are generated;
[0022] The confidences between the multiple sub-dimensions in the last new candidate association item set are calculated, and a most relevant set of association relationships is determined based on a preset confidence threshold to form an event association feature that characterizes the association relationship between the sub-dimensions.
[0023] According to an embodiment of the present invention, event correlation feature extraction also includes data correlation analysis, and its calculation formula is as follows:
[0024]
[0025] Where n represents the number of sample data, x i Represents the sample data of sample point i in the sub-dimension x, Represents the mean of all sample data in the x dimension; y i Represents the sample data of the i-th sample in the sub-dimension y, |r| represents the mean of all sample data on the y dimension; r represents the Pearson correlation coefficient, r>0 indicates that the two sub-dimensions x and y are positively correlated; r<0 indicates that the two sub-dimensions x and y are negatively correlated; the closer |r| is to 1, the stronger the linear relationship between the two sub-dimensions x and y is, and the closer |r| is to 0, the weaker the linear relationship between the two sub-dimensions x and y is.
[0026] According to an embodiment of the present invention, when training the early warning model based on multiple features of the extracted sample data, the prediction output E of each expert model is i (x) is transformed as follows:
[0027] z i =W g E i (x)+b g
[0028] Among them, W g is the gating network weight matrix, and its prediction output E of the i-th expert model i (x) is mapped to the weight space to determine the selection probability of each expert model; b g represents the gating network bias vector, which is used to adjust the output z of the linear transformation i To adapt it to the predicted output E i (x) distribution; optimize the gated network weight matrix W when training the gated network g and the gating network bias vector b g ;
[0029] Determine the gating network weight matrix W during training g and the gating network bias vector b g The gated network weight is then calculated using the Softmax activation function; the calculation formula is as follows:
[0030]
[0031] Among them, g i (x) represents the gating network weight of the i-th expert model, z i represents the linear transformation result of the prediction output of the i-th expert model, and N represents the number of expert models.
[0032] According to an embodiment of the present invention, a moving average algorithm and / or an autoregressive moving average model is used to extract the time series features of each sample sub-dimensional data in each dimension.
[0033] On the other hand, the present invention also provides a city event early warning method based on the MOE architecture, the method comprising:
[0034] Obtain the data to be predicted in multiple sub-dimensions within the data monitoring network of each dimension;
[0035] The early warning model trained by the above-mentioned smart city central data fusion computing model training method based on the MOE architecture is used to predict the data to be predicted in multiple sub-dimensions within the acquired data monitoring network of each dimension to obtain a multi-dimensional network early warning result.
[0036] On the other hand, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, it implements the steps of the above-mentioned smart city hub data fusion calculation model training method or prediction method based on the MOE architecture.
[0037] In summary, the intelligent city hub data fusion computing model training method, early warning method and equipment provided by the present invention based on the MOE architecture use multi-source multi-modal data fusion technology to integrate various data generated in urban operation management, including but not limited to traffic data, environmental data, safety and other multi-dimensional structured data or unstructured data, to build a multi-source multi-modal fusion data lake platform for urban hub data. Furthermore, based on the multi-modal and multi-dimensional characteristics of the prediction data, in order to avoid the prediction interference caused by the differences between features of different dimensions, the prediction model is set to be a multi-modal event data monitoring and early warning model for the city hub based on the MOE (Mixture of Experts) architecture. The gated network within the model can dynamically adjust the weights of each expert model based on the input data, greatly improving the accuracy of the model prediction and its versatility in multi-modal data.
[0038] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The figure is a flow chart of a method for training a smart city hub data fusion computing model based on the MOE architecture provided in one embodiment of the present invention.
[0040] Figure 2 Shown Figure 1 Schematic diagram of the process of event-related feature extraction in .
[0041] Figure 3 The figure is a flow chart of a city event early warning method based on MOE architecture provided in one embodiment of the present invention.
[0042] Figure 4 The figure shows a principle frame of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] like Figure 1As shown, the training method of the intelligent city hub data fusion calculation model based on the MOE architecture provided in this embodiment includes: collecting and preprocessing the multi-dimensional raw data involved in the city operation management, and constructing a corresponding dimensional data monitoring network based on the multiple sub-dimensional data contained in each dimension after preprocessing, and the multiple dimensions include traffic dimension, environmental dimension and safety dimension (step S10). Obtain the sub-dimensional data of multiple samples of each dimensional data monitoring network within a set historical time period to form sample data (step S20). Feature extraction is performed on the preprocessed sample data, and the feature extraction includes time series feature extraction and spatial feature extraction for each sample sub-dimensional data in each dimension, and event association feature extraction that characterizes the association relationship between the same sample in multiple dimensions. The event association feature refers to the association relationship between one or more sub-dimensions in one dimension and the sub-dimensions in other dimensions of the sample (step S30). Construct an early warning model based on the MOE architecture, which includes multiple expert models corresponding to the extracted features and a gating network that dynamically assigns prediction weights to each expert model based on the output (step S40). Based on multiple features of the extracted sample data, a warning model is trained to determine the parameters of each expert model and the weight bias parameters of the gating network to form an urban event warning model. The output of the warning model is the result of weighted fusion of multiple expert models based on the prediction weights dynamically assigned by the gating network (step S50).
[0044] The following will be combined Figure 1 and Figure 2 The principles of the smart city hub data fusion computing model training method based on the MOE architecture provided in this embodiment are described in detail.
[0045] The training method starts with step S10: collecting various data involved in urban operation management, including but not limited to structured data or unstructured data in multiple dimensions such as traffic, environment, and safety, to build a multi-dimensional data monitoring network. Structured data, also known as row data, is data logically expressed and implemented by a two-dimensional table structure, strictly following the data format and length specifications, and is mainly stored and managed through a relational database. In contrast to structured data is unstructured data that is not suitable for being represented by a two-dimensional table in a database, including office documents of all formats, XML, HTML, various reports, pictures, audio, video information, etc. Databases that support unstructured data use multi-value fields, value fields, and variable-length field mechanisms to create and manage data items, and are widely used in full-text retrieval and various multimedia information processing fields.
[0046] The data monitoring network refers to an interrelated and interactive data system formed by collecting and organizing the various dimensional data involved in the operation and management of the city. For example, by collecting source data such as traffic monitoring cameras, traffic lights, vehicle GPS positioning systems, and traffic checkpoints, we can obtain multiple sub-dimensions such as vehicle flow, vehicle speed, vehicle location, and road conditions at each collection point in the city to form a data monitoring network in the dimension of traffic (i.e., a traffic data monitoring network). By collecting source data such as environmental monitoring stations, meteorological stations, and air quality monitoring stations, we can obtain multiple sub-dimensions such as the air quality index, meteorological data (such as temperature, humidity, wind speed, and rainfall, etc.) and water quality data at the collection point to form a data monitoring network in the dimension of environment (i.e., an environmental data monitoring network). By collecting sub-dimensional data such as economic indicator parameters and monitoring parameters that characterize the coverage of camera monitoring, we can obtain a data monitoring network in the dimension of safety at the collection point (i.e., a safety data monitoring network).
[0047] Since the sub-dimensions under each dimension are multimodal data from different data elements, in order to achieve the fusion of multiple sub-dimensions to form sample data, it is necessary to pre-process the element data of each sub-dimension. Specifically, data fusion technology can be used to organize and fuse multimodal data collected from different data sources; multimodal data fusion technology includes data cleaning and noise reduction, normalization processing, and data standardization conversion steps.
[0048] Data cleaning and denoising: The raw data is cleaned and denoised by using the moving average method to remove outliers and noise in the data. The specific algorithm is as follows:
[0049]
[0050] in, represents the data prediction value of the sub-dimension x at time t, x t represents the original data value at time t, k represents the sliding window size, which is used to calculate the number of data points for moving average, i ranges from [-k, k], and X t+i Represents the original data value at the t+ith moment within this range.
[0051] Normalization: The cleaned and denoised data is normalized by a normalization algorithm for subsequent analysis and modeling. The specific algorithm is as follows:
[0052]
[0053] in, represents the normalized data value, represents the data after cleaning and noise reduction, Represents the minimum value in the data after cleaning and noise reduction. Represents the maximum value in the data after cleaning and denoising.
[0054] Data standardization transformation: The normalized data is standardized to conform to the standard normal distribution or a distribution within a specific range:
[0055]
[0056] Among them, p′ is the data value after standardization, represents the data value after preprocessing, μ represents the data mean, σ represents the data standard deviation represents the i-th data value after preprocessing, μ represents the data mean, and m represents the total number of data points in the sub-dimension x.
[0057] Based on the sorted and integrated sub-dimensional data, a corresponding dimensional data monitoring network is constructed to form a multi-source and multi-modal fusion data lake platform in the city center, which is used to store and manage various types of data in urban operations for subsequent model building and predictive analysis.
[0058] Afterwards, execute step S20: obtain the sub-dimensional data of multiple samples of each dimensional data monitoring network within the set historical time period to form sample data. Specifically, taking the traffic monitoring network as an example, obtain the sub-dimensional data of multiple traffic collection points in the city within the set historical time period to form sample data under the environmental dimension; specifically, obtain the multiple sub-dimensions such as vehicle flow, vehicle speed, vehicle position and road conditions of collection point 1 within the historical time period; obtain the multiple sub-dimensions such as vehicle flow, vehicle speed, vehicle position and road conditions of collection point 2; ... obtain the multiple sub-dimensions such as vehicle flow, vehicle speed, vehicle position and road conditions of collection point K; K is the sample size in the sample data. Based on the same principle, the environmental sub-dimensional data of multiple collection points can be obtained within the historical time period to form sample data under the environmental dimension; based on the same principle, the safety data within the set historical time period can also be obtained to form sample data under the dimension.
[0059] Based on the sample data of the acquired multiple-dimensional data monitoring network, step S30 is executed to extract features for each sample data. Specifically, the feature extraction of sample data in the MOE-based smart city hub data fusion computing model training method provided in this embodiment includes: time series feature extraction and spatial feature extraction for each sample sub-dimensional data in each dimension, and event association feature extraction that characterizes the association relationship between the same sample in multiple dimensions; event association features refer to the association relationship between one or more sub-dimensions in one dimension and the sub-dimension of the sample in other dimensions.
[0060] The feature extraction in the early warning model training method provided in this embodiment will be described in detail from three aspects: time series feature extraction, spatial feature extraction, and event correlation feature extraction.
[0061] Time series feature extraction refers to features extracted based on time series data. Common time series feature data for urban operation management include traffic time series feature data such as vehicle flow and average vehicle speed, environmental time series feature data such as temperature, humidity, PM2.5, and safety time series feature data such as accident rate and number of alarms. Specifically, the moving average algorithm and / or the autoregressive moving average model can be used to extract the time series features of each sample sub-dimensional data in each dimension. The moving average algorithm can be expressed using the following calculation formula:
[0062]
[0063] Among them, y t represents the moving average at time t, x t-i represents the data point value of traffic, environment or safety at the ti moment, l represents the moving average window size, and the value range is [5,20]. It can be dynamically adjusted according to the volatility of the data and the analysis requirements to achieve the optimal value. The autoregressive moving average model (ARIMA) is expressed using the following calculation formula:
[0064]
[0065] Among them, x t Represents the data point value at time t, such as traffic flow, accident rate, etc.; c is a constant term, the value of which is determined by the ARIMA model after training, and its value is generally the mean of the data; φ i Represents the autoregressive coefficient, with a value range of [-1,1], determined by the maximum likelihood estimation method; θ j Represents the moving average coefficient, with a value range of [-1,1], determined by ARIMA model training; ε t represents the error term, that is, the deviation between the model prediction value and the actual observation value at time t, ε t-j It represents the deviation between the model prediction value and the actual observation value at time tj. The value of the difference term is randomly generated and has a mean of 0 and a variance of σ 2 The normal distribution characteristics of ε t ~N(0,σ 2 ), p and q represent the autoregressive and moving average orders, and their value range is [1,5].
[0066] Spatial feature extraction refers to dividing a city into grids or regions and extracting features from the spatial location data of each grid or region. Common spatial features of urban operation and governance include spatial feature data under the traffic dimension, such as the location data of traffic congestion points and accident-prone areas, spatial feature data under the environmental dimension, such as the location data of pollution sources and air quality monitoring sites, and spatial feature data under the security dimension, such as the location data of crime hotspots and the coverage of camera surveillance. Spatial features can be extracted through the similarity between samples based on Euclidean distance and the clustering between samples based on spatial autocorrelation analysis.
[0067] Specifically, the similarity feature extraction between samples based on Euclidean distance is calculated using the following formula:
[0068]
[0069] Among them, x i ,x j represents the sample data of sample point i and sample point j in the sub-dimension x; i,k ,x j,k represents the coordinate values of sample points i and j in spatial dimension k; h represents the number of spatial dimensions, d(x i ,x j ) The smaller the value, the smaller the x i ,x j The closer the positions of two sample data in the feature space are, the higher their similarity is. The larger the d(xi,xj) value is, the closer the position of two sample data in the feature space is, the higher their similarity is. i ,x j The farther the positions of two sample data are in the feature space, the lower their similarity is. Specifically, it can be understood that when the sample point i is determined to be in a congested state, the state of the sample point j can be extracted based on the similarity feature calculation between samples based on the Euclidean distance; d(x i ,x j ) value is smaller, indicating that the probability that the sample point j is in a congested state is higher. The Euclidean distance is used to calculate the distance between sample points to measure the similarity between sample points.
[0070] Furthermore, spatial feature extraction also includes using the following formula to perform spatial autocorrelation analysis to determine
[0071] The sample data is empty
[0072]
[0073] Where n represents the sample data size; x i ,x j Represents the sample data of sample point i and sample point j in the sub-dimension x; Represents the mean of all sample data in the x dimension; ωij It represents the spatial weight, with a value of 0 or 1. The non-spatial proximity value is 0, and the spatial proximity value is 1. I represents the Moran index, with a value range of [-1,1]. The closer |I| is to 1, the more obvious the spatial correlation is, and the closer |I| is to 0, the less obvious the spatial correlation is, the space is random, and there is no correlation.
[0074] Event correlation features refer to the characteristics of the correlation relationship between different events. Common event correlations in urban operation and governance include the correlation between traffic accidents and weather conditions, the correlation between air quality and industrial emissions, and the relationship between crime rates and economic factors. Event correlation features can be extracted by mining correlation item sets to establish association rules and by data correlation classification. Specifically, establishing association rules by mining correlation item sets includes:
[0075] Step S31, obtain multiple historical warning events, and extract sub-dimensional data of each historical warning event in multiple dimensions to construct an initial associated item set. Specifically, obtain multiple traffic sub-dimensional data such as vehicle flow, vehicle speed, vehicle position, and road conditions at the collection point in each historical warning event, and collect multiple environmental sub-dimensional data such as air quality index, rainfall index, wind speed, and temperature. Combine the obtained multiple traffic sub-dimensional data and environmental sub-dimensional data into an event set to form an initial associated item set.
[0076] Step S32: Calculate the support of each sub-dimension in the initial associated item set based on multiple historical warning events. The support measures the frequency of occurrence of an event set in the entire data set, that is, the probability of occurrence of the event set. The higher the support, the higher the frequency of occurrence of the event set in the data set, that is, the stronger the correlation between the events. Support calculation formula: Among them, support(A) represents the support value of sub-dimension A in multiple historical warning events, count(A) represents the total number of historical warning events containing sub-dimension A, and total event represents the total number of all historical warning events. Specifically, taking eight historical warning events as an example, five of the eight historical warning events occurred when the environmental sub-dimension A1 with high rainfall occurred. The support value of sub-dimension A1 is
[0077] support(A1)=5 / 8=0.625; and two of the eight historical warning events have the high wind speed A2 environmental sub-dimension, so the support of the sub-dimension A2 is support(A2)=2 / 8=0.25. These data are only used to illustrate the support calculation of each sub-dimension, and the present invention does not make any limitation on this.
[0078] Step S33, based on the preset support threshold, scan the initial associated item set to obtain sub-dimensions with support higher than the support threshold, and combine the scanned sub-dimensions in pairs to form a new candidate associated item set. The value range of the support threshold is [0,1]. Specifically, for example, the initial associated item set is scanned with a support threshold of 0.6; taking the support calculation in step S32 as an example, sub-dimension A2 is pruned, while sub-dimension A1 is screened and retained, and the retained sub-dimensions are combined in pairs to form a new candidate associated item set.
[0079] Repeat steps S32 and S33 to scan new candidate associated item sets based on a preset support threshold. Repeat the above steps until no new candidate associated item sets are generated.
[0080] Then, step S34 is executed to calculate the confidence between multiple sub-dimensions in the last new candidate association item set, and the most relevant set of association relationships is determined based on the preset confidence threshold to form event association features that characterize the association relationships between sub-dimensions. Confidence is a measure of the probability that another event will occur at the same time when one event occurs in the association rule. A higher confidence level indicates a stronger degree of association between sub-dimensions. The occurrence of sub-dimension A1 can more accurately predict the occurrence of sub-dimension B1. The confidence calculation formula is:
[0081]
[0082] Where confidence(A1→B1) represents the probability that sub-dimension B1 occurs simultaneously when sub-dimension A1 occurs; support(A1∪B1) represents the support for the simultaneous occurrence of sub-dimension A1 and sub-dimension B1, and support(A1) represents the support value of sub-dimension A1.
[0083] Based on the mining of associated item sets and the establishment of association rules in historical warning events, we can extract deep and subtle association feature relationships between sub-dimensions of different dimensions, such as the impact of environmental sub-dimensions such as weather conditions and air quality on traffic sub-dimensions such as traffic volume, speed, and distance that cause traffic accidents; the impact of economic indicators and monitoring distribution on safety sub-dimensions, etc.
[0084] Furthermore, event correlation feature extraction also includes correlation relationship trend change features based on data correlation analysis, and its calculation formula is as follows:
[0085]
[0086] Where n represents the number of sample data, x i Represents the sample data of sample point i in the sub-dimension x, Represents the mean of all sample data in the x dimension; y iRepresents the sample data of the i-th sample in the sub-dimension y, |r| represents the mean of all sample data on the y dimension; r represents the Pearson correlation coefficient, r>0 indicates that the two sub-dimensions x and y are positively correlated; r<0 indicates that the two sub-dimensions x and y are negatively correlated; the closer |r| is to 1, the stronger the linear relationship between the two sub-dimensions x and y is, and the closer |r| is to 0, the weaker the linear relationship between the two sub-dimensions x and y is.
[0087] After that, step S40 will be executed to build an early warning model based on the MOE architecture. The early warning model includes multiple expert models corresponding to the extracted features and a gating network that dynamically assigns prediction weights to each expert model based on its output. Specifically, a corresponding expert model is established in the MOE framework based on the feature type extracted in step S30. In this embodiment, the features extracted in step S30 include temporal features, spatial features, and event-related features, so step S40 is established in the MOE framework respectively:
[0088] Time Series Expert Model: Use LSTM (Long Short-Term Memory Network) to process time series data. LSTM is suitable for processing and predicting time-based events, and it can remember long-term dependencies.
[0089] Spatial expert model: Use CNN (convolutional neural network) to process spatial data. CNN performs well in extracting and identifying features of spatial data.
[0090] Event association expert model: Granger causal analysis is used to process event association data. However, the present invention does not make any limitation to this.
[0091] In other embodiments, when the features extracted in step S30 change, a corresponding expert model is established in the MOE with the extracted features as input.
[0092] The time series expert model based on time series, the spatial expert model based on spatial data, and the event association expert model based on event association all make predictions only for a single feature. However, multimodal sample data and data to be predicted contain multiple features at the same time. In order to improve the accuracy and versatility of model prediction, the model training method provided in this embodiment constructs a gated network under the MOE architecture. The gated network dynamically assigns weights to each expert model according to the input data, thereby selecting the expert model that best suits the currently input data to be predicted to make a prediction. When the warning is output, the prediction results of each expert model are weighted averaged according to the weight output by the gated network, and finally the intelligent monitoring and warning of high-frequency and frequent problems in urban operation are realized. It can well solve the one-sidedness of single model prediction, thereby greatly improving the accuracy of model prediction.
[0093] Specifically, when the early warning model is trained based on multiple features of the extracted sample data, the prediction output E of each expert model is i (x) is transformed as follows:
[0094] z i =W g E i (x)+b g
[0095] Among them, W g is the gating network weight matrix, which converts the prediction output E of the i-th expert model i (x) is mapped to the weight space to determine the selection probability of each expert model; b g represents the gating network bias vector, which is used to adjust the output z of the linear transformation i To adapt it to the predicted output E i (x) distribution; optimize the gated network weight matrix W when training the gated network g and the gating network bias vector b g ;
[0096] Determine the gating network weight matrix W during training g and the gating network bias vector b g The gated network weight is then calculated using the Softmax activation function; the calculation formula is as follows:
[0097]
[0098] Among them, g i (x) represents the gating network weight of the i-th expert model, z i represents the linear transformation result of the prediction output of the i-th expert model, and N represents the number of expert models.
[0099] Specifically, when using training data to train multiple expert models and gating networks in the urban event warning model based on the MOE architecture, the back propagation algorithm and the stochastic gradient descent method are used for parameter optimization. The back propagation algorithm optimizes the model parameters by calculating the gradient of the loss function to the model parameters. The stochastic gradient descent rule is a gradient descent optimization method based on a single sample or a small batch of samples. By iteratively updating the parameters, the value of the loss function is gradually reduced, thereby achieving model training and optimization.
[0100] Back Propagation Algorithm: in, Represents the loss function on the model output E i The gradient of (x); Represents the partial derivative of the loss function L with respect to the model parameter θ, that is, the gradient of the loss function with respect to the parameter θ; θ is the model parameter and needs to be adjusted through the optimization algorithm to minimize the loss function. Stochastic Gradient Descent Algorithm: η represents the learning rate, which usually needs to be tuned at the beginning of training, usually starting from a small value, such as 0.001; then gradually adjusted according to the performance of the model on the validation set; is the gradient of the loss function with respect to the model parameters.
[0101] After the training is completed, the validation set is used to tune the model parameters and optimize the performance to improve the model's prediction and generalization capabilities to obtain a trained urban event warning model.
[0102] Correspondingly, this embodiment also provides a city event early warning method based on the MOE architecture, and the early warning method includes:
[0103] Step S100, obtaining data to be predicted of multiple sub-dimensions in each dimension data monitoring network;
[0104] Step S200: Use the early warning model trained by the MOE-based smart city hub data fusion computing model training method provided in this embodiment to predict the data to be predicted in multiple sub-dimensions in the acquired dimensional data monitoring network to obtain multi-dimensional network early warning results. Specifically, based on the features extracted from the data to be predicted, multiple expert models in the MOE architecture output prediction results; according to the prediction structure output by multiple expert models, the gating network dynamically assigns prediction weights to each expert model. The weight g output by the gating network is i (x) and the output E of the expert model i (x) Perform weighted averaging to obtain the final prediction result:
[0105]
[0106] Among them, g i (x) represents the weight assigned by the gating network to the i-th expert model, E i (x) represents the prediction result of the i-th expert model, and N represents the number of expert models.
[0107] Step S300: Display the prediction results in a visual manner. Specifically, it includes:
[0108] ① Analysis of the location of the incident
[0109] Combine spatial characteristics to analyze the distribution of locations where warning results occur and identify areas where problems occur. Access GIS map service capabilities to mark the locations where warning events occur on the map to intuitively display the spatial distribution of events. Use technologies such as heat maps to visualize the density of event locations in order to identify areas where problems occur.
[0110] ②Event frequency analysis
[0111] Analyze the frequency of events in the warning results, and calculate the frequency of warning events in different locations and time periods; use visualization tools such as bar charts and line charts to intuitively display the frequency distribution of warning events in order to identify the frequency of problem occurrence.
[0112] ③Event trend analysis
[0113] Analyze the changing trends of warning results over time and identify the occurrence patterns and trends of events; for example, use visualization tools such as line graphs and trend graphs to display the changes of warning events over time in order to identify the time patterns of event occurrence.
[0114] ④ Cause analysis
[0115] Based on the early warning results, analyze the root causes of the problem, including possible external and internal factors.
[0116] ⑥Issue impact assessment
[0117] Based on the early warning results, evaluate the impact of the early warning issue on urban operations, including economic impact, social impact and environmental impact.
[0118] ⑦Solution recommendation
[0119] Based on the causes of the problems identified in the early warning results and based on the handling of historical warning events, corresponding solutions and improvement measures are proposed, including technical means, policy measures and management measures.
[0120] ⑧ Decision-making and resource scheduling proposals
[0121] Based on the recommended solutions, we provide targeted decision-making advice to city managers, including priority issues, emergency measures and long-term improvement plans; based on the impact of the problems and the need for solutions, we develop resource scheduling plans, including recommendations for the allocation of human resources, material resources and financial resources.
[0122] In one embodiment, the smart city hub data fusion computing model training method and early warning method based on the MOE architecture provided in this application can be implemented in the form of a computer program. The computer program can be used in Figure 4The computer device shown in the figure is run. The memory of the computer device can store various program modules in the smart city hub data fusion calculation model training method or early warning method based on the MOE architecture. The computer program composed of various program modules enables the processor to execute the specific steps of the smart city hub data fusion calculation model training method or early warning method based on the MOE architecture of each embodiment of the present application described in this specification.
[0123] In summary, the intelligent city hub data fusion computing model training method, early warning method and equipment based on the MOE architecture provided by the present invention integrate various data generated in urban operation management, including but not limited to traffic data, environmental data, safety and other multi-dimensional structured data or unstructured data through multi-source multi-modal data fusion technology, to build a multi-source multi-modal fusion data lake platform for urban hub data. Furthermore, based on the multi-dimensional characteristics of the prediction data, in order to avoid the prediction interference caused by the differences between the characteristics of different dimensions, the prediction model is set as a city hub multi-modal event data monitoring and early warning model based on the MOE (Mixture of Experts) architecture. The gated network in the model can realize dynamic adjustment of the weights of each expert model based on the input data, greatly improving the accuracy of the model prediction and its versatility in multi-modal data.
[0124] Although the present invention has been disclosed as above by the preferred embodiment, it is not intended to limit the present invention. Anyone familiar with this technology can make slight changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope of protection required by the claims.
Claims
1. A method for training a data fusion computing model for a smart city hub based on MOE architecture, characterized in that: include: Collect and pre-process the multi-dimensional raw data involved in urban operation management, and build a corresponding dimensional data monitoring network based on the multiple sub-dimensional data contained in each dimension after pre-processing, wherein the multi-dimensional data includes traffic dimension, environmental dimension and safety dimension; Obtain sub-dimensional data of multiple samples of each dimensional data monitoring network within a set historical time period to form sample data; Extract features from the sample data, including temporal feature extraction and spatial feature extraction for each sub-dimensional data of each sample in each dimension, and event-related feature extraction for characterizing the association between multiple dimensions of the same sample. The event-related feature refers to the association between one or more sub-dimensions in one dimension and the sub-dimensions in other dimensions of the sample; Constructing an early warning model based on the MOE architecture, the early warning model comprising a plurality of expert models corresponding to the extracted features and a gating network for dynamically assigning prediction weights to each expert model based on its output; Based on multiple features of the extracted sample data, a warning model is trained to determine the parameters of each expert model and the weight bias parameters of the gating network to form an urban event warning model. The output of the warning model is the result of weighted fusion of multiple expert models based on the prediction weights dynamically assigned by the gating network.
2. The method for training a smart city hub data fusion computing model based on the MOE architecture according to claim 1 is characterized in that: When performing spatial feature extraction, the city is divided into grids or regions, and spatial feature extraction is performed in each grid or region through sample similarity based on Euclidean distance and sample clustering based on spatial autocorrelation analysis. The spatial features include spatial location data of traffic congestion points and accident-prone areas representing the traffic dimension, pollution source location data and air quality monitoring site data representing the environmental dimension, and crime hotspot location data and camera monitoring coverage data representing the safety dimension.
3. The method for training a smart city hub data fusion computing model based on the MOE architecture according to claim 2 is characterized in that: The similarity feature extraction between samples based on Euclidean distance is calculated using the following formula: Among them, x i ,x j represents the sample data of sample point i and sample point j in the sub-dimension x; i,k ,x j,k represents the coordinate values of sample points i and j in spatial dimension k; h represents the number of spatial dimensions, d(x i ,x j ) value is smaller, indicating that x i ,x j The closer the positions of two sample data in the feature space are, the higher their similarity is. The larger the d(xi,xj) value is, the closer the position of two sample data in the feature space is, the higher their similarity is. i ,x j The farther two sample data are located in the feature space, the lower their similarity is.
4. The method for training a data fusion computing model for a smart city hub based on the MOE architecture according to claim 2 is characterized in that: The following formula is used for spatial autocorrelation analysis to determine the spatial aggregation or dispersion of sample data: Where n represents the sample data size; x i ,x j Represents the sample data of sample point i and sample point j in the sub-dimension x; Represents the mean of all sample data in the x dimension; ω ij It represents the spatial weight, with a value of 0 or 1. The non-spatial proximity value is 0, and the spatial proximity value is 1. I represents the Moran index, with a value range of [-1,1]. The closer |I is to 1, the more obvious the spatial correlation is, and the closer |I| is to 0, the less relevant the spatial correlation is.
5. The method for training a smart city hub data fusion computing model based on the MOE architecture according to claim 1 is characterized in that: When performing event-related feature extraction: Acquire multiple historical warning events, and extract sub-dimension data of each historical warning event under multiple dimensions to construct an initial associated item set; Calculate the support of each sub-dimension in the initial associated item set based on multiple historical warning events; Based on the preset confidence threshold, the initial associated item set is scanned to obtain sub-dimensions with support higher than the support threshold and are combined in pairs to form new candidate associated item sets; Scan new candidate associated item sets based on a preset support threshold to generate new candidate associated item sets again, and repeat the above steps until no new candidate associated item sets are generated; The confidences between the multiple sub-dimensions in the last new candidate association item set are calculated, and a most relevant set of association relationships is determined based on a preset confidence threshold to form an event association feature that characterizes the association relationship between the sub-dimensions.
6. The method for training a data fusion computing model for a smart city hub based on the MOE architecture according to claim 5 is characterized in that: The event-related feature extraction also includes data correlation analysis, and its calculation formula is as follows: Where n represents the number of sample data, x i Represents the sample data of sample point i in the sub-dimension x, Represents the mean of all sample data in the x dimension; y i Represents the sample data of the i-th sample in the sub-dimension y, |r| represents the mean of all sample data on the y dimension; r represents the Pearson correlation coefficient, r>0 indicates that the two sub-dimensions x and y are positively correlated; r<0 indicates that the two sub-dimensions x and y are negatively correlated; the closer |r| is to 1, the stronger the linear relationship between the two sub-dimensions x and y is, and the closer |r| is to 0, the weaker the linear relationship between the two sub-dimensions x and y is.
7. The method for training a smart city hub data fusion computing model based on the MOE architecture according to claim 1 is characterized in that: When training the early warning model based on multiple features of the extracted sample data, the prediction output E of each expert model is i (x) is transformed as follows: z i =W g E i (x)+b g Among them, W g is the gating network weight matrix, and its prediction output E of the i-th expert model i (x) is mapped to the weight space to determine the selection probability of each expert model; b g represents the gating network bias vector, which is used to adjust the output z of the linear transformation i To adapt it to the predicted output E i (x) distribution; optimize the gated network weight matrix W when training the gated network g and the gating network bias vector b g ; Determine the gating network weight matrix W during training g and the gating network bias vector b g The gated network weight is then calculated using the Softmax activation function; the calculation formula is as follows: Among them, g i (x) represents the gating network weight of the i-th expert model, z i represents the linear transformation result of the prediction output of the i-th expert model, and N represents the number of expert models.
8. The method for training a smart city hub data fusion computing model based on MOE architecture according to claim 1 is characterized in that: A moving average algorithm and / or an autoregressive moving average model is used to extract the time series characteristics of each sample sub-dimensional data in each dimension.
9. A city event early warning method based on MOE architecture, characterized in that: The method comprises: Obtain the data to be predicted in multiple sub-dimensions within the data monitoring network of each dimension; The early warning model trained by the smart city central data fusion computing model training method based on the MOE architecture described in any one of claims 1-8 predicts the data to be predicted in multiple sub-dimensions within the acquired data monitoring network of each dimension to obtain a multi-dimensional network early warning result.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Comprehensive information management system for smart city pipeline network
CN105225069A
Urban road congestion degree prediction method based on time sequence traffic events
CN109697852A
A traffic time sequence prediction method based on a gating network and gradient lifting regression
CN109886387A
Click-through-rate estimation method based on multi-task learning mechanism
CN112860998A
Operation and maintenance management system and method for smart city
CN118229036A
Cited By
Time sequence prediction method, time sequence prediction device and electronic equipment
CN119357705A
Security risk analysis early warning method for multi-source data processing
CN119561776A
Power generation strategy adjustment method and device based on multi-modal electricity price prediction result, equipment and medium
CN121120306A
