Prediction model training method, pedestrian flow prediction method, device, equipment, medium and program product
By combining road network information and pedestrian flow information in the prediction model and using the self-attention mechanism to process public opinion types and life cycle impacts, the problem that existing models are unable to capture pedestrian flow relationships in distant areas is solved, and more accurate pedestrian flow predictions are achieved.
Patent Information
- Application Number
- CN202511254988.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-04
AI Technical Summary
The existing regional crowd flow prediction model based on location signaling cannot effectively capture the relationship between crowd flow between distant areas, resulting in low prediction accuracy.
By obtaining road network information and pedestrian flow information in the sample area, combining public opinion type and life cycle impact, and using the self-attention mechanism to train the prediction model, the pedestrian flow dependence characteristics of base stations at different distances and different time periods are determined, and iterative training is carried out until the predetermined conditions are met.
The accuracy of crowd flow prediction has been improved by taking more factors into consideration and learning the dependency characteristics at different distances and time periods, thus improving the comprehensiveness and accuracy of the prediction model.
Smart Images

Figure CN120744515A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a prediction model training method, a pedestrian flow prediction method, an apparatus, equipment, a medium, and a program product. Background Art
[0002] Existing regional crowd flow prediction models based on location signaling often focus only on local spatial patterns (e.g., pedestrian speed or population density). This limits their ability to learn dynamic crowd flow patterns. Furthermore, due to the functional divisions of cities, it is difficult to capture the relationship between crowd flow between distant regions. This results in low prediction accuracy. Summary of the Invention
[0003] The embodiments of the present application provide a prediction model training method, a pedestrian flow prediction method, an apparatus, a device, a medium, and a program product.
[0004] The technical solution of this application is achieved as follows: The present invention provides a prediction model training method, including: Obtaining sample road network information and sample pedestrian flow information within the sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station during a historical period; Input the sample road network information and sample passenger flow information into the initial prediction model to determine the first dependency characteristics of passenger flow at sample base stations with different distances between each other under the influence of public opinion type, as well as the second dependency characteristics of passenger flow at sample base stations in different time periods under the influence of public opinion life cycle; The initial prediction model is iteratively trained based on the first dependent feature and the second dependent feature until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0005] In the above solution, the sample road network information includes at least one of the following: relevant attributes of each sample base station in the sample area, the number of hops between every two sample base stations in the sample area, and adjacency characteristics of the sample base stations in the sample area; The sample pedestrian flow information includes: pedestrian flow characteristics of each sample base station in the sample area in each sub-period; wherein, the historical period includes: T sub-periods; T is an integer greater than 1.
[0006] In the above scheme, the first dependent feature of the flow of people at sample base stations with different distances between each other under the influence of public opinion type, and the second dependent feature of the flow of people at sample base stations in different time periods under the influence of public opinion life cycle are determined, including: The adjacency feature and the pedestrian flow feature are converted into the same dimension for fusion to determine a first fusion feature; wherein the first fusion feature is determined based on the dimension of the sub-period, the dimension of the sample base station, and the embedding dimension; Slice the first fusion feature according to the dimension of the fixed sub-time period to obtain the first sample feature, and slice the first fusion feature according to the dimension of the fixed sample base station to obtain the second sample feature; Determine a first dependency based on the first initial parameter and the first sample feature, process the first dependency based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations, and determine a first dependency feature under the self-attention mechanism; wherein the first dependency is used to characterize the spatial dependency of the flow of people at each sample base station during the historical period; Based on the second initial parameters and the public opinion life cycle of each sample base station in each sub-period, the second sample feature is processed to determine the second dependent feature under the self-attention mechanism.
[0007] In the above solution, the adjacency feature and the pedestrian flow feature are transformed into the same dimension and fused to determine the first fusion feature, including: Determine the spatial structure characteristics of base stations within the sample area based on the adjacency characteristics; Decomposing the base station spatial structure feature to obtain a spatial dimension feature, and projecting the spatial dimension feature according to the embedding dimension to determine a first embedding feature; Processing the pedestrian flow features by using the embedded features corresponding to the multiple time dimensions, determining the time dimension features under each time dimension, and combining each time dimension feature to determine a second embedded feature; wherein the dimension of the embedded feature is the embedding dimension; The first embedded feature and the second embedded feature are fused to determine a first fused feature.
[0008] In the above scheme, the first dependency is determined based on the first initial parameter and the first sample feature, and the first dependency is processed based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations. The first dependency feature under the self-attention mechanism is determined, including: Determining a first dependency between the flow of people at each sample base station in each sub-period based on a product of the first initial parameter and the first sample feature; Based on the statistical similarity between the type characteristics of the public opinion type of each sample base station in each sub-period and the pedestrian flow characteristics of each sample base station in each sub-period, the first dependency is updated; Determine the mask feature based on the similarity of the hop count and name attributes between each two sample base stations; A first dependency feature is determined based on a product of the mask feature and the updated first dependency.
[0009] In the above solution, the first initial parameter includes: a first query parameter, a first key parameter, and a first value parameter; Determining a first dependency between the flow of people at each sample base station in each sub-period based on the product of the first initial parameter and the first sample feature includes: determining a first query feature based on a product of the first query parameter and the first sample feature, and determining a first key feature based on a product of the first key parameter and the first sample feature; The first dependency is determined based on a ratio of the T-th power of the product of the first query feature and the first key feature to the square root of the dimension corresponding to the first query feature.
[0010] In the above solution, based on the statistical similarity between the type characteristics of the public opinion type of each sample base station in each sub-period and the pedestrian flow characteristics of each sample base station in each sub-period, the first dependency is updated, including: The type features and the pedestrian flow features of each sample base station in each sub-period are converted to the same dimension for similarity comparison, and the similarity weight of the type features of each sample base station in each sub-period is determined; Based on the similarity weight and the third initial parameter, the type characteristics of each sample base station in each sub-period are weighted and summed to determine the historical public opinion and traffic characteristics corresponding to each sample base station; Update the first key feature based on each historical public opinion traffic feature.
[0011] In the above solution, the mask features include: a first mask matrix and a second mask matrix; based on the similarity of the hop count and name attributes between each two sample base stations, the mask features are determined, including: Determine each element of the first mask matrix based on a relationship between the number of hops between each two sample base stations and a first preset threshold, to obtain the first mask matrix; Based on the magnitude relationship between the similarity of the name attributes between each two sample base stations and a second preset threshold, each element of the second mask matrix is determined to obtain the second mask matrix.
[0012] In the above solution, the first dependency feature includes: a first sub-dependency feature and a second sub-dependency feature; determining the first dependency feature based on the product of the mask feature and the updated first dependency includes: Determining a first sub-dependency feature based on a product of a first mask matrix and the first dependency, and determining a second sub-dependency feature based on a product of a second mask matrix and the first dependency; Among them, the first sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of public opinion type and distance; the second sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of public opinion type and name attribute.
[0013] In the above scheme, based on the second initial parameter and the public opinion life cycle of each sample base station in each sub-period, the second sample feature is processed to determine the second dependent feature under the self-attention mechanism, including: Determining a second dependency of the flow of people at each sample base station in different sub-periods based on a product of the second initial parameter and the second sample feature; Determine a third mask matrix based on the public opinion life cycle of each sample base station in each sub-period; A second dependency feature is determined based on a product of the third mask matrix and the second dependency.
[0014] In the above scheme, based on the public opinion life cycle of each sample base station in each sub-period, the third mask matrix is determined, including: Based on the statistical number of comments on public opinion at each sample base station in each sub-period, the reconstruction error of the public opinion life cycle at each sample base station in each sub-period is determined; Based on the magnitude relationship between the reconstruction error and the third preset threshold, each element in the third mask matrix is determined to obtain the third mask matrix.
[0015] In the above solution, the initial prediction model is iteratively trained based on the first dependent feature and the second dependent feature until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model, including: determining a loss of the initial prediction model based on a second fused feature fused from the first dependent feature and the second dependent feature; The first initial parameter, the second initial parameter and the third initial parameter are iteratively updated based on the loss until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0016] The present application also provides a method for predicting pedestrian flow, including: Obtaining target road network information within the target area; wherein the target road network information is used to characterize the adjacency relationship of the target base station within the target area; Input the target road network information into the preset prediction model to determine the pedestrian flow prediction results for the target area; Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependent feature and the second dependent feature until the training is stopped when the predetermined training conditions are reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependent feature of the pedestrian flow of sample base stations with different distances between each other under the influence of public opinion type, and the second dependent feature of the pedestrian flow of sample base stations in different time periods under the influence of public opinion life cycle; the sample road network information includes the adjacency relationship of sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
[0017] The present application also provides a prediction model training device, including: A first information acquisition unit is configured to acquire sample road network information and sample pedestrian flow information within a sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; and the sample pedestrian flow information is configured to characterize the pedestrian flow within the range of the sample base station within a historical period. A first determination unit is configured to input sample road network information and sample pedestrian flow information into an initial prediction model, determine a first dependency characteristic of pedestrian flow at sample base stations with different distances between each other under the influence of public opinion type, and a second dependency characteristic of pedestrian flow at sample base stations in different time periods under the influence of public opinion life cycle; The updating unit is used to iteratively train the initial prediction model based on the first dependent feature and the second dependent feature until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0018] The present application also provides a crowd flow prediction device, including: A second information acquisition unit is configured to acquire target road network information within the target area; wherein the target road network information is used to characterize the adjacency relationship of the target base station within the target area; The second determining unit is configured to input the target road network information into a preset prediction model to determine a pedestrian flow prediction result for the target area; Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependent feature and the second dependent feature until the training is stopped when the predetermined training conditions are reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependent feature of the pedestrian flow of sample base stations with different distances between each other under the influence of public opinion type, and the second dependent feature of the pedestrian flow of sample base stations in different time periods under the influence of public opinion life cycle; the sample road network information includes the adjacency relationship of sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
[0019] An embodiment of the present application also provides a first electronic device, including a first memory and a first processor, wherein the first memory stores a computer program that can be run on the first processor, and when the first processor executes the computer program, the steps in the method on the prediction model training device side are implemented.
[0020] An embodiment of the present application also provides a second electronic device, including a second memory and a second processor, wherein the second memory stores a computer program that can be run on the second processor, and when the second processor executes the computer program, the steps in the method on the side of the pedestrian flow prediction device are implemented.
[0021] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a first processor, the steps in the method on the prediction model training device side are implemented.
[0022] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a second processor, the steps in the method on the side of the pedestrian flow prediction device are implemented.
[0023] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps in the method on the prediction model training device side when executed by the first processor.
[0024] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps in the method on the side of the pedestrian flow prediction device when executed by a second processor.
[0025] In an embodiment of the present application, sample road network information and sample pedestrian flow information are obtained within the sample area; wherein, the sample road network information includes the adjacency relationship of the sample base stations within the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the sample base station range within the historical period; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependency feature of the pedestrian flow of sample base stations with different distances between each other under the influence of the public opinion type, and the second dependency feature of the pedestrian flow of sample base stations in different time periods under the influence of the public opinion life cycle; the initial prediction model is iteratively trained based on the first dependency feature and the second dependency feature until the training is stopped when the predetermined training conditions are reached, and a preset prediction model is obtained. In this way, the dependency features of the pedestrian flow of sample base stations at different distances and in different time periods under public opinion can be learned based on the first dependency feature and the second dependency feature. Compared with the prediction model in the related art, the learning is more comprehensive and more factors are considered. Therefore, the pedestrian flow prediction result determined based on the trained preset prediction model is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 1 ; Figure 2 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 2 ; Figure 3 Schematic diagram of the effect of the prediction model training method provided in the embodiment of this application Figure 1 ; Figure 4 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 3 ; Figure 5 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 4 ; Figure 6 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 5 ; Figure 7 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 6 ; Figure 8 Schematic diagram of the effect of the prediction model training method provided in the embodiment of this application Figure 2 ; Figure 9 Schematic diagram of the process of the prediction model training method provided in the embodiment of the application Figure 7 ; Figure 10 Schematic diagram of the effect of the prediction model training method provided in the embodiment of this application Figure 3 ; Figure 11 Schematic diagram of the process of the crowd flow prediction method provided in the embodiment of the application Figure 1 ; Figure 12 A schematic diagram of the structure of the prediction model training device provided in an embodiment of the present application; Figure 13 A schematic diagram of a hardware entity of a first electronic device provided in an embodiment of the present application; Figure 14 A schematic diagram of the structure of a pedestrian flow prediction device provided in an embodiment of the present application; Figure 15 A schematic diagram of a hardware entity of a second electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0028] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] If similar descriptions of "first / second" appear in the application documents, the following explanation is added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0031] This application embodiment provides a prediction model training method, see Figure 1 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 1 , will combine Figure 1 The steps shown are explained: S101. Obtain sample road network information and sample pedestrian flow information within a sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; and the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station during a historical period.
[0032] In an embodiment of the present application, the prediction model training device can determine a sample area and obtain sample road network information and sample pedestrian flow information from sample base stations within the sample area. The sample road network information includes the adjacency relationship of the sample base stations within the sample area; the sample pedestrian flow information is used to represent the pedestrian flow within the sample base station range during a historical period.
[0033] The sample road network information includes at least one of the following: relevant attributes of each sample base station in the sample area, the number of hops between every two sample base stations in the sample area, and the adjacency characteristics of the sample base stations in the sample area; the sample pedestrian flow information includes: pedestrian flow characteristics of each sample base station in the sample area in each sub-time period; the historical time period includes: T sub-time periods, where T is an integer greater than 1.
[0034] In the embodiment of the present application, the pedestrian flow characteristics corresponding to each sample base station can be determined based on the location signaling received by the sample base station in the sub-time period. The pedestrian flow characteristics may include inflow characteristics and outflow characteristics.
[0035] G can be used to represent the sample road network information, which includes a set of attributes related to N sample base stations, a set of edges between every two sample base stations, and the adjacency matrix (adjacency features) of the sample base stations within the sample area. The pedestrian flow features for each sample base station in each sub-period are an N × C matrix, where C is the dimension of the pedestrian flow. For example, when the pedestrian flow features include inflow and outflow, C = 2. The historical period can include T sub-periods. The pedestrian flow features within the historical period are a T × N × C matrix. N is an integer greater than 1.
[0036] S102. Input the sample road network information and sample passenger flow information into the initial prediction model to determine the first dependent characteristics of the passenger flow of sample base stations with different distances between each other under the influence of public opinion type, and the second dependent characteristics of the passenger flow of sample base stations in different time periods under the influence of public opinion life cycle.
[0037] In this embodiment of the present application, during training, public opinion information within the area corresponding to each sample base station needs to be crawled from the network. Public opinion information includes information such as the number of public opinions, type of public opinion, life cycle of public opinion, and number of public opinion comments. The prediction model training device can input sample road network information and sample pedestrian flow information into the initial prediction model, fuse the sample road network information and sample pedestrian flow information, and determine a first fused feature. The first fused feature is sliced according to a fixed sub-time period to obtain a first sample feature, and the first fused feature is sliced according to a fixed sample base station dimension to obtain a second sample feature. A first dependency is determined based on the pedestrian flow characteristics corresponding to each sample base station and a first initial parameter. This first dependency is updated using the public opinion type. The first dependency is processed based on relevant features of sample base stations at different distances between each other (including information such as hop count and name attributes) to determine the first dependency feature under the self-attention mechanism. Simultaneously, the second sample feature can be processed using the second initial parameter and features of the public opinion life cycle of the sample base stations in different time periods to determine the second dependency feature under the self-attention mechanism.
[0038] Among them, the first initial parameter and the second initial parameter are both parameters in the self-attention module in the initial detection model.
[0039] In an embodiment of the present application, when fusing the sample road network information and the sample pedestrian flow information, the sample road network information and the sample pedestrian flow information can be converted into features in the same dimension for fusion, thereby determining a first fused feature. During the conversion of the sample pedestrian flow information, the impact of different time periods on pedestrian flow can also be considered. The sample pedestrian flow information can be first converted into pedestrian flow features corresponding to different time periods, and then the pedestrian flow features corresponding to different time periods are combined and converted into the same dimension for fusion.
[0040] The public opinion information in the area corresponding to each sample base station may include: public opinion information in each area crawled on the network using crawler technology. Since there is a corresponding relationship between the area and the sample base station, the public opinion information corresponding to the sample base station can be determined.
[0041] The public opinion lifecycle refers to the process of public opinion formation, development, and dissipation. This process can be divided into several stages: the embryonic stage, the development stage, the peak stage, the decline stage, and the extinction stage. The volume of public opinion comments corresponding to different stages varies, so the volume of public opinion comments can be used to reflect the corresponding public opinion lifecycle. The positive and negative sentiment of public opinion events can be labeled to determine the public opinion type of the event, which indicates whether it is positive, negative, or no public opinion. For example, words such as "good" and "excellent" tend to convey positive sentiment, while words such as "bad" and "terrible" tend to convey negative sentiment.
[0042] S103 , iteratively training the initial prediction model based on the first dependency feature and the second dependency feature until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0043] In an embodiment of the present application, the prediction model training device can determine the loss function of the processing prediction model based on the first dependent feature and the second dependent feature, and then update the various parameters of the initial prediction model according to the loss until the training is stopped when the predetermined training conditions are met to obtain a preset prediction model.
[0044] In an embodiment of the present application, sample road network information and sample pedestrian flow information are obtained within the sample area; wherein, the sample road network information includes the adjacency relationship of the sample base stations within the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the sample base station range within the historical period; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependency feature of the pedestrian flow of sample base stations with different distances between each other under the influence of the public opinion type, and the second dependency feature of the pedestrian flow of sample base stations in different time periods under the influence of the public opinion life cycle; the initial prediction model is iteratively trained based on the first dependency feature and the second dependency feature until the training is stopped when the predetermined training conditions are reached, and a preset prediction model is obtained. In this way, the dependency features of the pedestrian flow of sample base stations at different distances and in different time periods under public opinion can be learned based on the first dependency feature and the second dependency feature. Compared with the prediction model in the related art, the learning is more comprehensive and more factors are considered. Therefore, the pedestrian flow prediction result determined based on the trained preset prediction model is more accurate.
[0045] See also Figure 2 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 2 , Figure 1 S102 in the above example can also be realized by S201 to S204, which will be combined with Figure 2 The steps shown are explained: S201. Convert the adjacency feature and the pedestrian flow feature into the same dimension for fusion to determine a first fusion feature; wherein the first fusion feature is determined based on the dimension of the sub-period, the dimension of the sample base station, and the embedding dimension.
[0046] In an embodiment of the present application, the elements in the adjacency feature are used to characterize the connection status between each two sample base stations. The adjacency feature is an N×N dimensional matrix. The pedestrian flow feature in the historical period is an N×T dimensional matrix. The prediction model training device can transform the adjacency feature and the pedestrian flow feature into the same dimension in combination with the embedding dimension d for fusion to determine the first fused feature. The determined first fused feature is an N×T×d dimensional matrix. d is an integer greater than 1.
[0047] For example, the adjacency feature can be represented by the following matrix A, where A i,j Indicates the connection between sample base station i and sample base station j. If there is an edge between sample base station i and sample base station j, that is, they are adjacent, then A i,j =1, otherwise A i,j =0.
[0048]
[0049] In an embodiment of the present application, the prediction model training device can convert the input adjacency features and the pedestrian flow features within each sub-period into a high-dimensional representation, and can convert the input features into a matrix of N×T×d dimensions. In order to encode the sample base station network structure and the periodicity of the pedestrian flow, two mechanisms, spatial graph Laplace embedding and temporal periodic embedding, can be used for conversion, wherein spatial graph Laplace embedding is used to encode the adjacency features, and temporal periodic embedding is used to construct the periodicity of the encoded pedestrian flow features.
[0050] S202: Obtain a first sample feature by slicing the first fusion feature according to a dimension of a fixed sub-time period, and obtain a second sample feature by slicing the first fusion feature according to a dimension of a fixed sample base station.
[0051] In the embodiment of the present application, the prediction model training device can fix the time step t, retain the elements of the N and d dimensions within the step, and determine the first sample feature. The sample base station step n can be fixed, retain the elements of the T and d dimensions within the step, and determine the second sample feature.
[0052] The first sample feature can represent a fixed time step t, retaining all elements in the N and d dimensions, resulting in a matrix dimension of N × d. For example, when T = 0, this slice corresponds to the N × d feature matrix of all samples at time step 0. The second sample feature can represent a fixed sample base station step n, retaining all data in the T × d dimensions, resulting in a matrix dimension of T × d. For example, when n = 0, this slice corresponds to the T × d feature matrix of the first sample in the time series.
[0053] S203. Determine the first dependency based on the first initial parameter and the first sample feature, and process the first dependency based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations to determine the first dependency feature under the self-attention mechanism.
[0054] In an embodiment of the present application, the prediction model training device can determine the first dependency based on the first initial parameter and the first sample feature. Then, the first dependency is updated based on the similarity between the type feature of the public opinion type of each sample base station in each sub-period and the corresponding pedestrian flow feature. Then, based on the name attribute of the sample base station and the number of hops between different sample base stations, the mask features of the sample base stations at different distances in the spatial dimension are determined, and the updated first dependency is processed using the mask features to determine the first dependency feature. Among them, the first dependency is used to characterize the dependency of the pedestrian flow of each sample base station in the historical period in the spatial dimension.
[0055] In an embodiment of the present application, the prediction model training device can determine the mask features of the sample base stations at different distances in the spatial dimension based on the similarity between the name attributes of each sample base station and the relationship between the number of hops between different sample base stations and the corresponding threshold. Among them, the mask features of the sample base stations at long distances in the spatial dimension, that is, the long-distance spatial features, can be determined based on the similarity between the name attributes. The mask features of the sample base stations at short distances in the spatial dimension, that is, the short-distance spatial features, can be determined based on the number of hops between different sample base stations.
[0056] For example, a city has multiple functional areas with the same function distributed in various corners. Although the sample base stations in different functional areas are far away, they still have similar pedestrian flow information. Therefore, these base stations also have the same spatial characteristics. Figure 3 As shown, the circles represent a set of sample base stations with short-distance spatial characteristics, and the base stations connected by dotted lines represent sample base stations with long-distance spatial characteristics.
[0057] S204: Process the second sample feature based on the second initial parameter and the public opinion life cycle of each sample base station in each sub-period, and determine the second dependent feature under the self-attention mechanism.
[0058] In an embodiment of the present application, the prediction model training device can use the second initial parameter and the second sample feature to determine the corresponding second dependency. The second dependency is used to characterize the dependency characteristics of the flow of people between each sample base station in different time periods. A mask matrix is then determined based on the statistical public opinion life cycle of each sample base station in each sub-time period. The mask matrix is used to process the second dependency to determine the second dependency feature.
[0059] In an embodiment of the present application, the adjacency feature and the pedestrian flow feature are converted to the same dimension for fusion to determine a first fusion feature; wherein, the first fusion feature is determined based on the dimension of the sub-period, the dimension of the sample base station and the embedding dimension; the first sample feature is obtained by slicing the first fusion feature according to the dimension of the fixed sub-period, and the second sample feature is obtained by slicing the first fusion feature according to the dimension of the fixed sample base station; based on the first initial parameter, the name attribute of each sample base station and the number of hops between different sample base stations, the first sample feature is processed to determine the first dependency feature under the self-attention mechanism; wherein, the first initial parameter is determined based on the public opinion type corresponding to each sample base station; based on the second initial parameter and the public opinion life cycle of each sample base station in each sub-period, the second sample feature is processed to determine the second dependency feature under the self-attention mechanism. In this way, the dependency features of the pedestrian flow of sample base stations at different distances and in different time periods under public opinion can be learned based on the first dependency feature and the second dependency feature. Compared with the prediction model in the related art, the learning is more comprehensive and more factors are considered. Therefore, the pedestrian flow prediction result determined based on the trained preset prediction model is more accurate.
[0060] See also Figure 4 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 3 , Figure 2 S201 in the above can also be realized through S301 to S304, which will be combined with Figure 4 The steps shown are explained: S301: Determine spatial structural features of base stations within a sample area based on adjacency features.
[0061] In an embodiment of the present application, the prediction model training device can determine the base station spatial structure characteristics by combining the adjacency matrix, the degree matrix and the identity matrix.
[0062] To represent the network structure of the sample base stations, we use the graph Laplace matrix (base station spatial structure feature), which can better describe the distance between sample base stations in the sample area. First, we calculate the normalized Laplace matrix using the formula ,in, is the Laplace matrix, A is the adjacency matrix, D is the degree matrix, and I is the identity matrix.
[0063] S302: Decompose the base station spatial structure feature to obtain a spatial dimension feature, and project the spatial dimension feature according to the embedding dimension to determine a first embedding feature.
[0064] In an embodiment of the present application, the prediction model training device can decompose the base station spatial structure features to obtain spatial dimension features, and project the spatial dimension features according to the embedding dimension to determine the first embedding feature.
[0065] Among them, the prediction model training device can be used to train the Laplace matrix Perform eigendecomposition to obtain the characteristic matrix and the eigenvector matrix (Spatial dimension feature). Where T represents the number of T sub-periods in the historical period. Using d minimum non-zero eigenvectors Perform linear projection to generate the first embedding feature. The first embedding feature is an N×d-dimensional matrix, where N is the number of sample base stations and d is the number of selected feature vector matrices, which is also the embedding dimension.
[0066] S303. Process the pedestrian flow features through the embedded features corresponding to multiple time dimensions, determine the time dimension features under each time dimension, and combine each time dimension feature to determine a second embedded feature; wherein the dimension of the embedded feature is the embedded dimension.
[0067] In an embodiment of the present application, the prediction model training device can pre-configure embedded features in multiple time dimensions. The dimension of each embedded feature is an embedding dimension, i.e., d. The prediction model training device can multiply the embedded features in each time dimension with the pedestrian flow characteristics within the historical time period to determine the time dimension features in each time dimension. The time dimension features in each time dimension are then combined to obtain a second embedded feature.
[0068] S304: Fuse the first embedded feature and the second embedded feature to determine a first fused feature.
[0069] In the embodiment of the present application, the first embedded feature and the second embedded feature can be combined to determine the corresponding first fusion feature.
[0070] In this embodiment, since the flow of people is affected by travel patterns and living areas, the flow of people in the sample area has obvious periodicity, such as weekly cycle, daily cycle and seasonality. Therefore, three embedding features are introduced to represent the weekly dimension embedding feature, daily dimension embedding feature and seasonal dimension embedding feature, respectively, denoted as , and Each of these three embedding features is d-dimensional. w(t), d(t), and s(t) are the sine and cosine functions that map time t to a weekday index (1 to 7), a minute index (1 to 1440), and a season index, respectively. The time dimension feature determined based on each embedding feature and the T-dimensional pedestrian flow feature is T×d-dimensional. Finally, each time dimension feature is summed to determine the corresponding second embedding feature.
[0071] In an embodiment of the present application, the spatial structure features of the base stations in the sample area are determined based on the adjacency features; the spatial structure features of the base stations are decomposed to obtain spatial dimension features, and the spatial dimension features are projected according to the embedding dimension to determine the first embedded feature; the pedestrian flow features are processed by embedding features corresponding to multiple time dimensions, the time dimension features under each time dimension are determined, and the second embedded feature is combined to determine the second embedded feature; wherein the dimension of the embedded feature is the embedding dimension; the first embedded feature and the second embedded feature are fused to determine the first fused feature. In this way, because the first embedded feature represents the distance feature between the sample base stations, and the second embedded feature represents the pedestrian flow features under different time dimensions, the first fused feature obtained by fusing the first embedded feature and the second embedded feature has the distance feature between the sample base stations and the pedestrian flow features under different time dimensions, and the first fused feature with multiple types of features can be used to train the initial prediction model, so that the features learned by the initial prediction model are more comprehensive, thereby improving the prediction accuracy of the preset prediction model.
[0072] See also Figure 5 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 4 , Figure 2 S203 in the above can also be realized by S401 to S404, which will be combined with Figure 5 The steps shown are explained: S401: Determine a first dependency between the flow of people of each sample base station in each sub-period based on a product of a first initial parameter and a first sample feature.
[0073] In an embodiment of the present application, the first initial parameters include: a first query parameter, a first key parameter, and a first value parameter; the first query feature is determined based on the product of the first query parameter and the first sample feature, and the first key feature is determined based on the product of the first key parameter and the first sample feature; the first dependency is determined based on the ratio of the T-th power of the product of the first query feature and the first key feature to the square root of the dimension corresponding to the first query feature.
[0074] In this embodiment, a spatial self-attention module is designed to capture dynamic spatial dependencies. In time steps t, the first query feature, first key feature, and first value feature that the self-attention mechanism focuses on can be expressed as follows: Formula (1) Formula (2) Formula (3) in, represents the first sample feature, Represents the first query parameter, Represents the first key parameter, Represents the first value parameter. represents the first query feature, represents the first key feature, Represents the first value feature. 、 and are learnable parameters with dimensions of , is the dimension of the first query feature, the first key feature, and the first value feature, and d is the feature dimension of the input. This allows us to apply self-attention in the spatial dimension to model the interactions between sample base stations and obtain the first dependency (attention score) between all sample base stations at time step t. The first dependency can be determined using Formula (4).
[0075] Formula (4) in, represents the first dependency of the t-th sub-period, represents the first query feature, Represents the first key feature. T represents the number of sub-periods. are the dimensions of the first query feature, the first key feature, and the first value feature.
[0076] In this way, the first dependency between the sample base stations can be seen It is different in different time slices, that is, dynamic. Therefore, it can be used to capture dynamic spatial dependencies. Finally, we can use the first dependency to multiply the first value feature to obtain the output of the spatial self-attention module.
[0077] S402: Update the first dependency based on the statistical similarity between the type characteristics of the public opinion type of each sample base station in each sub-period and the human flow characteristics of each sample base station in each sub-period.
[0078] In an embodiment of the present application, the prediction model training device can crawl the public opinion information corresponding to each sample base station on the Internet. Clustering is performed based on the public opinion information corresponding to each sample base station to determine the type characteristics of the public opinion type of the cluster center of each sample base station. The flow characteristics and type characteristics of each sub-period corresponding to each sample base station can be converted to the same dimension for similarity comparison, and the similarity weight of each type feature can be determined. Then, the similarity weight is used to perform weighted summation of the type characteristics in each sub-period of each sample base station to determine a feature. The first dependency is then updated using the sum of the features of multiple sample base stations.
[0079] In the embodiment of the present application, in order to simplify the public opinion type of complex public opinion events, the time series clustering algorithm is also used to cluster the public opinion type corresponding to each sample base station. i The type feature corresponding to the public opinion type as the cluster center represents the type feature corresponding to the i-th sub-period. Each sample base station corresponds to T time-series P i Among them, P i It can represent any one of the positive public opinion flow characteristics, negative public opinion flow characteristics, and normal public opinion flow characteristics.
[0080] S403: Determine a mask feature based on the similarity of the number of hops and the name attributes between every two sample base stations.
[0081] In an embodiment of the present application, the prediction model training device can determine each element in the mask feature based on the number of hops between each two sample base stations and the similarity between the name attributes of each two sample base stations, and then obtain the corresponding mask feature.
[0082] In an embodiment of the present application, the prediction model training device can determine each element of the first mask matrix based on the relationship between the number of hops between each two sample base stations and the first preset threshold value to obtain the first mask matrix; and determine each element of the second mask matrix based on the relationship between the similarity of the name attributes between each two sample base stations and the second preset threshold value to obtain the second mask matrix.
[0083] From a short-distance perspective, a first mask matrix can be defined, and the dimension of the first mask matrix is N × N. If the number of hops between two sample base stations is less than a first preset threshold, the corresponding elements of the two sample base stations in the first mask matrix are determined to be 1, otherwise they are 0.
[0084] From a long-distance perspective, a second mask matrix can be defined, and the dimension of the second mask matrix is N × N. If the similarity of the name attribute between two sample base stations is greater than a second preset threshold, the corresponding elements of the two sample base stations in the second mask matrix are determined to be 1, otherwise they are 0.
[0085] S404: Determine a first dependency feature based on the product of the mask feature and the updated first dependency.
[0086] In an embodiment of the present application, the prediction model training device can determine the first sub-dependency feature based on the product of the first mask matrix and the first dependency, and determine the second sub-dependency feature based on the product of the second mask matrix and the first dependency; wherein the first sub-dependency feature is used to characterize the dependency between the flow of people of different sample base stations under the influence of public opinion type and distance; the second sub-dependency feature is used to characterize the dependency between the flow of people of different sample base stations under the influence of public opinion type and name attribute.
[0087] Based on the two mask matrices above, we designed two spatial self-attention modules: geographic spatial self-attention and similarity spatial self-attention. Together, these two modules form a spatial self-attention module to capture the spatial characteristics of pedestrian traffic between long- and short-range sample base stations.
[0088] In an embodiment of the present application, based on the statistical type characteristics of the public opinion type of each sample base station in each sub-period and the similarity between the human flow characteristics of each sample base station in each sub-period, the first initial parameter is updated and determined; based on the product of the first initial parameter and the first sample characteristic, the first dependency between the human flow of each sample base station in each sub-period is determined; wherein, the first dependency is used to characterize the dependency of the human flow of each sample base station in the historical period in the spatial dimension; based on the similarity of the number of hops and name attributes between each two sample base stations, the mask feature is determined; based on the product of the mask feature and the first dependency, the first dependency feature is determined. In this way, the determined first dependency feature includes the dependency feature between the human flow of sample base stations affected by the public opinion type within a short distance and a long distance, and then the initial prediction model is trained by the first dependency feature, so that the initial prediction model can learn the human flow characteristics of the sample base stations affected by the public opinion type within a short distance and a long distance, which is more than what is learned in the related art, thereby improving the performance of the preset prediction model, and the prediction results of the preset prediction model are more accurate.
[0089] See also Figure 6 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 5 , Figure 5 S402 in the above can also be realized through S501 to S503, which will be combined with Figure 6 The steps shown are explained: S501: Convert the type feature and the pedestrian flow feature of each sample base station in each sub-period into the same dimension for similarity comparison, and determine the similarity weight of the type feature of each sample base station in each sub-period.
[0090] In an embodiment of the present application, the prediction model training device can convert the type characteristics of each sample base station in each sub-time period and the pedestrian flow characteristics of each sample base station in each sub-time period into the same dimension for similarity comparison, and determine the similarity weight of the type characteristics of each sample base station in each sub-time period.
[0091] In this embodiment of the present application, the prediction model training device can convert the type features of each sample base station in each sub-period into a corresponding dimension to obtain a type feature sequence corresponding to each sample base station. The pedestrian flow features of each sample base station in each sub-period can be converted into the same dimension to obtain a corresponding pedestrian flow feature sequence. A similarity comparison is then performed on these two sequences to determine a similarity weight for the type features of each sample base station in each sub-period.
[0092] Among them, for each sample base station in each sub-period of traffic flow characteristics X, the embedding matrix W can be used u Multiplying by X maps the traffic feature X into a high-dimensional representation . Identify the high-dimensional representation of the n-th sample base station in the t-th sub-period. Then use another embedding matrix W m The type feature P of each sample base station in each sub-period i Convert to memory vector m i As shown in formula (5): Formula (5) in, Represents the memory vector corresponding to the i-th sub-period, W m represents the embedding matrix, P i Represents the type feature corresponding to the i-th sub-period. The memory vector m in each sub-period of each sample base station can be compared i The sequence of the corresponding sample base station The similarity between the sequences is calculated to obtain the similarity weight w of the type features in the i-th sub-period i .
[0093] S502. Based on the similarity weight and the third initial parameter, weighted summation is performed on the type characteristics of each sample base station in each sub-period to determine the historical public opinion and human flow characteristics corresponding to each sample base station.
[0094] In an embodiment of the present application, based on the similarity weight of the type characteristics of each sample base station in each sub-time period and the third initial parameter, the type characteristics of T sub-time periods of each sample base station can be weighted and summed to determine the historical public opinion and traffic characteristics corresponding to each sample base station.
[0095] Among them, the representative public opinion flow patterns are weighted and summed according to the similarity weight to obtain the integrated historical public opinion flow representation of each node. As shown in formula (6): Formula (6) in, Represents the historical public opinion and traffic characteristics corresponding to the type characteristics of the nth sample base station in the i-th sub-period. i Represents the similarity weight of the type feature of the i-th sub-period. c Represents the third initial parameter, which is a learnable parameter matrix. i Represents the type characteristics corresponding to the i-th sub-period. T represents the number of sub-periods in the sub-historical period.
[0096] S503: Update the first key feature based on each historical public opinion traffic feature.
[0097] In an embodiment of the present application, the historical public opinion and traffic characteristics of multiple sample base stations can be accumulated and added to the first key feature to determine the latest first key feature.
[0098] in, Represents the historical public opinion and traffic characteristics corresponding to the type characteristics of the nth sample base station in the i-th sub-period. Finally, we use the integrated representation Rt of the historical public opinion and traffic characteristics of the N sample base stations to update the first key feature. Rt is added to the original first key feature to determine the latest first key feature.
[0099] In an embodiment of the present application, the type features and the traffic flow features of each sample base station in each sub-period are converted to the same dimension for similarity comparison, and the similarity weight of the type features of each sample base station in each sub-period is determined. Based on the similarity weight and the third initial parameter, the type features of each sample base station in each sub-period are weighted and summed to determine the historical public opinion traffic flow features corresponding to each sample base station. The first key feature is updated based on each historical public opinion traffic flow feature. In this way, the determined first key feature integrates the type features of the public opinion type, and more feature factors can be learned during the initial detection model training. Compared with the model training scheme in the related art, more factors are considered, and the performance of the trained preset prediction model is better, and the prediction results are more accurate.
[0100] See also Figure 7 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 6 , Figure 2 S204 in the above can also be realized by S601 to S603, which will be combined with Figure 7 The steps shown are explained: S601: Determine a second dependency of the flow of people at each sample base station in different sub-periods based on a product of a second initial parameter and a second sample feature.
[0101] In an embodiment of the present application, the second initial parameters include: a second query parameter, a second key parameter and a second value parameter; the prediction model training device can determine the second query feature based on the product of the second query parameter and the second sample feature, and determine the second key feature based on the product of the second key parameter and the second sample feature; the second dependency is determined based on the ratio of the T-th power of the product of the second query feature and the second key feature to the square root of the dimension corresponding to the second query feature.
[0102] In the embodiment of the present application, there are dependencies (e.g., periodicity, trend) between the flow of people in different sub-periods, and these dependencies may vary in different situations. Therefore, we use a temporal self-attention module to discover dynamic temporal patterns. Formally, for a sample base station n, in time step t, the second query feature, second key feature, and second value feature that the temporal self-attention mechanism focuses on can be expressed as follows: Formula (7) Formula (8) Formula (9) in, represents the second sample feature, Represents the second query parameter, Represents the second key parameter, Represents the second value parameter. represents the second query feature, represents the second key feature, Represents the second value feature. 、 and are learnable parameters with dimensions of , is the dimension of the second query feature, the second key feature, and the second value feature, and d is the feature dimension of the input. This allows self-attention to be applied to model the time dimension and to calculate the second dependency between all sub-periods at the sample base station n. The second dependency can be determined using Equation (10).
[0103] Formula (10) in, represents the second dependency of the nth base station, represents the second query feature, Represents the second key feature. T represents the number of sub-periods. is the dimension of the second query feature, the second key feature, and the second value feature.
[0104] S602. Determine a third mask matrix based on the public opinion life cycle of each sample base station in each sub-period.
[0105] In an embodiment of the present application, the prediction model training device can determine the reconstruction error of the public opinion life cycle of each sample base station in each sub-period based on the statistical number of public opinion comments for each sample base station in each sub-period; based on the relationship between the reconstruction error and a third preset threshold, each element in the third mask matrix is determined to obtain a third mask matrix. If the reconstruction error is greater than the third preset threshold, the corresponding element in the third mask matrix can be set to 1, otherwise it is set to 0, thereby obtaining the third mask matrix.
[0106] In the embodiment of the present application, temporal self-attention can discover different dynamic spatiotemporal features between different sample base stations. In addition, temporal self-attention has a global perception to model the long-range spatiotemporal dependencies between all time slices. Figure 8 From the perspective of the public opinion life cycle, the regional flow distribution will show a normal distribution over time. In addition, for the sample area, the development period, peak period and decline period of public opinion have the greatest impact on the flow of people to the scenic area, while the impact on the flow of people to the scenic area tends to be moderate during the budding period and the decline period. The number of comments on the public opinion event in each sub-period can be obtained for each sample base station. , represents the number of comments received by the nth sample base station during the i-th sub-period. This allows the number of comments on public opinion events at each sample base station during a historical period to be converted into a set of time series data. For example, during events such as sports games, concerts, and ball games in a city, public discussion will surge, and the number of people moving to the area will also increase. Conversely, for negative public opinion, public discussion will still surge, but the number of people moving to the area will decrease. However, the simple temporal self-attention module does not consider the impact of public opinion on human flow. During a public opinion event, public opinion in its incipient and subsiding stages has a smaller impact on human flow. Furthermore, the occurrence of each public opinion event is sporadic and therefore may not occur over a long period of time. To this end, we introduce a third mask matrix representing the public opinion lifecycle when processing each time slice. A variational autoencoder can be used to identify reconstruction errors within different sub-periods for each sample base station. These time slices with high reconstruction errors may be affected by sudden public opinion events or other factors. However, regardless of the factors, they are essentially public opinion-like events. The third mask matrix is constructed using the abnormal time steps. The dimension of the third mask matrix is N × T. The elements corresponding to the abnormal sub-periods of every two sample base stations are set to 1, and the others are set to 0. This allows us to ignore long periods of normal data without public opinion events and focus more on sub-periods with data changes.
[0107] S603: Determine a second dependency feature based on the product of the third mask matrix and the second dependency.
[0108] In an embodiment of the present application, the prediction model training device can determine the second dependency feature based on the product of the third mask matrix and the second dependency.
[0109] In an embodiment of the present application, based on the product of the second initial parameter and the second sample feature, the second dependency of the flow of people at each sample base station in different sub-periods is determined. Based on the public opinion life cycle of each sample base station in each sub-period, a third mask matrix is determined. The second dependency feature is determined based on the product of the third mask matrix and the second dependency. In this way, the determined second dependency feature includes the dependency features between the flow of people at sample base stations affected by the public opinion life cycle at different times, and then the initial prediction model is trained by the second dependency feature, which enables the initial prediction model to learn the dependency features between the flow of people at sample base stations affected by the public opinion life cycle at different times, which is more than what is learned in related technologies, thereby improving the performance of the preset prediction model, and the results predicted by the preset prediction model are more accurate.
[0110] See also Figure 9 , which is a flow chart of the prediction model training method provided in the embodiment of the present application Figure 7 , Figure 1 S103 in the above can also be realized by S701 to S702, which will be combined with Figure 9 The steps shown are explained: S701: Determine the loss of the initial prediction model based on a second fused feature obtained by fusing the first dependent feature and the second dependent feature.
[0111] In an embodiment of the present application, the prediction model training device may concatenate the features output by the self-attention heads corresponding to the first sub-dependent feature to obtain a first concatenation result, concatenate the features output by the self-attention heads corresponding to the second sub-dependent feature to obtain a second concatenation result, and then concatenate the features output by the self-attention heads corresponding to the second dependent feature to obtain a third concatenation result. The first, second, and third concatenation results are fused using a projection matrix to determine a second fused feature. The corresponding loss is then determined based on the second fused feature.
[0112] In this embodiment of the present application, the initial prediction model includes three types of attention heads: a geographic attention head for determining the first sub-dependency feature, a semantic attention head for determining the second sub-dependency feature, and a temporal attention head for determining the second dependency feature. The outputs of these three attention heads are concatenated and passed through a learnable projection matrix W. o The second fusion matrix is determined by fusion. The second fusion feature can be determined by formula (11).
[0113] Formula (11) in, represents the second fusion feature, Represents a splicing operation, Is the first splicing result, is the second splicing result and This is the third splicing result. 、 and are the number of corresponding attention heads, W o Is a d×d dimensional matrix, a learnable projection matrix. And set , keeping the dimension of the output features consistent with the input features, thereby better integrating spatial and temporal information.
[0114] S702: Iteratively update the first initial parameter, the second initial parameter, and the third initial parameter based on the loss until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0115] In an embodiment of the present application, the prediction model training device can iteratively update the first initial parameter, the second initial parameter and the third initial parameter based on the loss until the training is stopped when the predetermined training condition is reached to obtain a preset prediction model.
[0116] In the embodiment of the present application, the loss of the initial prediction model is determined based on the second fusion feature of the fusion of the first dependent feature and the second dependent feature. The first initial parameter, the second initial parameter and the third initial parameter are iteratively updated based on the loss until the training is stopped when the predetermined training conditions are reached, and a preset prediction model is obtained. In this way, the dependency characteristics of the flow of people at sample base stations at different distances and in different time periods under public opinion can be learned based on the first dependent feature and the second dependent feature. Compared with the prediction model in the related art, the learning is more comprehensive and more factors are considered. Therefore, the flow prediction result determined based on the trained preset prediction model is more accurate.
[0117] In the embodiment of this application, a prediction model training method is proposed, which introduces traffic data into the spatial self-attention module to capture the dynamic spatial dependency relationship between short and long distances. A public opinion perception module is designed to clearly model the gain effect of public opinion in spatial information, and temporal self-attention is used to identify dynamic temporal patterns. The mask features of public opinion events are designed according to the life cycle of public opinion to enhance the characteristics between time and public opinion. The overall architecture is as follows Figure 10 : In the embedding layer 100, the input adjacency features and the pedestrian flow features within each sub-period can be converted into high-dimensional representations, and the input features can be converted into matrices of N × T × d dimensions. To encode the sample base station network structure and the periodicity of pedestrian flow, two mechanisms can be used for conversion: spatial graph Laplace embedding and temporal periodic embedding. Spatial graph Laplace embedding is used to encode adjacency features, and temporal periodic embedding is used to model the periodicity of pedestrian flow features within each sub-period.
[0118] In the spatiotemporal coding layer 200, the core of the coding layer includes three components: a geospatial self-attention module 201, a semantic self-attention module 202, and a temporal self-attention module 203. The geospatial self-attention module 201 and the semantic self-attention module 202 are used to simultaneously analyze first-order dependency features at both long and short distances. The public opinion perception module 204 also extends the geospatial self-attention module 201 and the semantic self-attention module 202 to explicitly model the influence of spatial information propagation. Furthermore, the temporal self-attention module 203 is used to capture dynamic and long-range second-order dependency features.
[0119] In the splicing layer 205 , the features output by the geospatial self-attention module 201 , the semantic self-attention module 202 , and the temporal self-attention module 203 may be spliced and fused to determine a second fused feature.
[0120] In the output layer 300, a skip connection is used, consisting of 1×1 convolution, to transform the output features into a T×N×d sk Here d is a matrix of dimension d sk is the skip dimension. Then, the final hidden state matrix is obtained by summing the outputs of each skip connection layer. In order to make multi-step predictions, we directly use the output layer to convert the final hidden state matrix into the target dimension matrix, which can be determined by this formula (12): Formula (12) in, is the target dimension matrix of T×N×C dimensions, is the T-step prediction result, and Both are 1×1 convolutions. is the final hidden state matrix. Considering the cumulative error and model efficiency, a direct approach is chosen instead of a recursive approach for multi-step prediction.
[0121] See also Figure 11 , which is a flow chart of the method for predicting the flow of people provided in the embodiment of the present application Figure 1 , will combine Figure 11 The steps shown are explained: S801. Obtain target road network information within a target area. The target road network information is used to represent the adjacency relationship of target base stations within the target area.
[0122] In an embodiment of the present application, the prediction device obtains information about a target area to be predicted, determines a target base station in the target area based on the target area information, and obtains target road network information corresponding to the target base station. The target road network information is used to characterize the adjacency relationship of the target base stations in the target area.
[0123] The target road network information includes at least one of the following: relevant attributes of each target base station in the target area, the number of hops between every two target base stations in the target area, and adjacency characteristics of the target base stations in the target area; S802: Input the target road network information into a preset prediction model to determine the pedestrian flow prediction result for the target area.
[0124] In the embodiment of the present application, the prediction device inputs the target road network information into a preset prediction model to determine the pedestrian flow prediction result for the target area.
[0125] The crowd flow prediction results are used to characterize the inflow and outflow of people within each target base station in the target area.
[0126] Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependent feature and the second dependent feature until the training is stopped when the predetermined training conditions are reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependent feature of the pedestrian flow of sample base stations with different distances between each other under the influence of public opinion type, and the second dependent feature of the pedestrian flow of sample base stations in different time periods under the influence of public opinion life cycle; the sample road network information includes the adjacency relationship of sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
[0127] In the embodiment of the present application, because the initial prediction model learns the dependency characteristics of the pedestrian flow of sample base stations under public opinion at different distances and in different time periods based on the first dependency feature and the second dependency feature, it is more comprehensive and considers more factors than the prediction model in the related technology. Therefore, the pedestrian flow prediction result determined based on the trained preset prediction model is more accurate.
[0128] See also Figure 12 , which is a structural diagram of the prediction model training device provided in an embodiment of the present application.
[0129] The embodiment of the present application further provides a prediction model training device 600 , comprising: a first information acquisition unit 601 , a first determination unit 602 , and an updating unit 603 .
[0130] The first information acquisition unit 601 is configured to acquire sample road network information and sample pedestrian flow information within the sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; and the sample pedestrian flow information is used to represent the pedestrian flow within the sample base station range within a historical period. A first determining unit 602 is configured to input the sample road network information and the sample pedestrian flow information into an initial prediction model, and determine a first dependency characteristic of the pedestrian flow of sample base stations with different distances between each other under the influence of the public opinion type, and a second dependency characteristic of the pedestrian flow of sample base stations in different time periods under the influence of the public opinion life cycle; The updating unit 603 is configured to iteratively train the initial prediction model based on the first dependency feature and the second dependency feature until a predetermined training condition is met and the training is stopped to obtain a preset prediction model.
[0131] In the embodiment of the present application, the sample road network information includes at least one of the following: relevant attributes of each sample base station in the sample area, the number of hops between every two sample base stations in the sample area, and adjacency characteristics of the sample base stations in the sample area; The sample pedestrian flow information includes: pedestrian flow characteristics of each sample base station in the sample area in each sub-period; wherein, the historical period includes: T sub-periods; T is an integer greater than 1.
[0132] In the embodiment of the present application, the first determination unit 602 in the prediction model training device 600 is used to convert the adjacency feature and the pedestrian flow feature into the same dimension for fusion, thereby determining a first fused feature; wherein the first fused feature is determined based on the dimension of the sub-period, the dimension of the sample base station, and the embedding dimension; Slice the first fusion feature according to the dimension of the fixed sub-time period to obtain the first sample feature, and slice the first fusion feature according to the dimension of the fixed sample base station to obtain the second sample feature; Determine a first dependency based on the first initial parameter and the first sample feature, process the first dependency based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations, and determine a first dependency feature under the self-attention mechanism; wherein the first dependency is used to characterize the spatial dependency of the flow of people at each sample base station during the historical period; Based on the second initial parameters and the public opinion life cycle of each sample base station in each sub-period, the second sample feature is processed to determine the second dependent feature under the self-attention mechanism.
[0133] In the embodiment of the present application, the first determining unit 602 in the prediction model training device 600 is used to determine the spatial structure characteristics of base stations in the sample area based on the adjacency characteristics; Decomposing the base station spatial structure feature to obtain a spatial dimension feature, and projecting the spatial dimension feature according to the embedding dimension to determine a first embedding feature; Processing the pedestrian flow features by using the embedded features corresponding to the multiple time dimensions, determining the time dimension features under each time dimension, and combining each time dimension feature to determine a second embedded feature; wherein the dimension of the embedded feature is the embedding dimension; The first embedded feature and the second embedded feature are fused to determine a first fused feature.
[0134] In the embodiment of the present application, the first determining unit 602 in the prediction model training device 600 is configured to determine a first dependency between the flow of people at each sample base station in each sub-period based on the product of the first initial parameter and the first sample feature; Based on the statistical similarity between the type characteristics of the public opinion type of each sample base station in each sub-period and the pedestrian flow characteristics of each sample base station in each sub-period, the first dependency is updated; Determine the mask feature based on the similarity of the hop count and name attributes between each two sample base stations; Determine the first dependency feature based on the product of the mask feature and the updated first dependency, In the embodiment of the present application, the first initial parameter includes: a first query parameter, a first key parameter, and a first value parameter; In the embodiment of the present application, the first determining unit 602 in the prediction model training device 600 is configured to determine the first query feature based on the product of the first query parameter and the first sample feature, and to determine the first key feature based on the product of the first key parameter and the first sample feature; The first dependency is determined based on a ratio of the T-th power of the product of the first query feature and the first key feature to the square root of the dimension corresponding to the first query feature.
[0135] In the embodiment of the present application, the first determination unit 602 in the prediction model training device 600 is used to convert the type feature and the pedestrian flow feature of each sample base station in each sub-period into the same dimension for similarity comparison, and determine the similarity weight of the type feature of each sample base station in each sub-period; Based on the similarity weight and the third initial parameter, the type characteristics of each sample base station in each sub-period are weighted and summed to determine the historical public opinion and traffic characteristics corresponding to each sample base station; Update the first key feature based on each historical public opinion traffic feature.
[0136] In the embodiment of the present application, the first determination unit 602 in the prediction model training device 600 is configured to determine each element of the first mask matrix based on a relationship between the number of hops between each two sample base stations and a first preset threshold, thereby obtaining the first mask matrix; Based on the magnitude relationship between the similarity of the name attributes between each two sample base stations and a second preset threshold, each element of the second mask matrix is determined to obtain the second mask matrix.
[0137] In the embodiment of the present application, the first determining unit 602 in the prediction model training device 600 is configured to determine the first sub-dependency feature based on the product of the first mask matrix and the first dependency, and determine the second sub-dependency feature based on the product of the second mask matrix and the first dependency; Among them, the first sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of public opinion type and distance; the second sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of public opinion type and name attribute.
[0138] In the embodiment of the present application, the first determining unit 602 in the prediction model training device 600 is configured to determine the second dependency of the pedestrian flow of each sample base station in different sub-periods based on the product of the second initial parameter and the second sample feature; Determine a third mask matrix based on the public opinion life cycle of each sample base station in each sub-period; A second dependency feature is determined based on a product of the third mask matrix and the second dependency.
[0139] In the embodiment of the present application, the first determination unit 602 in the prediction model training device 600 is used to determine the reconstruction error of the public opinion life cycle of each sample base station in each sub-period based on the statistical number of public opinion comments of each sample base station in each sub-period; Based on the magnitude relationship between the reconstruction error and the third preset threshold, each element in the third mask matrix is determined to obtain the third mask matrix.
[0140] In the embodiment of the present application, the updating unit 603 in the prediction model training device 600 is used to determine the loss of the initial prediction model based on the second fusion feature fused with the first dependency feature and the second dependency feature; The first initial parameter, the second initial parameter and the third initial parameter are iteratively updated based on the loss until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
[0141] It should be noted that in the embodiments of the present application, if the above-mentioned prediction model training method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a prediction model training device (which can be a personal computer, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0142] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the first processor, the steps in the method on the prediction model training device 600 side are implemented.
[0143] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0144] It should be noted that Figure 13 A hardware entity diagram of a first electronic device provided in an embodiment of the present application is shown as follows: Figure 13 As shown, an embodiment of the present application provides a first electronic device 700, including a first memory 702 and a first processor 701. The first memory 702 stores a computer program that can be run on the first processor 701. When the first processor 701 executes the program, the steps in the above method are implemented, wherein; The first processor 701 generally controls the overall operations of the first electronic device 700 .
[0145] The first memory 702 is configured to store instructions and applications executable by the first processor 701, and can also cache data to be processed or processed by the first processor 701 and various modules in the first electronic device 700 (for example, image data, audio data, voice communication data and video communication data), and can be implemented by flash memory (FLASH) or random access memory (RAM).
[0146] Correspondingly, an embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the first processor 701 of the first electronic device 700 to complete the steps in the method on the prediction model training device 800 side.
[0147] See also Figure 14 , is a structural diagram of the pedestrian flow prediction device provided in an embodiment of the present application.
[0148] The embodiment of the present application further provides a pedestrian flow prediction device 800 , comprising: a second information acquisition unit 801 and a second determination unit 802 .
[0149] The second information acquisition unit 801 is configured to acquire target road network information within the target area; wherein the target road network information is used to characterize the adjacency relationship of the target base station within the target area; The second determining unit 802 is configured to input the target road network information into a preset prediction model to determine a pedestrian flow prediction result for the target area; Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependent feature and the second dependent feature until the training is stopped when the predetermined training conditions are reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependent feature of the pedestrian flow of sample base stations with different distances between each other under the influence of public opinion type, and the second dependent feature of the pedestrian flow of sample base stations in different time periods under the influence of public opinion life cycle; the sample road network information includes the adjacency relationship of sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
[0150] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the second processor, the steps in the method on the side of the pedestrian flow prediction device 800 are implemented.
[0151] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0152] It should be noted that Figure 15 A schematic diagram of a hardware entity of a second electronic device provided in an embodiment of the present application is shown as follows: Figure 15 As shown, an embodiment of the present application provides a second electronic device 900, including a second memory 902 and a second processor 901, wherein the second memory 902 stores a computer program that can be run on the second processor 901, and the second processor 901 implements the steps in the above method when executing the program, wherein; The second processor 901 generally controls the overall operations of the second electronic device 900 .
[0153] The second memory 902 is configured to store instructions and applications executable by the second processor 901, and can also cache data to be processed or processed by the second processor 901 and each module in the second electronic device 900 (for example, image data, audio data, voice communication data and video communication data), which can be implemented by flash memory (FLASH) or random access memory (RAM).
[0154] Correspondingly, an embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the second processor 901 of the second electronic device 900 to complete the steps in the method on the side of the pedestrian flow prediction device 800.
[0155] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0156] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0157] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0158] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0159] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0160] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), magnetic disks or optical disks.
[0161] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program code, such as a mobile storage device, ROM, magnetic disk or optical disk.
[0162] The above are only implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the protection scope of the present application.
Claims
1. A prediction model training method, characterized in that: include: Obtaining sample road network information and sample pedestrian flow information within the sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; and the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station during a historical period; Inputting the sample road network information and the sample pedestrian flow information into an initial prediction model, determining a first dependency characteristic of the pedestrian flow of the sample base stations with different distances between each other under the influence of the public opinion type, and a second dependency characteristic of the pedestrian flow of the sample base stations in different time periods under the influence of the public opinion life cycle; The initial prediction model is iteratively trained based on the first dependency feature and the second dependency feature until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
2. The prediction model training method according to claim 1, characterized in that The sample road network information includes at least one of the following: relevant attributes of each of the sample base stations in the sample area, the number of hops between every two of the sample base stations in the sample area, and adjacency characteristics of the sample base stations in the sample area; The sample pedestrian flow information includes: pedestrian flow characteristics of each sample base station in the sample area in each sub-time period; wherein, the historical time period includes: T sub-time periods; T is an integer greater than 1.
3. The prediction model training method according to claim 2, characterized in that: The determining of the first dependency feature of the foot traffic of the sample base stations with different distances between each other under the influence of the public opinion type, and the second dependency feature of the foot traffic of the sample base stations in different time periods under the influence of the public opinion life cycle, includes: Converting the adjacency feature and the pedestrian flow feature into the same dimension for fusion to determine a first fusion feature; wherein the first fusion feature is determined based on the dimension of the sub-period, the dimension of the sample base station, and the embedding dimension; Slicing the first fused feature according to a fixed sub-time period to obtain a first sample feature, and slicing the first fused feature according to a fixed sample base station dimension to obtain a second sample feature; Determining a first dependency based on the first initial parameter and the first sample feature, and processing the first dependency based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations, to determine the first dependency feature under the self-attention mechanism; wherein the first dependency is used to characterize the spatial dependency of the flow of people at each sample base station during a historical period; Based on the second initial parameter and the public opinion life cycle of each sample base station in each sub-period, the second sample feature is processed to determine the second dependent feature under the self-attention mechanism.
4. The prediction model training method according to claim 3, characterized in that The converting the adjacency feature and the pedestrian flow feature into the same dimension for fusion to determine a first fusion feature includes: Determining a base station spatial structure feature within the sample area based on the adjacency feature; Decomposing the base station spatial structure feature to obtain a spatial dimension feature, and projecting the spatial dimension feature according to the embedding dimension to determine a first embedding feature; Processing the pedestrian flow feature by using the embedded features corresponding to the multiple time dimensions, determining the time dimension feature under each time dimension, and combining each of the time dimension features to determine a second embedded feature; wherein the dimension of the embedded feature is the embedding dimension; The first embedded feature and the second embedded feature are fused to determine the first fused feature.
5. The prediction model training method according to claim 3, characterized in that: The determining of the first dependency based on the first initial parameter and the first sample feature, processing the first dependency based on the public opinion type, the name attribute of each sample base station, and the number of hops between different sample base stations, and determining the first dependency feature under the self-attention mechanism includes: determining, based on a product of the first initial parameter and the first sample feature, the first dependency between the pedestrian flows of each of the sample base stations in each sub-period; Updating the first dependency based on the statistical similarity between the type characteristics of the public opinion type of each of the sample base stations in each sub-period and the human flow characteristics of each of the sample base stations in each sub-period; determining a mask feature based on the similarity of the number of hops and the name attribute between every two of the sample base stations; The first dependency feature is determined based on a product of the mask feature and the updated first dependency.
6. The prediction model training method according to claim 5, characterized in that: The first initial parameters include: a first query parameter, a first key parameter, and a first value parameter; The determining, based on the product of the first initial parameter and the first sample feature, the first dependency between the pedestrian flow of each of the sample base stations in each sub-period includes: determining a first query feature based on a product of the first query parameter and the first sample feature, and determining a first key feature based on a product of the first key parameter and the first sample feature; The first dependency is determined based on a ratio of the T-th power of the product of the first query feature and the first key feature to the square root of a dimension corresponding to the first query feature.
7. The prediction model training method according to claim 6, characterized in that: The updating of the first dependency based on the statistical similarity between the type feature of the public opinion type of each sample base station in each sub-period and the pedestrian flow feature of each sample base station in each sub-period includes: Convert the type feature and the pedestrian flow feature of each sample base station in each sub-period into the same dimension for similarity comparison, and determine the similarity weight of the type feature of each sample base station in each sub-period; Based on the similarity weight and the third initial parameter, weighted summation of the type features of each sample base station in each sub-period is performed to determine the historical public opinion and human flow features corresponding to each sample base station; The first key feature is updated based on each of the historical public opinion traffic features.
8. The prediction model training method according to claim 5, characterized in that: The mask feature includes: a first mask matrix and a second mask matrix; and determining the mask feature based on the similarity of the number of hops and the name attribute between each two sample base stations includes: Determine each element of the first mask matrix based on a relationship between the number of hops between each two of the sample base stations and a first preset threshold, to obtain the first mask matrix; Based on the relationship between the similarity of the name attributes between each two of the sample base stations and a second preset threshold, each element of the second mask matrix is determined to obtain the second mask matrix.
9. The prediction model training method according to claim 8, characterized in that: The first dependency feature includes: a first sub-dependency feature and a second sub-dependency feature; and determining the first dependency feature based on the product of the mask feature and the updated first dependency includes: determining the first sub-dependency feature based on a product of the first mask matrix and the first dependency, and determining the second sub-dependency feature based on a product of the second mask matrix and the first dependency; Among them, the first sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of the public opinion type and distance; the second sub-dependency feature is used to characterize the dependence between the flow of people of different sample base stations under the influence of the public opinion type and the name attribute.
10. The prediction model training method according to claim 3, characterized in that: The processing of the second sample feature based on the second initial parameter and the public opinion life cycle of each sample base station in each sub-period to determine the second dependent feature under the self-attention mechanism includes: Determining a second dependency of the pedestrian flow of each of the sample base stations in different sub-periods based on the product of the second initial parameter and the second sample feature; Determining a third mask matrix based on the public opinion life cycle of each sample base station in each sub-period; The second dependency feature is determined based on a product of the third mask matrix and the second dependency.
11. The prediction model training method according to claim 10, characterized in that: The determining of a third mask matrix based on the public opinion life cycle of each sample base station in each sub-period includes: Determine the reconstruction error of the public opinion life cycle of each sample base station in each sub-period based on the statistical number of comments on the public opinion of each sample base station in each sub-period; Based on the magnitude relationship between the reconstruction error and a third preset threshold, each element in the third mask matrix is determined to obtain the third mask matrix.
12. The prediction model training method according to any one of claims 1 to 11, characterized in that: The iteratively training the initial prediction model based on the first dependency feature and the second dependency feature until a predetermined training condition is reached and the training is stopped to obtain a preset prediction model, comprising: determining a loss of the initial prediction model based on a second fused feature obtained by fusing the first dependent feature and the second dependent feature; The first initial parameter, the second initial parameter and the third initial parameter are iteratively updated based on the loss until the training is stopped when a predetermined training condition is reached, thereby obtaining a preset prediction model.
13. A method for predicting passenger flow, characterized in that: include: Acquire target road network information within a target area; wherein the target road network information is used to characterize the adjacency relationship of target base stations within the target area; Inputting the target road network information into a preset prediction model to determine a pedestrian flow prediction result for the target area; Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependency feature and the second dependency feature until the training is stopped when the predetermined training condition is reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependency feature of the pedestrian flow of sample base stations with different distances between each other under the influence of the public opinion type, and the second dependency feature of the pedestrian flow of the sample base stations in different time periods under the influence of the public opinion life cycle; the sample road network information includes the adjacency relationship of the sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
14. A prediction model training device, characterized in that: include: A first information acquisition unit is configured to acquire sample road network information and sample pedestrian flow information within a sample area; wherein the sample road network information includes the adjacency relationship of sample base stations within the sample area; and the sample pedestrian flow information is configured to characterize the pedestrian flow within the range of the sample base station within a historical period; A first determining unit is configured to input the sample road network information and the sample pedestrian flow information into an initial prediction model, and determine a first dependency characteristic of the pedestrian flow of the sample base stations with different distances between each other under the influence of the public opinion type, and a second dependency characteristic of the pedestrian flow of the sample base stations in different time periods under the influence of the public opinion life cycle; An updating unit is used to iteratively train the initial prediction model based on the first dependency feature and the second dependency feature until a predetermined training condition is reached and the training is stopped to obtain a preset prediction model.
15. A pedestrian flow prediction device, characterized in that: include: A second information acquisition unit is configured to acquire target road network information within a target area; wherein the target road network information is used to characterize the adjacency relationship of target base stations within the target area; A second determining unit is configured to input the target road network information into a preset prediction model to determine a pedestrian flow prediction result for the target area; Among them, the preset prediction model is obtained by iteratively training the initial prediction model based on the first dependency feature and the second dependency feature until the training is stopped when the predetermined training condition is reached; the sample road network information and the sample pedestrian flow information are input into the initial prediction model to determine the first dependency feature of the pedestrian flow of sample base stations with different distances between each other under the influence of the public opinion type, and the second dependency feature of the pedestrian flow of the sample base stations in different time periods under the influence of the public opinion life cycle; the sample road network information includes the adjacency relationship of the sample base stations in the sample area; the sample pedestrian flow information is used to characterize the pedestrian flow within the range of the sample base station in the historical period.
16. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented, or the steps of the method according to claim 13 are implemented.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 12, or implements the steps of the method according to claim 13.
18. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 12, or implements the steps of the method according to claim 13.
Citation Information
Patent Citations
Intelligent early warning model establishment method and device for alarm occurrence area and storage medium
CN110929915A
Crowd portrait prediction method, device and equipment and storage medium
CN111429185A
Model training method and device, parameter prediction method and device, electronic equipment and storage medium
CN111860763A
Pedestrian flow prediction method and device, computer equipment and storage medium
CN112418567A
Pedestrian flow prediction method and system based on knowledge graph and space-time diagram convolution
CN116562449A