CN117635218A - Business district flow prediction method based on six-degree separation theory and graph annotation network - Google Patents
Business district flow prediction method based on six-degree separation theory and graph annotation network Download PDFInfo
- Publication number
- CN117635218A CN117635218A CN202410103109.1A CN202410103109A CN117635218A CN 117635218 A CN117635218 A CN 117635218A CN 202410103109 A CN202410103109 A CN 202410103109A CN 117635218 A CN117635218 A CN 117635218A
- Authority
- CN
- China
- Prior art keywords
- attention
- business turn
- flow prediction
- node
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000000926 separation method Methods 0.000 title claims abstract description 27
- 230000008569 process Effects 0.000 claims abstract description 15
- 238000012549 training Methods 0.000 claims abstract description 15
- 238000000605 extraction Methods 0.000 claims abstract description 12
- 238000010586 diagram Methods 0.000 claims abstract description 7
- 239000011159 matrix material Substances 0.000 claims description 33
- 239000013598 vector Substances 0.000 claims description 22
- 238000010276 construction Methods 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000007246 mechanism Effects 0.000 claims description 9
- 238000005457 optimization Methods 0.000 claims description 6
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 claims description 5
- 230000004913 activation Effects 0.000 claims description 4
- 230000002776 aggregation Effects 0.000 claims description 3
- 238000004220 aggregation Methods 0.000 claims description 3
- 238000005070 sampling Methods 0.000 claims description 3
- 230000004927 fusion Effects 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 10
- 230000008878 coupling Effects 0.000 abstract description 4
- 238000010168 coupling process Methods 0.000 abstract description 4
- 238000005859 coupling reaction Methods 0.000 abstract description 4
- 238000013528 artificial neural network Methods 0.000 description 4
- 238000009826 distribution Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0201—Market modelling; Market analysis; Collecting market data
- G06Q30/0202—Market predictions or forecasting for commercial activities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/042—Knowledge-based neural networks; Logical representations of neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
- G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Entrepreneurship & Innovation (AREA)
- Game Theory and Decision Science (AREA)
- Economics (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a business turn flow prediction method based on a six-degree separation theory and a graph annotation network, which comprises the following steps: s1, acquiring business turn flow data; s2, constructing a self-adaptive business turn flow diagram structure based on a six-degree separation theory; s3, extracting time features based on a linear gating convolution attention unit; s4, extracting spatial features based on the attention of the multi-head graph; s5, outputting a prediction result through the full connection layer, and completing establishment of a business turn flow prediction model; s6, training a business turn flow prediction model; s7, calling a trained business district flow prediction model to conduct flow prediction. The invention solves the problems of special business circle characteristics of business circle flow prediction and node long-distance space correlation, time lag and dynamic coupling caused by business marketing activities, and has obvious difference with space-time characteristic extraction in other flow prediction processes.
Description
Technical Field
The invention belongs to the technical field of business prediction, and particularly relates to a business district flow prediction method based on a six-degree separation theory and a graph annotation network.
Background
Market traffic prediction is important to market operation and management. Through accurate flow prediction, a mall can customize different business strategies. Flow prediction is an indispensable component in intelligent mall management systems, and existing flow prediction models are roughly divided into prediction models based on deep neural networks. Most of prediction models based on linear statistical theory and machine learning realize static modeling prediction, information is considered on a single space or time scale, but dynamic dependency relation among multivariate time sequence data cannot be mined, and the prediction model based on the deep neural network has remarkably progressed in flow prediction. Wherein the graph neural network is more suitable for modeling complex relationships in the node network. The method effectively captures complex relationships among nodes by means of the graph structure, enables the nodes to aggregate and propagate information through iterative updating of node characteristics, and shows excellent achievement in flow prediction.
The graph model construction method has three types: domain knowledge based methods, text data based methods, data based methods.
(1) The method for constructing the graph model based on the domain knowledge comprises the steps of representing nodes in data as nodes of the graph, and determining connection relations among the nodes according to the knowledge or priori information of domain experts; or constructing the domain knowledge as an entity relation triplet, and constructing an entity relation graph, wherein the entities are used as nodes, the relation among the entities is represented by edges, and the weight of the edges can reflect the strength or the relativity of the relation; both of these construction methods rely on domain expert knowledge.
(2) The graph model construction method based on the text data converts information in the text data into a graph structure, for example, a word co-occurrence graph is created, wherein words in the text are regarded as nodes, co-occurrence relations among the words are represented by edges, and the weight of the edges can represent the co-occurrence frequency.
(3) The data-based graph model construction method comprises two steps of a k-nearest neighbor graph and a radius neighbor graph, wherein each data point is represented as a node of the graph, the distance or similarity between the nodes is calculated, and the nearest k nodes are selected to establish edge connection; the radius neighbor graph also represents data points as nodes, but determines whether or not nodes are connected according to a predefined distance radius.
These methods provide a base graph structure for various tasks by capturing relationships between data points. The data-based construction method has the advantages of automation, data driving, interpretability, wide applicability and the like, so that the method becomes a universal and powerful tool for constructing the graph model. Because they extract information directly from the data, they do not rely on domain knowledge or interpretation of textual data, and are therefore versatile for use in a variety of data types and domains, suitable for large-scale data processing and machine learning tasks.
However, the existing data-based graph model construction method and the flow prediction scheme based on the graph neural network still have limitations, and are difficult to apply to business district flow prediction in real life, and the main reasons are as follows:
1. when the existing method is used for constructing the graph model, only the real position distribution among nodes is considered, but the influences caused by daily visible marketing modes and market activities in the business district flow prediction are not considered, namely the space dependence among the market and the market positions is highly dynamic, but not static.
2. The existing scheme has the problem of over-smoothing, so that long-distance spatial correlation is difficult to capture, a plurality of markets exist in a market, certain similarity exists among the markets, two remote market positions possibly have similar flow structures, and the spatial correlation is long-distance.
3. Existing methods do not take into account the effects of time delays that may occur in the propagation of spatial information between locations. For example, when a point begins a commodity promotion, a period of time (delay) is required to affect the flow conditions between the shops.
Disclosure of Invention
The embodiment of the invention aims to provide a business turn flow prediction method based on a six-degree separation theory and a graph annotation network, which is used for capturing long-distance spatial correlation according to a business turn dynamic adjustment graph construction mode and introducing a linear gating convolution attention unit to realize business turn flow prediction.
In order to solve the technical problems, the technical scheme adopted by the invention is that a business turn flow prediction method based on a six-degree separation theory and a graph annotation network comprises the following steps:
s1, acquiring business turn flow data;
s2, constructing a self-adaptive business turn flow diagram structure based on a six-degree separation theory;
s3, extracting time features based on a linear gating convolution attention unit;
s4, extracting spatial features based on the attention of the multi-head graph;
s5, outputting a prediction result through the full connection layer, and completing establishment of a business turn flow prediction model;
s6, training a business turn flow prediction model;
s7, calling a trained business district flow prediction model to conduct flow prediction.
Further, the business district flow data collected in the step S1 comprises a business district range, a business place, a collection frequency and a collection time period.
Further, the construction process of the self-adaptive business turn flow chart structure based on the six-degree separation theory in S2 is as follows:
s21, calculating correlation coefficients of node variables of any two shops to obtain an affinity matrix S; normalizing the affinity matrix S, then any element in the matrixTake a value between 0 and 1; the upper triangular matrix elements in the affinity matrix S are arranged in a descending order; when->At this time, the corresponding position of the adjacency matrix A is +.>Setting 1 and the rest as 0 to obtain an adjacent matrix A; />Is a threshold value;
s22, respectively calculating corresponding networks for the adjacent matrix AMean uniformity of the networkAnd the network average cluster coefficientCCAnd finally forming; intersection of two curves->Is a balance point of efficiency and network redundancy; />Is->AndCCthe value of the network radius at the intersection point of the curves;
s23, to balance pointThe value is used as the optimal threshold value, and the distance is more than or equal to +.>Is connected to form a business turn flow node graph structure.
Further, the step S3 of extracting the time feature based on the linear gating convolution attention unit specifically includes: firstly, replacing a self-attention mechanism in a transducer model with local context-sensitive convolution attention to form a gating attention unit, and fitting time dimension characteristics of time sequence data; input is a time length ofDividing the input time sequence data into blocks, using accurate convolution attention in the blocks and using quick linear attention across the blocks to obtain a gating attention unit with linear complexity; and then, the input data is subjected to time convolution by a gating attention unit with linear complexity, and a feature vector of correlation among all time stamps is output.
Further, the S4 extracting spatial features based on the attention of the multi-head graph specifically includes:
and (3) inputting the time feature vector obtained in the step (S3) into a space convolution layer, and calculating to obtain a feature vector with space characteristics, wherein the specific calculation process is as follows:
wherein (1)>Is a matrix splicing operation; for the same node, multi-head self-attentions are calculated respectively +.>Sub-attentions and combining +.>Secondary attention; />Is->Layer node->Feature vector of>Is->Layer node->After the aggregation operation (i.e. the operation in the formula) with the attention mechanism as the core, the feature vector is output as node +.>Is->It can be understood that the different nodes +.>Expression of the features, th->Personal node->The +.sup.th after the attentional mechanisms>The individual node characteristics are represented.
Head of attention, head of attention>Representing the attention factor, +.>Representing node->Degree of (1)/(2)>,/>Is a parameter that can be learned, < >>Is->Vector representation of node, ">Indicating index +.>Middle->Node pair->Attention weight of the node; />Is an activation function->Is->Vector representation of the nodes;
attention coefficientThe calculation method of (2) is as follows:
wherein->As a parameter that can be learned,first->Attention coefficient of individual head,/->Is an exponential function, ++>Is node->Is described.
Further, the step S5 specifically includes: fusion of time feature extraction and space feature vector through full connection layer and output of length asPredicted outcome of->The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Representing node index,/->Indicate time of day->Is indicated at->Time node->Is a predicted value of (a).
Further, the process of training the model S6 specifically includes:
s61, training a model through a mean square error loss function, wherein the loss function is as follows:
wherein->Is the total number of samples in the time series used to calculate the loss, < >>Is a true value, < >>Is a predicted value;
s62, solving the gradient of the network error for each weight parameter in the back propagation by utilizing an Adam optimization algorithm, and obtaining a new weight through a parameter updating process; the model weights are iteratively calculated until a predetermined small penalty is reached and the best predicted value is obtained.
Further, the step S7 of calling the trained business district flow prediction model to perform flow prediction specifically includes:
s71, starting real-time data acquisition, maintaining the sampling frequency for 5 minutes once, and inputting acquired data into the graph structure obtained in the S2;
s72, calling the model built in S6, and outputting the predicted flow value.
The invention has the beneficial effects that
Aiming at the problem that business circles with complex business attributes are easily influenced by marketing and activities, the invention provides a self-adaptive business circle flow prediction method based on a six-degree separation idea, and solves the problems of dynamic coupling relationship of the shops, caused by marketing activities, in a business scene, over-smooth problem caused by similarity of the shops in the business circles and flow time lag of the marketing activities. The invention can be directly applied to different business circles without manually adjusting the graph structure of the business circle flow node space relation due to the business circle difference.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of a detection method of the present invention;
FIG. 2 is a flowchart of an adaptive adjacency matrix generation algorithm based on the idea of six degrees of separation;
FIG. 3 is a block diagram of a business turn flow prediction model based on the idea of six degrees of separation.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 3, the business turn flow prediction method based on six-degree separation theory and graph annotation network provided by the invention specifically comprises the following seven steps, wherein the first step is data statistics, the second step is graph model construction of business turn flow, the third to fifth steps are prediction model construction, the sixth step is model training strategy, and the seventh step is deployment and application of the method. The details are as follows:
the first step: flow data statistics
Firstly, a detailed business turn flow data acquisition plan is formulated, which comprises the steps of selecting a business turn range, a business place, an acquisition frequency and an acquisition time period. And deploying the business turn flow data acquisition equipment at a gate of a business house to ensure that the position and the angle of the equipment are suitable for capturing flow conditions. The device is started up as planned, recording of traffic data is started, and a data storage and management system is established. The data is ensured to be cleaned and checked regularly in the whole process, a time stamp is added, data backup is carried out, and the data safety and privacy are ensured.
And a second step of: self-adaptive business turn flow chart model based on six-degree separation theory
According to the six-degree separation theory and the characteristics of high marketing message propagation efficiency and local aggregation of shops in a real business district, the method combinesAnd (3) constructing a radius network, namely constructing a business turn flow diagram model. FIG. 2 is a flow chart of the algorithm, wherein S is the correlation between any two flow nodes to form an affinity matrix, A is the correlation between any two flow nodes according to +.>The node adjacency matrix of the graph structure constructed by the radius network construction technology is characterized in that CC (A) quantifies the connection degree between nodes in the complex network, and h (A) is used for measuring the global transmission capacity of the complex network. In the statistical graph, the ordinate represents the values of CC (a) and h (a), and the abscissa represents the values of different radii.
Based on six-degree separation theory, the relationship among all nodes of the business district can be established through no more than six intermediate layersIn connection, marketing messages may be propagated through a very small number of nodes. Meanwhile, the distribution of the shops of the business circles is divided into areas according to the types, and the clusters can be realized according to the self-defined distances (such as the correlation among the shops, the actual distance among the shops and the like), so that the distribution of the shops of the business circles is realized according to the following stepsThe radius network construction technology can realize the construction of the graph among business district nodes. Threshold +.>Is very important to choose a largerWhen the invention is used, an extremely sparse random network is obtained. When->As it decreases, the network connection will become denser and its characteristics will begin to evolve towards a fully connected regular network. Therefore, the invention averages consistency through sparsity networkh)And clustering coefficient [ ]CC)Quantitative calculation of graph structure propagation efficiency and sparsity, finding the balance between the two, thereby determining the threshold +.>. The specific construction process of the graph structure is as follows:
firstly, calculating correlation coefficients of node variables of any two shops to obtain an affinity matrix S. After normalization, each element in the matrixThe value is between 0 and 1.
Then the upper triangular matrix elements in the affinity matrix S are arranged in a descending order; threshold valueStarting from 1, the interval is +.>I.e.。
If it isThe corresponding position of the adjacency matrix A is then +.>Let 1 and the rest be 0, and obtain an adjacency matrix a.
Will beGradually decrease to 0, get +.>And (5) a graph structure.
For the obtained adjacent matrix, respectively calculating the corresponding average consistency of the networkAnd the network average cluster coefficientCCFinally form->AndCCa curve. />Is an index for measuring the propagation efficiency of the network,CCis an index for measuring the connection degree between network nodes. Our aim is to construct a graph structure with both efficiency and information content, while the intersection of the two curves is +.>Is a balance between efficiency and network redundancy and is therefore the optimal threshold for constructing adjacency matrices.
Subsequently, we will balance the pointThe value is used as a threshold value, and the distance is greater than or equal to +.>Is connected by node pairsAnd (5) forming a business turn flow node diagram structure. The business turn flow chart model construction method can adaptively and dynamically adjust construction parameters according to the distribution of businesses and shops of different business turns, reduces the workload of the method applied to current real time, avoids the necessity of setting parameters according to experience by an operator, and selects optimal parameters through observation experiments, thereby being time-consuming and labor-consuming and having no theoretical support.
And a third step of: time feature extraction based on linear gating convolution attention unit
The step is a time feature extraction layer of the model, the layer is the initial of the model, and the input is the time lengthSimultaneously inputting the adjacency matrix after the second step of construction.
Because the network such as RNN, LSTM and the like which are used for extracting the nonlinear time characteristic is difficult to capture the long-term dependency relationship at present, the transducer model carries out dot product self-attention on time sequence point by point, ignores the context information and is insensitive to the influence brought by surrounding business marketing activities. Therefore, the invention replaces the self-attention mechanism in the transducer with the local context sensitive convolution attention to form a gating attention unit, and fits the time dimension characteristic of the time sequence data. Because of the secondary complexity of the gated attention unit, the need for business turn traffic prediction uses longer business turn traffic data resulting in a significant amount of computation. In order to solve the problem, the invention blocks the input time sequence data, uses accurate convolution attention in the blocks and uses quick linear attention across the blocks, thereby obtaining the gating attention unit with linear complexity.
In detail, this layer is time convolved by a linear gated convolution attention unit, adaptively capturing the correlation of data between time stamps, where CA focuses attention on local context changes, thereby learning more features. After passing through the time convolution layer, a feature vector capturing the correlation between the time stamps is output. The linear gated convolution attention unit structure is shown in FIG. 3, where CA represents the convolution attention module and ACA represents the input dependent vectorThe computed convolution concentration, dense, represents the dense connection layer used to weight the integration information. Xt x UT + bT, xt x WT + cT is the fast linear attention module, sigma represents the activation function,representing cross-multiplication.
The time feature extraction method provided by the invention can solve the problems of special business circle characteristics of business circle flow prediction and node long-distance space correlation, time lag and dynamic coupling caused by business marketing activities, and has obvious difference with space-time feature extraction in the flow prediction process of other prior art.
Fourth step: spatial feature extraction based on multi-head graph attention
To fully exploit the information of the nodes and their neighbors, the method uses multi-head graph attention to construct a spatial convolution layer. The multi-head graph attention can model long-term dependence and short-term dependence simultaneously, calculate the attention of different subspaces in parallel, and finish multi-step long-distance prediction. The extracted time feature vector obtained in the third step is input into a space convolution layer, and the feature vector with space characteristics is obtained through calculation, wherein the specific calculation process is as follows:
wherein (1)>Is a matrix stitching operation. For the same node, multi-head self-attentions are calculated respectively +.>Sub-attentions and combining +.>Secondary attention. />Is the first/>Node->Characteristic variable of->Attention-pointing head->For attention vector, < >>Representing node->Degree of (1)/(2)>,/>Is a parameter that can be learned, < >>Is->Vector representation of nodes,>indicating index +.>Middle->Node pair->Attention weight of the node.
The multi-head self-attention can further mine the potential of node data, so that the model can better understand the characteristic meaning of the node. The calculation of the attention coefficients is performed by a Multi-layer persistence (MLP), the specific formula is as follows:
wherein->Is a learnable parameter->Is an activation function. />First->Attention coefficient of individual head,/->Representing attention vectors, < >>Is an exponential function, ++>Is node index,/->Is node->Is described.
Fifth step: and (5) a full connection layer.
After time feature extraction and space feature extraction, the method passes through a full connection layer to realize the length ofIs +.>. Wherein (1)>Representing node index,/->Indicate time of day->Is shown inTime node->Is referred to herein generally as meaning all nodes.
Sixth step: and (5) training a business turn flow prediction model.
After the model is built, model training is started. Model training strategies were as follows:
the mean square error loss function is used for model training optimization, and the definition formula of the loss function is as follows:
wherein->Is the total number of samples in the time series used to calculate the loss, < >>Is a true value, < >>Is a predicted value.
According to the framework, the gradient of the network error is calculated for each weight parameter in the back propagation by utilizing an Adam optimization algorithm, and a new weight is obtained through a parameter updating process. The model weights are iteratively calculated until a predetermined small penalty is reached and the best predicted value is obtained. Adam was chosen as the optimization algorithm because it can design independent adaptive learning rates for different parameters. Most importantly, using Adam makes the computation more efficient, the training algorithm overall is as follows:
(1) Inputting multivariable time sequence data X and an adjacent matrix A;
(2) Initializing a model: determining learning rateBatch size->Number of iterationsiterInitializing a weight matrix W and a bias matrix +.>。
(3) Cyclic training network:
A. b data are sampled from the multivariate time series data X each time until the data are all collected once:
1. calculation of
2. Calculating Loss of Loss
3. Calculating gradient, updating parameters by using optimization algorithm, wherein the learning rate is。
B. iter+1
(4) And (5) completing circulation and finishing model training.
Seventh step: model deployment and flow prediction
As in fig. 1, real-time data acquisition is initiated, the sampling frequency is maintained for 5 minutes once, and the acquired data is input into the designed graph structure. And then, calling the built and trained model, and outputting the predicted flow value by the model. This process will help the manager to better understand the dynamic changes in traffic and provide real-time decision support for business district management and operation.
The invention provides a self-adaptive business turn flow chart model construction method based on a six-degree separation theory, which completes space modeling of flow among different businesses in a business turn by balancing global efficiency and redundancy of a network, captures long-distance space correlation and removes modeling smoothness caused by business turn similarity. The attention mechanism in the transducer is improved, and a new temporal feature dimension extractor is designed to resist the effects of time delays that may occur in the propagation of spatial information between locations. A multi-head diagram attention mechanism is adopted, a new space feature dimension extractor is designed, different marketing modes are dynamically captured, the influence of different business activities on the flow is achieved, and the dynamic coupling of the space relation among the nodes is achieved.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is simpler, with reference to the description of method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, substitution, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
1. A business turn flow prediction method based on a six-degree separation theory and a graph annotation network is characterized by comprising the following steps:
s1, acquiring business turn flow data;
s2, constructing a self-adaptive business turn flow diagram structure based on a six-degree separation theory;
s3, extracting time features based on a linear gating convolution attention unit;
s4, extracting spatial features based on the attention of the multi-head graph;
s5, outputting a prediction result through the full connection layer, and completing establishment of a business turn flow prediction model;
s6, training a business turn flow prediction model;
s7, calling a trained business district flow prediction model to conduct flow prediction.
2. The business turn flow prediction method based on the six-degree separation theory and the graph annotation network according to claim 1, wherein the business turn flow data acquired in the step S1 comprises a business turn range, a business place, an acquisition frequency and an acquisition time period.
3. The business turn flow prediction method based on the six-degree separation theory and the graph annotation network according to claim 1, wherein the self-adaptive business turn flow graph structure construction process based on the six-degree separation theory in S2 is as follows:
s21, calculating correlation coefficients of node variables of any two shops to obtain an affinity matrix S; normalizing the affinity matrix S, then any element in the matrixTake a value between 0 and 1; the upper triangular matrix elements in the affinity matrix S are arranged in a descending order; when (when)At this time, the corresponding position of the adjacency matrix A is +.>Setting 1 and the rest as 0 to obtain an adjacent matrix A; />Is a threshold value;
s22, respectively calculating the corresponding network average consistency of the adjacent matrix AAnd the network average cluster coefficientCCFinally forming two curves; intersection of two curves->Is a balance point of efficiency and network redundancy; />Is->AndCCthe value of the network radius at the intersection point of the curves;
s23, to balance pointThe value is used as the optimal threshold value, and the distance is more than or equal to +.>Is connected to form a business turn flow node graph structure.
4. The business turn flow prediction method based on six-degree separation theory and graph annotation network according to claim 1, wherein the step S3 is based on linear gating convolution attention unit extraction time characteristics specifically comprises: firstly, replacing a self-attention mechanism in a transducer model with local context-sensitive convolution attention to form a gating attention unit, and fitting time dimension characteristics of time sequence data; input is a time length ofDividing the input time sequence data into blocks, using accurate convolution attention in the blocks and using quick linear attention across the blocks to obtain a gating attention unit with linear complexity; and then, the input data is subjected to time convolution by a gating attention unit with linear complexity, and a feature vector of correlation among all time stamps is output.
5. The business turn flow prediction method based on six-degree separation theory and graph annotation network according to claim 1, wherein the S4 spatial feature extraction based on multi-head graph attention is specifically:
and (3) inputting the time feature vector obtained in the step (S3) into a space convolution layer, and calculating to obtain a feature vector with space characteristics, wherein the specific calculation process is as follows:
wherein (1)>Is a matrix splicing operation; for the same node, multi-head self-attentions are calculated respectively +.>Sub-attentiveness and combined in a spliced or averaged mannerSecondary attention; />Is->Layer node->Feature vector of>Is->Layer node->After the aggregation operation with the attention mechanism as the core, the feature vector of (1) is output as node +.>Is->Understood as different nodes +.>Expression of the features, th->Personal node->The +.sup.th after the attentional mechanisms>A personal node feature representation;
head of attention, head of attention>Representing the attention factor, +.>Representing node->Degree of (1)/(2)>,/>Is a parameter that can be learned, < >>Is->Vector representation of node, ">Indicating index +.>Middle->Node pair->Attention weight of the node; />Is an activation function->Is->Vector representation of the nodes;
attention coefficientThe calculation method of (2) is as follows:
wherein->For a learnable parameter->First->Attention coefficient of individual head,/->Is an exponential function, ++>Is node->Is described.
6. The business turn flow prediction method based on six-degree separation theory and graph annotation network according to claim 1, wherein the S5 specifically is: fusion of time feature extraction and space feature vector through full connection layer and output of length asPredicted outcome of->The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Representing node index,/->Indicate time of day->Is indicated at->Time node->Is a predicted value of (a).
7. The business turn flow prediction method based on six-degree separation theory and graph annotation network according to claim 1, wherein the process of the S6 training model is specifically:
s61, training a model through a mean square error loss function, wherein the loss function is as follows:
wherein->Is the total number of samples in the time series used to calculate the loss, < >>Is a true value, < >>Is a predicted value;
s62, solving the gradient of the network error for each weight parameter in the back propagation by utilizing an Adam optimization algorithm, and obtaining a new weight through a parameter updating process; the model weights are iteratively calculated until a predetermined small penalty is reached and the best predicted value is obtained.
8. The business turn flow prediction method based on the six-degree separation theory and the graph annotation network according to claim 1, wherein the step S7 of calling the trained business turn flow prediction model to perform flow prediction specifically comprises:
s71, starting real-time data acquisition, maintaining the sampling frequency for 5 minutes once, and inputting acquired data into the graph structure obtained in the S2;
s72, calling the model built in S6, and outputting the predicted flow value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410103109.1A CN117635218B (en) | 2024-01-25 | 2024-01-25 | Business district flow prediction method based on six-degree separation theory and graph annotation network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410103109.1A CN117635218B (en) | 2024-01-25 | 2024-01-25 | Business district flow prediction method based on six-degree separation theory and graph annotation network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117635218A true CN117635218A (en) | 2024-03-01 |
CN117635218B CN117635218B (en) | 2024-04-09 |
Family
ID=90038048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410103109.1A Active CN117635218B (en) | 2024-01-25 | 2024-01-25 | Business district flow prediction method based on six-degree separation theory and graph annotation network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117635218B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115730519A (en) * | 2022-11-17 | 2023-03-03 | 北京航空航天大学 | Urban crowd flow prediction system and method based on space-time potential energy field |
CN116166975A (en) * | 2023-02-27 | 2023-05-26 | 中关村智慧城市产业技术创新战略联盟 | Multi-graph hierarchical road surface characterization method based on graph neural network |
CN117151285A (en) * | 2023-08-29 | 2023-12-01 | 淮阴工学院 | Runoff forecasting method based on multi-element attention space-time diagram convolutional network |
-
2024
- 2024-01-25 CN CN202410103109.1A patent/CN117635218B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115730519A (en) * | 2022-11-17 | 2023-03-03 | 北京航空航天大学 | Urban crowd flow prediction system and method based on space-time potential energy field |
CN116166975A (en) * | 2023-02-27 | 2023-05-26 | 中关村智慧城市产业技术创新战略联盟 | Multi-graph hierarchical road surface characterization method based on graph neural network |
CN117151285A (en) * | 2023-08-29 | 2023-12-01 | 淮阴工学院 | Runoff forecasting method based on multi-element attention space-time diagram convolutional network |
Also Published As
Publication number | Publication date |
---|---|
CN117635218B (en) | 2024-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Li et al. | Predicting Short‐Term Electricity Demand by Combining the Advantages of ARMA and XGBoost in Fog Computing Environment | |
CN109063939B (en) | Wind speed prediction method and system based on neighborhood gate short-term memory network | |
CN110138595A (en) | Time link prediction technique, device, equipment and the medium of dynamic weighting network | |
CN113792754B (en) | Converter transformer DGA online monitoring data processing method for firstly removing abnormal state and then repairing | |
JP2013074695A (en) | Device, method and program for predicting photovoltaic generation | |
CN117078048B (en) | Digital twinning-based intelligent city resource management method and system | |
CN117668743B (en) | Time sequence data prediction method of association time-space relation | |
CN114777192B (en) | Secondary network heat supply autonomous optimization regulation and control method based on data association and deep learning | |
Li et al. | Federated anomaly detection on system logs for the internet of things: A customizable and communication-efficient approach | |
CN114495507A (en) | Traffic flow prediction method integrating space-time attention neural network and traffic model | |
CN111882157A (en) | Demand prediction method and system based on deep space-time neural network and computer readable storage medium | |
CN116340646A (en) | Recommendation method for optimizing multi-element user representation based on hypergraph motif | |
CN115828990A (en) | Time-space diagram node attribute prediction method for fused adaptive graph diffusion convolution network | |
CN115660147A (en) | Information propagation prediction method and system based on influence modeling between propagation paths and in propagation paths | |
CN110807508B (en) | Bus peak load prediction method considering complex weather influence | |
CN116894180B (en) | Product manufacturing quality prediction method based on different composition attention network | |
CN117688362A (en) | Photovoltaic power interval prediction method and device based on multivariate data feature enhancement | |
CN117767262A (en) | Photovoltaic power generation capacity prediction method for optimizing CNN-LSTM (carbon nano-tube-laser-based) based on improved firefly algorithm | |
CN117556133A (en) | Neural time gate time sequence enhanced session recommendation method based on graph neural network | |
CN117635218B (en) | Business district flow prediction method based on six-degree separation theory and graph annotation network | |
CN115374191B (en) | Multi-source data-driven cluster method for heterogeneous equipment of data center | |
CN116523001A (en) | Method, device and computer equipment for constructing weak line identification model of power grid | |
Shterev et al. | Time series prediction with neural networks: a review | |
CN115664970A (en) | Network abnormal point detection method based on hyperbolic space | |
CN112865898A (en) | Antagonistic wireless communication channel model estimation and prediction method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |