A method and system for predicting consumer behavior driven by spatiotemporal data
By constructing heterogeneous ternary graphs and spatial and temporal fusion feature prediction methods, the accuracy problem of consumption behavior prediction in geographical areas and emergencies is solved, and high-precision and real-time prediction of user consumption behavior are achieved.
Patent Information
- Application Number
- CN202510703143.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-29
AI Technical Summary
The existing consumption behavior prediction methods are not accurate when reflecting user geographical regional differences and responding to emergencies, and lack real-time and scalability, making it difficult to adapt to dynamic consumption scenarios.
A heterogeneous ternary graph is constructed, and through user-business district consumption edges, business district-event impact edges and event-user-triggered edges, combined with multi-scale Motif subgraph sampling and time-domain convolution network, the user's multi-scale spatial characteristics and event timing impact trend factors are extracted to predict the spatial and temporal fusion feature.
It realizes accurate consumption behavior prediction of users in different business districts, improves prediction accuracy and robustness, can dynamically capture geographical heterogeneity and emergencies, and adapt to the changing consumption environment.
Smart Images

Figure CN120235646B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital and intelligent analysis technology for cultural tourism, and in particular to a method and system for predicting consumer behavior driven by spatiotemporal data. Background Art
[0002] With the rapid development of mobile Internet, Internet of Things and big data technologies, the retail industry has generated a large amount of heterogeneous consumer behavior data, including store transaction flows, online order records, and trajectory data based on mobile phone positioning. These data are highly non-stationary and heterogeneous in time and space dimensions.
[0003] Traditional consumer behavior prediction methods primarily rely on time series models (such as ARIMA and LSTM) to model historical user spending amounts or frequency. These methods only consider "when" a purchase occurs, ignoring the impact of "where" on user decisions. This makes it difficult to reflect the differences between different geographic regions or business districts. Furthermore, they are slow to respond to short-term events like holidays and promotions, resulting in low prediction accuracy.
[0004] In addition, some researchers have proposed constructing static consumption preference models through feature engineering based on static user profiles or demographic characteristics. While these methods can capture a user's overall consumption tendencies, they lack the integration of real-time location and environmental factors, making them difficult to adapt to dynamically changing consumption scenarios. Furthermore, manually designing features is labor-intensive and has poor scalability. Summary of the Invention
[0005] The present application provides a spatiotemporal data-driven consumer behavior prediction method, system, storage medium, computer program product, and electronic device to at least solve the problem of low prediction accuracy of user consumption behavior in business districts in current related technologies.
[0006] In the first aspect, an embodiment of the present application provides a consumption behavior prediction method driven by spatiotemporal data, including: defining user nodes, business district nodes and event nodes respectively according to user attribute data, business district attribute data and historical external events, and analyzing the user's historical consumption data and business district POI data to determine the corresponding user-business district consumption edge, business district-event influence edge and event-user trigger edge, thereby constructing a heterogeneous ternary graph; the edge weight of the user-business district consumption edge is defined according to the historical consumption intensity of the user in the corresponding business district, the edge weight of the business district-event influence edge is defined according to the time-attenuation influence coefficient of the corresponding external event in the business district, and the edge weight of the event-user trigger edge is defined according to the historical responsiveness weight of the user to the corresponding external event; multi-scale Motif subgraph sampling is performed on the heterogeneous ternary graph to provide A multi-granularity subgraph matching the user node is obtained, and the spatial coding features of the user node in each granularity subgraph in the multi-granularity subgraph are calculated, and the multi-scale spatial features of the corresponding user node are obtained by feature weighted fusion; based on the time domain convolutional network, the event timing impact trend factors corresponding to each event node in the heterogeneous ternary graph are extracted; at least one potential external event corresponding to a preset future time period is obtained, and the target event timing impact trend factor of the corresponding user node is determined by matching with each event node in the heterogeneous ternary graph, and each target event timing impact trend factor is fused with the multi-scale spatial features to obtain the spatiotemporal fusion features of the corresponding user node; based on the spatiotemporal fusion features of the user node, the business district consumption amount and business district consumption frequency of the corresponding user in the preset future time period are predicted.
[0007] In the second aspect, an embodiment of the present application provides a consumption behavior prediction system driven by spatiotemporal data, including: a heterogeneous ternary graph construction unit, which is used to define user nodes, business district nodes and event nodes according to user attribute data, business district attribute data and historical external events, and analyze the user's historical consumption data and business district POI data to determine the corresponding user-business district consumption edge, business district-event influence edge and event-user trigger edge, so as to construct a heterogeneous ternary graph; the edge weight of the user-business district consumption edge is defined according to the historical consumption intensity of the user in the corresponding business district, the edge weight of the business district-event influence edge is defined according to the time-attenuation influence coefficient of the corresponding external event in the business district, and the edge weight of the event-user trigger edge is defined according to the historical responsiveness weight of the user to the corresponding external event; a spatial feature extraction unit is used to perform multi-scale Motif subgraph sampling on the heterogeneous ternary graph to extract the user-business district consumption edge, the business district-event influence edge and the event-user trigger edge. A multi-granularity subgraph is prepared to match the user node in the multi-granularity subgraph, and the spatial coding features of the user node in each granularity subgraph in the multi-granularity subgraph are calculated, and the multi-scale spatial features of the corresponding user node are obtained by feature weighted fusion; a temporal feature extraction unit is used to extract the event temporal impact trend factor corresponding to each event node in the heterogeneous ternary graph based on a time domain convolutional network; a spatiotemporal feature fusion unit is used to obtain at least one potential external event corresponding to a preset future time period, and determine the target event temporal impact trend factor of the corresponding user node by matching with each event node in the heterogeneous ternary graph, and fuse each target event temporal impact trend factor with the multi-scale spatial features to obtain the spatiotemporal fusion feature of the corresponding user node; a business district consumption prediction unit is used to predict the business district consumption amount and business district consumption frequency of the corresponding user in each business district in the preset future time period according to the spatiotemporal fusion features of the user node.
[0008] In a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the spatiotemporal data-driven consumer behavior prediction method of any embodiment of the present application.
[0009] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the spatiotemporal data-driven consumer behavior prediction method of any embodiment of the present application are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the spatiotemporal data-driven consumer behavior prediction method of any embodiment of the present application.
[0011] The spatiotemporal data-driven consumer behavior prediction method and system provided in this application can produce at least the following technical effects:
[0012] (1) By constructing a heterogeneous ternary graph of user-business district-event, we achieve deep fusion of multi-source information. We also use multi-scale Motif subgraph sampling and temporal convolutional networks to extract spatial structural patterns and event temporal impact trends, respectively, and then organically integrate the two into a highly expressive spatiotemporal fusion feature. Based on this spatiotemporal fusion feature, we predict users' shopping behavior in different business districts. This can simultaneously reflect users' personalized preferences at the macro-business district and micro-POI levels, and proactively capture the impact of events such as holidays, promotions, and extreme weather, significantly reducing prediction errors and greatly improving the accuracy and robustness of predicting users' shopping district consumption behavior.
[0013] (2) By introducing an edge weight modeling method that can reflect the actual interaction intensity between users and business districts in heterogeneous graphs, and integrating the dynamic impact relationship between events on business districts and users, the model can fully capture the complex evolution trend of user behavior in time and space dimensions. Through the multi-scale subgraph sampling mechanism, it can effectively extract the consumption behavior characteristics of users at different geographical scales, enhancing the model's ability to model geographical heterogeneity; combined with the extraction and modeling of event temporal impact trends by the time domain convolutional network, the model has a stronger response capability when facing sudden or periodic external events such as holidays and promotions. By deeply integrating the user's spatial behavior characteristics with the event impact trend factor, a spatiotemporal fusion feature that can dynamically reflect the user's status is generated, thereby achieving accurate prediction of the user's consumption behavior in different business districts within a specific time period in the future.
[0014] This technical solution eliminates the need to rely on a large number of manually constructed static features. It is highly automated and scalable, adaptable to changing consumption environments and complex data structures, and achieves powerful spatiotemporal collaborative modeling capabilities. It provides the tourism consumption industry with more accurate and efficient user consumption behavior predictions, helping to optimize cultural tourism marketing strategies and resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1 A flowchart showing an example of a method for predicting consumption behavior driven by spatiotemporal data according to an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram showing a structural connection of an example of a heterogeneous ternary graph according to an embodiment of the present application is shown;
[0018] Figure 3 An operational flowchart of an example of performing multi-scale Motif subgraph sampling on a heterogeneous ternary graph according to an embodiment of the present application is shown;
[0019] Figure 4 Schematic diagram showing the effects of various spatial Motif templates according to an embodiment of the present application;
[0020] Figure 5 A schematic diagram illustrating an operation example of extracting multi-scale spatial features from multi-granularity subgraphs according to an embodiment of the present application is shown;
[0021] Figure 6 An operational flowchart of an example of extracting event timing impact trend factors based on a time domain convolutional network according to an embodiment of the present application is shown;
[0022] Figure 7 An operational flow chart of an example of a feature fusion operation for spatiotemporal fusion features according to an embodiment of the present application is shown;
[0023] Figure 8 A structural block diagram of an example of a spatiotemporal data-driven consumer behavior prediction system according to an embodiment of the present application is shown;
[0024] Figure 9 This is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0025] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] It should be noted that some scholars have attempted to incorporate spatial information into the prediction process, using geographic proximity or fixed grids to divide cities and modeling consumption for users within each area. However, these methods often perform unified aggregation at a single spatial scale and treat spatial dimensions solely as discrete labels, ignoring geographic continuity. For example, the gravitational effect of consumption flows between business districts is simplified to Euclidean distance weighting, failing to account for the multi-layered spatial structure between "brand clusters," "local hotspots," and "macro-business districts," resulting in inaccurate predictions of cross-regional consumption tides. Furthermore, when business district heat changes dynamically with factors such as holidays, weather, and events, the model struggles to promptly reflect fluctuations in spatial attractiveness.
[0027] Furthermore, artificially constructed spatiotemporal cross-features (such as the "weekday + core business district" combination) lead to dimensionality explosion. However, when there are more than 50 POI (Point of Interest) types, the XGBoost (eXtreme GradientBoosting) model's feature importance ranking becomes chaotic. Furthermore, while LSTM (Long Short-Term Memory) networks can capture temporal dependencies, they lack the ability to perceive spatial topological changes.
[0028] Current models are often trained on data from a single city or fixed business district, lacking cross-domain generalization capabilities. Application to new cities or business districts often requires re-collecting large amounts of labeled data and retraining the model, which is costly and slow to deploy. They also have poor adaptability to emerging events and low-sample scenarios, making it difficult to meet the demands of real-time online updates and rapid response.
[0029] It should be understood that the purpose of the above description of the current related art is only to facilitate the public to better understand the inventive spirit and motivation of this application, and is not to be construed as limiting this application. In addition, the technical solutions described in the above-mentioned current related art are not prior art and may also be undisclosed technical solutions, such as solutions under research or in the laboratory stage.
[0030] In the technical solutions of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0031] Figure 1 A flowchart of an example of a spatiotemporal data-driven consumption behavior prediction method according to an embodiment of the present application is shown.
[0032] Regarding the execution entity of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. Specifically, it can be implemented by a consumer behavior prediction management platform, which integrates multi-scale spatial features with event temporal impact trend factors to construct spatiotemporal fusion features that can dynamically reflect the user's spatiotemporal behavior state, thereby achieving a joint prediction of the user's consumption amount and consumption frequency in various business districts within a specific time period in the future, significantly improving the precision and personalization of the prediction results.
[0033] In some examples, it can be integrated into an electronic device or terminal through software, hardware, or a combination of software and hardware, and the type of terminal or electronic device can be diverse, such as a mobile phone, tablet computer, or desktop computer, etc.
[0034] like Figure 1 As shown, in step S110, user nodes, business district nodes and event nodes are defined respectively according to user attribute data, business district attribute data and historical external events, and analyzed in combination with user historical consumption data and business district POI data to determine the corresponding user-business district consumption edges, business district-event influence edges and event-user trigger edges, thereby constructing a heterogeneous ternary graph.
[0035] In some implementations, the platform first extracts three types of core information from the data source: user attribute data, business district attribute data, and historical external event data, and constructs three types of nodes based on these data, namely user nodes, business district nodes, and event nodes. Specifically, each user node represents a user, and the node attributes record various types of user attribute information of the user (for example, age, gender, occupation, place of residence, preference categories, etc.). Each business district is mapped to a business district node, and the node attributes record various business district attribute labels, such as the business district's geographical location, business district traffic popularity, business district level, etc. Each event node can represent an external event that may affect consumer behavior, such as major holidays, changes in weather conditions, city events (such as concerts, exhibitions), traffic changes, etc.
[0036] Next, the platform analyzes historical consumer behavior and external event data to construct three types of edges connecting the aforementioned nodes. For example, user transaction records in various business districts, including transaction amounts, transaction times, and transaction counts, are extracted from user consumption logs. Map services or GIS platforms are used to obtain business district boundary outlines, the density of merchant POIs, and historical customer flow heat value sequences. Event types, occurrence times, and coverage of business districts are extracted from external event databases (such as holidays, merchant promotions, regional coupon issuance, and extreme weather warnings). In some cases, user attribute data can be extracted from platform logs, and this user attribute data can be fuzzified, for example, to represent a consumer group rather than a specific user.
[0037] Furthermore, the edge weight of the user-business district consumption edge is defined based on the user's historical consumption intensity in the corresponding business district. For example, an edge connection is established based on a user's historical consumption records in a specific business district, and its edge weight is designed to reflect the user's consumption intensity in that business district. For example, it can be calculated by combining dimensions such as consumption amount, frequency, and duration. Furthermore, the edge weight of the business district-event impact edge is defined based on the time-decay impact coefficient of the corresponding external event in the business district. This edge reflects the degree of impact of an external event on a particular business district. For example, by statistically analyzing indicators such as consumption popularity and traffic fluctuations within the business district after the event, and combining the time distance of the event, a time-decay mechanism is used to assign an edge weight, which decreases over time. The edge weight of the event-user trigger edge is defined based on the user's historical responsiveness to the corresponding external event. This edge can be established based on the user's historical response records to the event (e.g., whether consumption was due to holiday promotions or whether consumption was reduced due to weather changes). The corresponding edge weight is defined by mining the responsiveness trends of users' historical consumption behavior to events.
[0038] In some examples of the embodiments of the present application, user consumption data includes historical consumption flow records of at least one user in various business districts, supporting the platform to accurately count the consumption frequency and amount distribution of users in different business districts; business district POI data includes business district scope information (such as the polygonal boundary of the business district), POI distribution density (such as the number and type distribution of POIs per unit area, such as the density of restaurants, retail stores, and entertainment venues, reflecting the service supply level of the business district) and historical passenger flow heat value series (such as forming a daily or even hourly passenger flow time series curve to reveal the changing trend of the business district's activity), which can spatially quantify the attractiveness of the business district in a refined manner. After combining the two, the user-business district consumption edge in the heterogeneous ternary graph can reflect the comprehensive spatial characteristics of the coupling of "user preference + business district vitality" based on the actual consumption intensity and POI layout, greatly improving the accurate description of the user's potential consumption capacity and willingness.
[0039] Furthermore, historical external events include at least one of the following types: holidays, regional public consumption voucher events, merchant promotions, and extreme weather events. This four-fold external event classification encompasses both regular holiday effects and sudden and periodic drivers. By explicitly modeling external events as nodes and introducing a graph structure, the model effectively enhances its ability to detect consumption changes driven by factors other than user subjective factors. Furthermore, the differences in the impact mechanisms of different event types (e.g., holiday promotions are positive stimuli, while severe weather is an inhibitory factor) can be dynamically reflected through learning event-user trigger edge weights (e.g., positive or negative weights), enhancing the granularity of event modeling.
[0040] Figure 2A structural connection diagram of an example of a heterogeneous ternary graph according to an embodiment of the present application is shown.
[0041] like Figure 2 As shown, the heterogeneous ternary graph contains three types of graphical elements. Circles represent user nodes (i.e., 211, 212, and 213), each of which carries user attributes (such as demographics, province and city location, and historical consumption preferences). Squares represent business district nodes (i.e., 221, 222, and 223), each of which carries attribute information such as POI distribution density, historical customer flow heat value series, and geographic range. Triangles represent event nodes (i.e., 231, 232, and 233). Event types can include holidays, public consumption coupons, merchant promotions, and extreme weather, and are accompanied by effective start and end times and preset event impact intensity. The heterogeneous ternary graph also displays various directed edges. User-business district consumption edges (e.g., 211→221, 212→222) represent users' historical consumption behavior in a business district, capturing their preferences and consumption intensity. Business district-event impact edges (e.g., 231→221, 231→222) represent the timeliness of an external event's impact on a business district and are used to quantify the attenuation of consumer activity caused by an event across different business districts. Event-user trigger edges (e.g., 231→211, 232→213) represent the user's historical responsiveness to the external event and are used to measure the user's actual participation or consumption in the relevant business district after the event is triggered.
[0042] Through the embodiments of the present application, a heterogeneous ternary graph is constructed, and the originally isolated users, business districts and external events are modeled in a unified graph structure. This not only expresses the direct consumption relationship between users and business districts, but also reflects the indirect impact of events on consumption behavior. It constructs a multi-source heterogeneous, three-party interactive real-world scenario map, and accurately captures the complex correlation relationship between users, business districts and events.
[0043] In step S120, multi-scale Motif subgraph sampling is performed on the heterogeneous ternary graph to extract a multi-granularity subgraph that matches the user node, and the spatial coding features of the user node in each granularity subgraph in the multi-granularity subgraph are calculated, and the multi-scale spatial features of the corresponding user node are obtained by feature weighted fusion.
[0044] Here, we use motif sampling to extract structural information associated with target user nodes in heterogeneous ternary graphs. For example, we first predefine several typical graph structure motifs, such as four-node closed loops, user-trade zone-event ternary paths, and user-trade zone-user star structures, to uncover user behavior and consumption preferences implicit in the local graph structure.
[0045] Furthermore, a multi-scale sampling approach is employed. Motif types of varying scales (small, medium, and large) are traversed and extracted, forming multi-granularity subgraphs. Each granularity corresponds to a different range of spatial feature capture capabilities. For example, a subgraph sampling strategy based on depth-first search (DFS) or random walks is employed to extract multi-granularity subgraphs containing a given user node within varying hop counts (e.g., 1, 2, or 3 hops). Each motif type is sampled proportionally to ensure structural diversity while controlling the sampling scale.
[0046] Furthermore, for each subgraph at each granularity, a graph encoding method (such as structural embedding or aggregation based on node adjacency) is used to calculate the spatial feature encoding of the user node, which represents the spatial behavior characteristics of the user in the subgraph at that granularity. Finally, the feature encodings at different granularities are weighted and fused, with the fusion weights set based on granularity importance or historical model evaluation results, to generate the final multi-scale spatial features.
[0047] Therefore, through the diversified graph structure Motif, more semantically meaningful substructures are extracted from the graph structure, user collaboration and cross-circle patterns of different granularities are extracted, and three types of node high-order interaction patterns are learned. This can effectively model user behavior habits in different spatial ranges and consumption scenarios, and capture the locality and cross-regionality of user consumption.
[0048] In step S130, based on the time domain convolutional network, the event timing impact trend factor corresponding to each event node in the heterogeneous ternary graph is extracted.
[0049] Here, the temporal dynamic features carried by event nodes are mined to capture the impact trends that external events may have on consumer behavior. Specifically, for each event node, a historical time series is constructed, which contains the actual impact indicators of the event on the relevant business district or user behavior at different time points, such as consumption growth rate, transaction frequency fluctuations, etc. The time series is modeled by a time-domain convolutional network. The time-domain convolutional network has better temporal dependency modeling capabilities. It can effectively mine the evolution law of event impact on the time axis and ultimately output a time trend factor to represent the impact pattern of the event on the consumer behavior of business district users. Therefore, by introducing the time-domain convolution mechanism, the dynamic change trend of the impact of events on the consumer behavior of business district users is effectively portrayed, which can effectively take into account local sensitivity and long-term dependence, and highlight the short-term impact effect of sudden events.
[0050] In step S140, at least one potential external event corresponding to a preset time period in the future is obtained, and the target event timing impact trend factor of the corresponding user node is determined by matching it with each event node in the heterogeneous ternary graph, and each target event timing impact trend factor and multi-scale spatial features are fused to obtain the spatiotemporal fusion feature of the corresponding user node.
[0051] Here, the feature information of both time and space dimensions is effectively combined to generate spatiotemporal fusion features for predicting consumer behavior in a business district. It should be understood that the length of the preset time period in the future can be diverse and can be adjusted according to platform needs, such as next month or next week.
[0052] In some implementations, it is first necessary to identify external events that may occur within the predicted future timeframe. This information can be obtained from various sources, such as public calendars (holidays), merchant schedules (promotions / discounts), weather forecasts (rain, snow, extreme temperatures), and official government announcements (public consumption vouchers). Next, semantic matching is performed with event nodes defined by each historical event in the heterogeneous ternary graph to ensure consistency in the event type field. Based on the matching results, the temporal impact trend factor of the target event associated with each user node is extracted.
[0053] Furthermore, the temporal impact trend factors of each target event are fused with the multi-scale spatial features corresponding to the user node. Fusion methods can be diverse, such as attention mechanisms, feature concatenation followed by a multi-layer perceptron, or graph attention networks. The resulting spatiotemporal fusion features not only encompass the user's static preferences and spatial behavior patterns, but also embed predictive information about the potential impact of external environmental changes on consumer behavior in the shopping district.
[0054] In step S150, based on the spatiotemporal fusion characteristics of the user node, the corresponding user's shopping amount and shopping frequency in each shopping district in a preset time period in the future are predicted.
[0055] In some implementations, various non-restrictive multi-task deep learning models can be employed to predict consumer behavior. Their input is spatiotemporal fusion features, and their output is consumer behavior within each potential business district, encompassing both the amount and frequency of consumption. On one hand, a regression model (such as a multilayer perceptron or graph neural regression network) can be used to output the amount of consumption, while a classification or regression model can be used to output the number of transactions by the user within the time period. Alternatively, a dual-branch network can be designed, with a shared layer responsible for further mining the common information within the spatiotemporal fusion vectors; while two task-specific branches perform adaptive fitting of the amount of consumption and frequency of consumption, respectively.
[0056] Through the embodiments of the present application, by jointly modeling the consumption amount and consumption frequency of users in different business districts, the platform can not only determine whether the user will go to a certain business district to consume, but also estimate their consumption intensity, meeting the needs of detailed assessment of user consumption potential.
[0057] The following will expand on the calculation process of edge weights of various types of edge connections in a heterogeneous ternary graph. It should be understood that the edge weight calculation method described below is only used as an example and should not be regarded as limiting the scope of implementation of this application.
[0058] In some examples of the embodiments of the present application, the calculation of the edge weight of the user-business district consumption edge includes:
[0059] , formula (1)
[0060] Where, For user nodes and business district nodes The edge weight corresponding to the user-business district consumption edge between , which is used to express the user's historical consumption intensity in the business district; Represents the frequency weight coefficient, the value range is ; Represents a user node In the business district node The total number of historical transactions within; Represents any business district node, Represents a user node The sum of the number of transactions in all business district nodes; Represents a user node In the business district node The total amount of historical consumption, Represents a user node The total amount of consumption in all business districts. Frequency weight coefficient It can be pre-set and can be set according to the business side's emphasis on both "consumption times" and "consumption amount". For example, if it is set to 0.7, it means that the business side focuses more on "consumption times", while if it is set to 0.3, it means that the business side focuses more on "consumption amount".
[0061] Here, the user-business district consumption edge weight combines two core indicators: "number of transactions" and "consumption amount" to comprehensively characterize the strength of users' preferences for different business districts. Referring to the logic of formula (1), "transaction frequency" (number of user orders) and "economic input" (actual expenditure amount) are unified and normalized and then weighted together to reflect both the frequency of user interaction with the business district and their economic value contribution. This avoids the bias caused by a single indicator (such as only looking at the amount or frequency) and more accurately characterizes the user's overall interest and stickiness in each business district.
[0062] The calculation of the edge weight for the business district-event impact edge includes:
[0063] , Formula (2)
[0064] Where, For business district nodes With event nodes The edge weight corresponding to the business circle-event impact edge between them is used to express the time-attenuation influence coefficient to quantify the event node During its entire effective period, Average aging impact strength; Represents an event node The inherent influence intensity of ; is the time-dependent decay rate weight, Represents an event node The starting moment; Represents a business district node In the event Effective time range The collection of all historical transaction moments in which transactions occurred within Representing a collection The total number of trading moments in Representing a collection Any historical trading moment; and Represents event nodes respectively The effective start time and effective end time of the aging decay rate weight It can be pre-set, and different values can be set for different event types, such as 0.2 for holidays (after 5 days or so, the residual heat will subside and the event influence will be reduced). Has decayed to 37% of the initial value), the promotion is about 0.3 (rapidly decayed about 3 days after the promotion, the event influence It has decayed to 41% of the initial level), and the extreme weather is around 0.5 (the effect is significantly weakened after about 2 days, and the influence of the event has decayed to 37% of its original value).
[0065] Here, in calculating the edge weights for the business district-event impact edge, we further incorporate the existing exponential decay model by averaging all actual transactions during the entire event cycle. This smooths fluctuations in individual transactions and allows the event itself to exert positive incentives or negative inhibitory effects. By applying time decay to each transaction during the event's effective period and taking the average, we can more accurately reflect the event's comprehensive impact on the business district throughout its entire cycle.
[0066] It should be noted that the inherent intensity of the event There is a distinction between positive and negative factors. For example, merchant promotions and consumer coupons are considered incentives and assigned positive values, while extreme weather and crisis alerts are considered inhibitors and assigned negative values. This allows for the simultaneous modeling of positive incentives (promotions) and negative inhibitors (extreme weather) within the same framework, enabling the graph structure to fully reflect the heterogeneous, quantitative impact of multi-source events on consumption in a business district.
[0067] The calculation of edge weights for event-user triggered edges includes:
[0068] , Formula (3)
[0069] Where, For event nodes With user node The edge weight corresponding to the event-user trigger edge between them is used to quantify the user node For event nodes The historical responsiveness weight of Indicates that at the event node During the impact period, user nodes The actual number of purchases in the shopping district related to the event, used to reflect the user's participation in the event; represents any user node, Indicates the event nodes obtained by statistics of all user nodes The maximum number of responses.
[0070] In formula (3), since users' responses to the same event vary significantly, the corresponding edge weight is the ratio of the user's actual consumption times during the event period to the maximum number of responses of all users under the event to measure individual sensitivity. Therefore, if an event can significantly trigger a user's effective consumption in the relevant business district, then the user's responsiveness to the event is high, and vice versa.
[0071] Figure 3 An operational flowchart of an example of multi-scale Motif subgraph sampling for a heterogeneous ternary graph according to an embodiment of the present application is shown. Figure 4 A schematic diagram showing the effects of various spatial Motif templates according to an embodiment of the present application is shown.
[0072] like Figure 3 As shown, in step S310, a spatial Motif template group is obtained, and the spatial Motif template group includes a triangular closed loop template, a dual business circle path template, and an event circle template.
[0073] Specifically, the triangular closed loop template defines a three-node closed loop structure formed by the target user node and another user node at the same business district node. Its template format is target user-business district-another user, which is used to capture the consumption synergy effect of group users in the same business district. Figure 4 As shown, the triangular closed-loop template adopts 411 →421 ←413. When multiple users consume in the same business district, it usually reflects that the business district has a common appeal to this group (such as the same brand or the same promotional activity), so that the sampled user pairs often have similar consumption preferences or social relationships, revealing the internal collaboration of user groups with common consumption preferences at the micro level.
[0074] The dual-business district path template defines a two-hop path structure formed by connecting the target user node and another user node through two different business district nodes in sequence. The template format is target user-first business district-second business district-another user, which is used to explore the consumption migration pattern and interest extension of users across business districts. Figure 4 As shown, the dual-business district path template uses 412 →422- 424 ←414. If the consumption path of user 412 in business district 422 is similar to that of user 414 in business district 424, it indicates that the two may share cross-business district interests (for example, a preference for the same type of stores). This can predict the user's potential consumption intention in the new business district, provide a basis for cross-regional business district promotion or user scenario diversion, and reveal the cross-circle linkage and path dependence of users in different business districts at the meso-level.
[0075] The event circle template defines a four-node event-driven closed-loop structure consisting of a target user node and another user node interacting through a business circle node and an event node. The template format is target user-business circle-event-another user. It is used to extract the resonant consumption response of different users to the same external event, and can reflect the collective impact of external events on different user-business circle paths within the same time window at the macro level. Figure 4As shown, the path of the event circle template is user node 415 → business district node 422 ← event node 431 → user node 417. This means that target user node 415 connects to business district node 422 via the user-business district consumption edge. Business district node 422 is connected to event node 431 via the business district-event impact edge. Event node 431 then connects to another user node 417 via the event-user trigger edge, forming a complete four-node closed loop structure. The event circle template allows us to extract the resonant consumption responses of different users (such as 415 and 417) in the same business district 422 during the effective period of the same external event 431, thereby characterizing the collective impact of the event on multiple user-business district paths at a macro level.
[0076] Through predefined templates, the model directly targets the spatial relationships that are most significant drivers of consumer behavior, eliminating redundant scanning of irrelevant subgraphs. Different templates cover three practical scenarios, from "local popularity" to "cross-regional migration" to "external intervention," ensuring that the extracted spatial features are both comprehensive and discriminative.
[0077] In step S320, for each user node in the heterogeneous ternary graph, a set of neighboring business districts of the user node and corresponding consumption edge weight information are constructed and cached.
[0078] In some implementations, the platform may perform periodic (eg, daily or weekly) scanning and analysis, such as offline aggregation and batch updating.
[0079] In step S330 , for each business district node in the heterogeneous ternary graph, the neighbor user set, neighbor business district set, neighbor event set and corresponding influence edge weight information of the business district node are constructed and cached.
[0080] In some implementations, offline aggregation and caching may also be employed, thereby significantly reducing I / O overhead.
[0081] It should be noted that in the heterogeneous ternary graph, there is no direct connection between business district nodes and business district nodes. The neighboring business district nodes described here refer to business district nodes with a cross-connection relationship. Specifically, there is a user co-occurrence relationship or an event co-occurrence relationship between the business district nodes and the corresponding neighboring business district nodes. The user co-occurrence relationship is used to indicate that the first business district node and the second business district node have an edge connection corresponding to the same user node, and the event co-occurrence relationship is used to indicate that the third business district node and the fourth business district node have an edge connection corresponding to the same event node. For example, the number of common users for each pair of business districts is counted. , and count the number of common events for each pair of business districts , merge these two co-occurrence relationships and normalize them to obtain the composite edge weight between each pair of business districts This allows us to capture business districts that directly share user traffic, as well as discover business districts that are linked by common events, thus achieving extended spatial insights.
[0082] In step S340 , for each event node in the heterogeneous ternary graph, a neighbor user set of the event node and corresponding trigger edge weight information are constructed and cached.
[0083] In some implementations, all event validity windows are scanned, relevant business district and event pairs are cached, and all node and edge weight information is retained.
[0084] In step S350, for each spatial Motif template in the spatial Motif template group, multiple sampling operations are performed from the cached neighbor node set and edge weight information according to the spatial Motif template to obtain a corresponding Motif subgraph cluster. The number of Motif subgraphs in the Motif subgraph cluster is the preset number of template sampling subgraphs.
[0085] In some embodiments, for each template, random sampling is performed multiple times from cached neighbors according to edge weight or co-occurrence intensity to form subgraph clusters, and deduplication and coverage monitoring are performed simultaneously to ensure that there are a preset number (e.g., 50) subgraphs in the final Motif subgraph cluster.
[0086] In step S360 , the motif subgraph clusters corresponding to the spatial motif templates are combined to obtain corresponding multi-granularity subgraphs.
[0087] Here, the subgraph clusters corresponding to the three templates are merged to form a unified multi-granularity subgraph set, realizing the organic combination of subgraphs of different scales, so that the final spatial features simultaneously have multiple goals of "local cluster perception", "cross-circle collaborative insight" and "event response capture".
[0088] Figure 5 A schematic diagram of an operation example of extracting multi-scale spatial features from multi-granularity subgraphs according to an embodiment of the present application is shown.
[0089] like Figure 5 As shown, in step S510, for each Motif subgraph in the Motif subgraph cluster, the features of each neighbor node in the Motif subgraph are aggregated to the target user node based on the graph attention network to obtain the subgraph space encoding vector corresponding to the target user node.
[0090] It should be noted that different neighbor nodes have different effects on the target user. By processing the neighbor features and target features according to the "splicing → mapping → activation → normalization" process, the relative importance of each edge in the subgraph can be dynamically calculated, so that high-value or high-correlation neighbor information can be given greater weight.
[0091] Furthermore, within a single subgraph, the weighted features of neighboring nodes are fused with the node's own features through weighted summation to construct a single-scale spatial representation of the target user node in the subgraph, thereby refining information about the "local receptive field". The specific calculation details are as follows:
[0092] , Formula (4)
[0093] , Formula (5)
[0094] Where, Indicates the Target user node in the Motif subgraph The subgraph space encoding vector of is the Sigmoid activation function; Indicates any Adjacent nodes, Indicates the Motif subgraph with The set of directly connected neighbor nodes, is the attention coefficient, which is used to measure the target user node To its neighboring nodes Information attention; and They are and The input feature vector of Represents the feature mapping matrix, which is used to project the original feature vector into the attention space; Represents vector concatenation operation, represents the transpose of the attention weight vector, Represents the LeakyReLU activation function; Indicates any Adjacent nodes, It means that the same mapping is performed on all neighbor nodes and the sum is used as the normalization denominator.
[0095] In step S520 , the sub-graph spatial encoding vectors corresponding to each Motif sub-graph in the Motif sub-graph cluster are aggregated to obtain the template average spatial features for the corresponding spatial Motif template.
[0096] It should be noted that multiple samplings under the same template can cover different instances of the pattern. Simple averaging (or weighted averaging) can eliminate the accidental noise brought by individual sub-images to form the most representative spatial feature representation of the template. The specific calculation formula is as follows:
[0097] , Formula (6)
[0098] Where, Indicates that for The average spatial features of the template of the spatial Motif template, Indicates the number of template sampling subgraphs, Indicates that for The first type of spatial Motif template The encoding vector of the target user node in the Motif subgraph obtained by subsampling;
[0099] In step S530, the template average spatial features corresponding to each spatial Motif template are fused across template attention to obtain the multi-scale spatial features of the target user node.
[0100] It should be noted that for the three templates of "micro triangle," "meso double circle," and "macro event," the importance of their respective encoding results varies depending on the user or scenario. A lightweight feedforward network automatically calculates the fusion weights of each template to achieve adaptive matching. Furthermore, the adaptively weighted spatial features of each template are linearly superimposed to obtain a multi-scale spatial feature that combines local coordination, meso-level migration, and global event response capabilities. The specific calculation formula is as follows:
[0101] , Formula (7)
[0102] , formula (8)
[0103] Where, Target user node The corresponding multi-scale spatial features, Indicates the template average spatial features of various spatial Motif templates according to the corresponding fusion weights Weighted sum, Indicates the Feature fusion weights of spatial Motif templates; Indicates that for A linear mapping matrix of a spatial Motif template, represents the hyperbolic tangent activation function; represents the transpose of the global fusion weight vector, Represents any type of spatial Motif template, Indicates that the same mapping and score calculation are performed on all types of spatial motif templates to be used as the normalized denominator.
[0104] Through the embodiments of the present application, multi-scale Motif subgraph sampling and hierarchical attention aggregation are adopted to effectively integrate the three types of spatial features of "group collaboration", "cross-circle flow" and "event resonance", thereby achieving a refined characterization of heterogeneous spatiotemporal consumption networks.
[0105] Figure 6 The following is an example of an operation flow chart of extracting event timing impact trend factors based on a time domain convolutional network according to an embodiment of the present application. , and converts its impact in the graph structure into vectorized factors for downstream fusion through a "graph-timing" coupled pipeline.
[0106] like Figure 6 As shown, in step S610, an event node spatiotemporal input sequence is extracted from the heterogeneous ternary graph, and the event node spatiotemporal input sequence includes an aggregated business district consumption sequence and an aggregated event intensity sequence.
[0107] Here, with the help of the "business district-event" neighbor edge, the business district consumption and the event's own attenuation signal in the graph structure are aggregated into a dual-channel time series vector. This ensures that the input used is not just the timestamp or static intensity of the event itself, but also integrates the actual consumption response of the business districts it is connected to, realizing graph-aware time series input.
[0108] Specifically, the calculation of the consumption sequence of the aggregated business district includes:
[0109] , formula (9)
[0110] , formula (10)
[0111] Where, express Historical trading time steps within Represents a time series index, For event nodes The total number of historical time series steps corresponding to the event node The total number of time steps collected from the time of effectiveness; Represents an event node exist The weighted regional consumption total is used to obtain the aggregated business district consumption sequence through time series fusion; Represents an event node The set of directly connected neighboring business districts in the heterogeneous ternary graph, Indicates that all event nodes Neighborhood shopping district collection Business district nodes in Sum to aggregate the consumption within the scope of the event; Represents a business district node exist Total consumption of Represents a business district node With event nodes exist The corresponding immediate impact weight is used to quantify the impact of the event on the business district at that moment.
[0112] Here, by adopting weighted aggregation consumption sequence, the weights of the business district-event connections in the heterogeneous ternary graph are multiplied by the consumption volume and then aggregated. This can sensitively reflect the actual fluctuations in the consumption volume of the business district after the sudden event. The input sequence contains both topological structure information (which business districts are more affected) and actual economic activities (changes in consumption volume).
[0113] Calculations for aggregate event intensity sequences, including:
[0114] , formula (11)
[0115] Where, Represents an event node exist The temporal attenuation intensity value of is used to obtain the aggregated event intensity sequence through temporal fusion.
[0116] It should be noted that both Equations (10) and (11) use a time exponential decay function, because the intensity of the event’s own impact (Equation 11) and its driving effect on the shopping district’s consumption (Equation 10) essentially follow the same exponential decay process. In other words, whether it is the “immediate impact weight” used to weight the shopping district’s consumption sequence, , or the "time series decay intensity value" used to characterize the decay of the event itself over time , they essentially express the same physical quantity - that is, the influence of an event decays exponentially as time goes by.
[0117] Here, an exponential decay intensity sequence is used, combined with the event’s own decay channel, to retain a continuous characterization of the event’s own attributes (such as promotions, extreme weather), ensuring that the model does not only focus on occasional outbreaks in a certain period of data.
[0118] In step S620, the aggregated business district consumption sequence and the aggregated event intensity sequence are combined to obtain a dual-channel event node spatiotemporal input sequence. .
[0119] In step S630, the event node spatiotemporal input sequence is extracted based on the multi-scale temporal convolutional network. Extract event nodes Event timing shock trend factor .
[0120] It should be noted that the event timing impact trend factor is a vectorized and condensed expression of the impact of a single event node on the dynamic consumption of the business district during its effective period. Specifically, it is obtained by splicing the weighted business district consumption sequence of the event at each historical moment with its own attenuation intensity sequence and inputting it into a multi-scale time domain convolutional network, and taking the hidden representation of the last moment of the last layer.
[0121] More specifically, Input into the multi-scale time domain convolutional network, the first layer focuses on short-term shocks, and the subsequent layers successively expand the receptive field to capture medium- and long-term trends. layer) corresponds to the last moment The output hidden representation As an event sequence impact trend factor .
[0122] Here, the multi-scale temporal convolutional network contains multiple cascaded TCN layers, each of which has a successively increasing receptive field size to capture event nodes. Impacts and evolution trends at different time scales.
[0123] In some embodiments, a different expansion rate and convolution kernel length are set for each TCN layer to obtain a successively increasing receptive field size, so that the model can simultaneously capture multiple time series patterns from "adjacent moment pulsations" to "long-distance trend evolution" without increasing the sequence length or global self-attention, covering different scales from a few steps of short-term shocks to longer-term evolution, and realizing a multi-stage convolution structure, which not only achieves sensitivity to instantaneous peaks, but also takes into account the grasp of medium- and long-term trends.
[0124] As a further preferred implementation, residual connectivity can be added between each TCN layer, and LayerNorm can be performed after each layer to ensure the smooth flow of information in the deep network and avoid the gradient vanishing or exploding problem caused by the increase in the number of layers.
[0125] Figure 7 An operational flowchart of an example of a feature fusion operation for spatiotemporal fusion features according to an embodiment of the present application is shown.
[0126] like Figure 7 As shown, in step S710, the event factor vector of the user node is constructed according to the temporal impact trend factor of each target event and the edge weight of the corresponding event-user triggering edge.
[0127] It should be noted that in a heterogeneous ternary graph, the edge weight of the event-user trigger edge accurately reflects the user's sensitivity to historical events. When faced with multiple potential future events, user-event pairs that have historically shown a high response to similar events can be prioritized.
[0128] , formula (12)
[0129] Where, Represented as a user node The event factor vector of User nodes that are matched with potential external events The total number of connected event nodes, Represents any matching event node, express The corresponding time series shock trend factor, Representing user nodes in heterogeneous ternary graphs With event nodes The edge weights between Represents the normalized weight coefficient, used in Measure the impact of each event factor on the user node within the interval the relative importance of Indicates that the event-user trigger weights corresponding to all potential external events matched are summed up and used as the normalized denominator.
[0130] In formula (12), using For each event factor Weighting can not only retain information about historical behavioral preferences, but also allocate differentiated influence to future events at the user level. By allocating weights based on user historical behaviors, different users will react differently to the same future event, greatly enhancing the model's personalization capabilities.
[0131] In addition, the original response weights of different events may have different dimensions and ranges. Direct weighting will cause some weights to be too large and dominate the entire factor vector. Here, the normalized weight is obtained by summing all event-user weights as the denominator. , so that the weight of each matching event is proportionally distributed between 0 and 1, and the total is 1.
[0132] In step S720, the multi-scale spatial features of the user node and the event factor vector are gated and fused to obtain corresponding spatiotemporal fusion features.
[0133] It should be noted that in the implementation of this application, attention fusion and gated fusion were compared. Attention fusion requires scoring each event or each pair of spatial / event dimensions separately, and the computational complexity increases exponentially with the number of events or dimensions. In contrast, gated fusion directly calculates the balance coefficient based on two overall vectors, spatial and event, through a single mapping and sigmoid function, which is more efficient.
[0134] Specifically, the dimension-by-dimension gating vector The fusion ratio of spatial and event signals in each dimension is determined by linearly mapping the spatial features and event factors, performing weighted summation, and then performing Sigmoid nonlinear mapping.
[0135] First, the two inputs are linearly mapped and summed, and then activated by Sigmoid to obtain a dimension-by-dimension gate vector.
[0136] , Formula (13)
[0137] Where, represents the dimension-wise gating vector, and Represent the gating mapping matrices for spatial features and event factors respectively, is the gate bias vector, Represents a user node Corresponding multi-scale spatial features.
[0138] Here, the Sigmoid function The output gating coefficient is a vector that independently controls the weight of spatial and event signals in each dimension, avoiding the global fixed ratio that cannot capture the difference in signal importance in different dimensions. In addition, the gating mapping matrix 、 and the gate bias vector are learnable parameters that can be jointly trained with the downstream network, so that the fusion method can be automatically optimized based on the actual data.
[0139] Therefore, compared to multi-head attention or cyclic scoring of each signal pair, gated fusion requires only a single tensor operation, reducing online latency several times. Furthermore, the gating coefficients automatically adjust as feature distributions change, eliminating the need for manual adjustment of fusion hyperparameters, improving the model's adaptability to multiple scenarios.
[0140] Then, the two signals are weighted and merged element by element based on the dimension-by-dimension gating vector to obtain the spatiotemporal fusion features of the corresponding user node.
[0141] , formula (14)
[0142] Where, Represents a user node The spatiotemporal fusion characteristics of represents a vector of all 1s, Represents element-wise product.
[0143] Here, the spatial features and event factors are linearly weighted element by element through the gating vector to obtain By using element-by-element weighting, we achieve a smooth transition and fusion of the two signals. Compared to hard splicing, this fusion provides a continuous trade-off value in each dimension, preventing any signal from being completely truncated. This creates a smooth curve in the feature space, enhancing the ability to model user behavior transitions.
[0144] Regarding the details of the final prediction of the consumption behavior of users in the business district, in some examples of the embodiments of the present application, the spatiotemporal fusion features of the user nodes are combined. Business district attribute characteristics corresponding to the target business district node Concatenate to form the input vector .
[0145] The input vector is fed into the Deep Cross Network (DCN), through The layer-level explicit features are crossed, and the consumption amount and consumption frequency of the corresponding user in the target business district are output through a double regression head.
[0146] Specifically, The following calculations are performed layer by layer:
[0147] , formula (15)
[0148] Where, For the The input vector of the layer, and when hour represents the initial input vector for concatenation; Indicates the the transpose of the layer's cross-weights, Indicates the The bias term of the layer;
[0149] Here, the cross module of DCN iterates through several layers, each of which scales the initial features with the inner product scalar of the initial input and the current input (an explicit cross strength), and then adds bias and residual to achieve layer-by-layer explicit combination of high-order features.
[0150] It should be noted that in the prediction of consumer behavior, there may be complex combination relationships of second order, third order or even higher order between the user's spatiotemporal fusion characteristics and the attributes of the business district - for example, "the user's sensitivity to a certain business district during the promotion period" may be simultaneously affected by the user's preference × event impact × business district heat multi-channel signal. However, in traditional deep networks, such interactions can only be learned implicitly through multi-layer nonlinear transformations, which is difficult to explain and requires a deeper network. In contrast, in the cross module of DCN, each cross layer is based on the interaction result of the previous layer and is explicitly multiplied by the initial input again, thereby accumulating modeling second order, third order... until N +1 order. The stepped structure not only retains low-order feature signals but also smoothly integrates high-order signals into the representation, avoiding one-time overfitting and gradient degradation.
[0151] go through After the crossover, the cross output , and The data is fed into two linear regression heads respectively to directly predict the corresponding shopping district consumption amount and shopping district consumption frequency.
[0152] Here, after obtaining the top-level output of the cross-network, the model uses two sets of minimalist linear regression heads to predict the consumption amount and consumption frequency in parallel.
[0153] , formula (16)
[0154] , formula (17)
[0155] Where, Indicates the The cross output vector of the layer, Represents a user node Target business district nodes within a preset time period in the future The consumption amount forecast value, Indicates the user node Target business district nodes within the same time period The consumption frequency forecast value, and denote the transpose of the regression weight vector of the first regression head and the transpose of the regression weight vector of the second regression head, respectively. and represent the regression bias of the first regression head and the regression bias of the second regression head respectively.
[0156] Here, by using two independent weight vectors but sharing inputs, the model can simultaneously regress two metrics on the same feature representation, avoiding duplicate encoding. Because consumption amount and consumption frequency are both correlated and significantly different, the independent parameters of the two heads ensure optimal fit for each. This allows for parallel regression on the same feature representation, avoiding repeated computations within a single task and conserving memory and computing resources. Furthermore, sharing cross-outputs promotes convergence between the two tasks in the early stages of training, improving sample utilization efficiency.
[0157] Through the embodiment of the present application, a deep learning model combining a cross network and a double regression head is adopted, without manually designing a large number of cross features or introducing a deep MLP (Multi-Layer Perceptron). The cross module inside the model can automatically construct a second-order to N +1-order combination greatly improves development efficiency and model interpretability.
[0158] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of combined actions, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0159] Figure 8 A structural block diagram of an example of a spatiotemporal data-driven consumer behavior prediction system according to an embodiment of the present application is shown.
[0160] like Figure 8 As shown, the spatiotemporal data-driven consumption behavior prediction system 800 includes a heterogeneous ternary graph construction unit 810, a spatial feature extraction unit 820, a temporal feature extraction unit 830, a spatiotemporal feature fusion unit 840 and a business district consumption prediction unit 850.
[0161] The heterogeneous ternary graph construction unit 810 is used to define user nodes, business district nodes and event nodes respectively according to user attribute data, business district attribute data and historical external events, and analyze the user's historical consumption data and business district POI data to determine the corresponding user-business district consumption edge, business district-event influence edge and event-user trigger edge, so as to construct a heterogeneous ternary graph; the edge weight of the user-business district consumption edge is defined according to the historical consumption intensity of the user in the corresponding business district, the edge weight of the business district-event influence edge is defined according to the time attenuation influence coefficient of the corresponding external event in the business district, and the edge weight of the event-user trigger edge is defined according to the historical responsiveness weight of the user to the corresponding external event.
[0162] The spatial feature extraction unit 820 is used to perform multi-scale Motif subgraph sampling on the heterogeneous ternary graph to extract a multi-granularity subgraph that matches the user node, and calculate the spatial coding features of the user node in each granularity subgraph in the multi-granularity subgraph, and obtain the multi-scale spatial features of the corresponding user node through feature weighted fusion.
[0163] The time series feature extraction unit 830 is used to extract the event time series impact trend factor corresponding to each event node in the heterogeneous ternary graph based on the time domain convolutional network.
[0164] The spatiotemporal feature fusion unit 840 is used to obtain at least one potential external event corresponding to a preset time period in the future, and determine the target event timing impact trend factor of the corresponding user node by matching each event node in the heterogeneous ternary graph, and fuse each of the target event timing impact trend factors with the multi-scale spatial features to obtain the spatiotemporal fusion features of the corresponding user node.
[0165] The business district consumption prediction unit 850 is used to predict the business district consumption amount and business district consumption frequency of the corresponding user in each business district in the future preset time period based on the spatiotemporal fusion characteristics of the user node.
[0166] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of any of the above-mentioned spatiotemporal data-driven consumer behavior prediction methods of the present application.
[0167] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of any one of the above-mentioned spatiotemporal data-driven consumer behavior prediction methods.
[0168] In some embodiments, an embodiment of the present application also provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the steps of the spatiotemporal data-driven consumer behavior prediction method.
[0169] Figure 9 This is a hardware structure diagram of an electronic device for executing a spatiotemporal data driven consumer behavior prediction method provided in another embodiment of the present application, such as Figure 9 As shown, the device includes:
[0170] One or more processors 910 and memory 920, Figure 9 A processor 910 is taken as an example.
[0171] The device for executing the spatiotemporal data-driven consumption behavior prediction method may further include: an input device 930 and an output device 940 .
[0172] The processor 910, the memory 920, the input device 930 and the output device 940 may be connected via a bus or other means. Figure 9 The bus connection is taken as an example.
[0173] Memory 920, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the spatiotemporal data-driven consumer behavior prediction method in the embodiments of the present application. Processor 910 executes the non-volatile software programs, instructions, and modules stored in memory 920 to execute various server functional applications and data processing, thereby implementing the spatiotemporal data-driven consumer behavior prediction method in the aforementioned method embodiment.
[0174] The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device, etc. In addition, the memory 920 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 920 may optionally include a memory remotely located relative to the processor 910, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0175] The input device 930 may receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 940 may include a display device such as a display screen.
[0176] The one or more modules are stored in the memory 920 and, when executed by the one or more processors 910, perform the spatiotemporal data driven consumption behavior prediction method in any of the above method embodiments.
[0177] The above-mentioned product can execute the method provided in the embodiment of this application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of this application.
[0178] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0179] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and their primary purpose is to provide voice and data communications. These terminals include smartphones, multimedia phones, feature phones, and low-end phones.
[0180] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers and have computing and processing capabilities, and generally also have mobile Internet access. These terminals include PDAs, MIDs, and UMPCs.
[0181] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0182] (4) Other airborne electronic devices with data interaction functions.
[0183] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0184] Through the description of the above embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a general hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A consumption behavior prediction method driven by spatiotemporal data, characterized in that: Applied to a consumer behavior prediction management platform, the method includes: Based on user attribute data, business district attribute data, and historical external events, user nodes, business district nodes, and event nodes are defined respectively. Analysis is then performed in conjunction with historical user consumption data and business district POI data to determine the corresponding user-business district consumption edges, business district-event influence edges, and event-user trigger edges, thereby constructing a heterogeneous ternary graph. Performing multi-scale Motif subgraph sampling on the heterogeneous ternary graph to extract a multi-granularity subgraph matching the user node, calculating the spatial encoding features of the user node in each granularity subgraph in the multi-granularity subgraph, and obtaining the multi-scale spatial features of the corresponding user node through weighted feature fusion; Based on the time domain convolutional network, extract the event time series impact trend factor corresponding to each event node in the heterogeneous ternary graph; Obtaining at least one potential external event corresponding to a preset future time period, and determining a target event temporal impact trend factor of a corresponding user node by matching it with each event node in the heterogeneous ternary graph, and fusing each of the target event temporal impact trend factors with the multi-scale spatial features to obtain a spatiotemporal fusion feature of the corresponding user node; Processing the spatiotemporal fusion features of the user nodes according to a multi-task deep learning model to output a consumption behavior prediction result corresponding to the corresponding user node, wherein the consumption behavior prediction result is used to indicate the amount of consumption and frequency of consumption in each business district by the user corresponding to the user node in the future preset time period; The user historical consumption data includes historical consumption records of at least one user in various business districts; the business district POI data includes business district range information, POI distribution density, and historical passenger flow heat value sequences; and the historical external events include at least one of the following event types: holiday events, regional public consumption voucher events, merchant promotion events, and extreme weather events; The calculation of the edge weight for the user-business district consumption edge includes: , Where, For user nodes and business district nodes The edge weight corresponding to the user-business district consumption edge between , which is used to express the user's historical consumption intensity in the business district; Represents the frequency weight coefficient, the value range is ; Represents a user node In the business district node The total number of historical transactions within; Represents any business district node, Represents a user node The sum of the number of transactions in all business district nodes; Represents a user node In the business district node The total amount of historical consumption, Represents a user node The total amount of spending in all shopping districts; The calculation of the edge weight for the business district-event impact edge includes: , Where, For business district nodes With event nodes The edge weight corresponding to the business circle-event impact edge between them is used to express the time-attenuation influence coefficient to quantify the event node During its entire effective period, Average aging impact strength; Represents an event node The inherent influence intensity of ; is the time-dependent decay rate weight, Represents an event node The starting moment; Represents a business district node In the event Effective time range The collection of all historical transaction moments in which transactions occurred within Representing a collection The total number of trading moments in Representing a collection Any historical trading moment; and Represents event nodes respectively The effective start time and effective end time of the contract; The calculation of edge weights for event-user triggered edges includes: , Where, For event nodes With user node The edge weight corresponding to the event-user trigger edge between them is used to quantify the user node For event nodes The historical responsiveness weight of Indicates that at the event node During the impact period, user nodes The actual number of purchases in the shopping district related to the event, used to reflect the user's participation in the event; represents any user node, Indicates the event nodes obtained by statistics of all user nodes The maximum number of responses.
2. The method according to claim 1, characterized in that The performing multi-scale Motif subgraph sampling on the heterogeneous ternary graph to extract a multi-granularity subgraph matching the user node includes: Obtain a spatial Motif template group, which includes a triangular closed loop template, a dual business district path template, and an event circle template; the triangular closed loop template defines a three-node closed loop structure formed by a target user node and another user node at the same business district node, and its template format is target user-business district-another user, which is used to capture the consumption synergy effect of group users in the same business district; the dual business district path template defines a two-hop path structure formed by the target user node and another user node being sequentially connected through two different business district nodes, and its template format is target user-first business district-second business district-another user, which is used to mine the consumption migration pattern and interest extension of users across business districts; the event circle template defines a four-node event-driven closed loop structure formed by the target user node and another user node interacting through business district nodes and event nodes, and its template format is target user-business district-event-another user, which is used to extract the resonant consumption response of the same external event to the group users; For each user node in the heterogeneous ternary graph, construct and cache the neighboring business district set of the user node and the corresponding consumption edge weight information; For each business district node in the heterogeneous ternary graph, a set of neighboring users, a set of neighboring business districts, and a set of neighboring events, as well as corresponding influence edge weight information, are constructed and cached. A user co-occurrence relationship or an event co-occurrence relationship exists between the business district node and its corresponding neighboring business district nodes. The user co-occurrence relationship indicates that a first business district node and a second business district node have an edge connection corresponding to the same user node, and the event co-occurrence relationship indicates that a third business district node and a fourth business district node have an edge connection corresponding to the same event node. For each event node in the heterogeneous ternary graph, construct and cache a neighbor user set of the event node and corresponding trigger edge weight information; For each spatial motif template in the spatial motif template group, multiple sampling operations are performed from the cached neighbor node set and edge weight information according to the spatial motif template to obtain a corresponding motif subgraph cluster; the number of motif subgraphs in the motif subgraph cluster is the preset number of template sampling subgraphs; The Motif subgraph clusters corresponding to each spatial Motif template are combined to obtain the corresponding multi-granularity subgraph.
3. The method according to claim 2, characterized in that The calculating of the spatial coding features of the user nodes in each granularity subgraph in the multi-granularity subgraph and obtaining the multi-scale spatial features of the corresponding user nodes by weighted fusion of the features includes: For each motif subgraph in the motif subgraph cluster, the features of each neighboring node in the motif subgraph are aggregated to the target user node based on the graph attention network to obtain the subgraph spatial encoding vector corresponding to the target user node: , , Where, Indicates the Target user node in the Motif subgraph The subgraph space encoding vector of is the Sigmoid activation function; Indicates any Adjacent nodes, Indicates the Motif subgraph with The set of directly connected neighbor nodes, is the attention coefficient, which is used to measure the target user node To its neighboring nodes Information attention; and They are and The input feature vector of Represents the feature mapping matrix, which is used to project the original feature vector into the attention space; Represents vector concatenation operation, represents the transpose of the attention weight vector, Represents the LeakyReLU activation function; Indicates any Adjacent nodes, It means that the same mapping is performed on all neighbor nodes and the sum is used as the normalization denominator; Aggregate the subgraph spatial encoding vectors corresponding to each motif subgraph in the motif subgraph cluster to obtain the template average spatial features for the corresponding spatial motif template: , Where, Indicates that for The average spatial features of the template of the spatial Motif template, Indicates the number of template sampling subgraphs, Indicates that for The first type of spatial Motif template In the Motif subgraph obtained by subsampling, the target user node The encoding vector of The template average spatial features corresponding to each spatial Motif template are fused across template attention to obtain the multi-scale spatial features of the target user node: , , Where, Target user node The corresponding multi-scale spatial features, Indicates the template average spatial features of various spatial Motif templates according to the corresponding fusion weights Weighted sum, Indicates the Feature fusion weights of spatial Motif templates; Indicates that for A linear mapping matrix of a spatial Motif template, represents the hyperbolic tangent activation function; represents the transpose of the global fusion weight vector, Represents any type of spatial Motif template, Indicates that the same mapping and score calculation are performed on all types of spatial motif templates to be used as the normalized denominator.
4. The method according to claim 3, characterized in that The method of extracting the event timing impact trend factor corresponding to each event node in the heterogeneous ternary graph based on the time domain convolutional network includes: Extracting a spatiotemporal input sequence of event nodes from a heterogeneous ternary graph, wherein the spatiotemporal input sequence of event nodes includes an aggregated business district consumption sequence and an aggregated event intensity sequence; The calculation of the consumption sequence of the aggregated business district includes: , , Where, express Historical trading time steps within Represents a time series index, For event nodes The total number of historical time series steps corresponding to the event node The total number of time steps collected from the time of effectiveness; Represents an event node exist The weighted regional consumption total is used to obtain the aggregated business district consumption sequence through time series fusion; Represents an event node The set of directly connected neighboring business districts in the heterogeneous ternary graph, Indicates that all event nodes Neighborhood shopping district collection Business district nodes in Sum to aggregate the consumption within the scope of the event; Represents a business district node exist Total consumption of Represents a business district node With event nodes exist The corresponding immediate impact weight is used to quantify the impact of the event on the business district at that moment; The calculation of the aggregation event intensity sequence includes: , Where, Represents an event node exist The temporal attenuation intensity value of is used to obtain the aggregated event intensity sequence through temporal fusion; Combine the aggregated business district consumption sequence with the aggregated event intensity sequence to obtain a dual-channel event node spatiotemporal input sequence ; Based on multi-scale time domain convolutional network Extract event nodes Event timing shock trend factor The multi-scale temporal convolutional network includes multiple cascaded TCN layers, each of which has a successively increasing receptive field size to capture event nodes. Impacts and evolution trends at different time scales.
5. The method according to claim 4, characterized in that The step of fusing the temporal impact trend factors of each target event with the multi-scale spatial features to obtain the spatiotemporal fusion features of the user node includes: According to the temporal impact trend factors of each target event and the edge weights of the corresponding event-user trigger edges, the event factor vector of the user node is constructed: , Where, Represented as a user node The event factor vector of User nodes that are matched with potential external events The total number of connected event nodes, Represents any matching event node, express The corresponding time series shock trend factor, Representing user nodes in heterogeneous ternary graphs With event nodes The edge weights between Represents the normalized weight coefficient, used in Measure the impact of each event factor on the user node within the interval the relative importance of Indicates that the event-user trigger weights corresponding to all potential external events matched are summed up and used as the normalized denominator; The multi-scale spatial features of the user node and the event factor vector are gated and fused to obtain the corresponding spatiotemporal fusion features, including: Perform linear mapping on the two inputs and sum them up, and activate them through Sigmoid to obtain a dimension-by-dimension gate vector: , Where, represents the dimension-wise gating vector, and Represent the gating mapping matrices for spatial features and event factors respectively, is the gate bias vector, Represents a user node Corresponding multi-scale spatial features; The two signals are weighted and merged element by element based on the dimension-by-dimension gating vector to obtain the spatiotemporal fusion features of the corresponding user node: , Where, Represents a user node The spatiotemporal fusion characteristics of represents a vector of all 1s, Represents element-wise product.
6. The method according to claim 5, characterized in that The processing of the spatiotemporal fusion features of the user nodes according to the multi-task deep learning model to output the consumption behavior prediction results corresponding to the corresponding user nodes includes: The spatiotemporal fusion features of the user node Business district attribute characteristics corresponding to the target business district node Concatenate to form the input vector ; The input vector is fed into the deep cross network, through The explicit features are crossed at each layer, and the double regression head is used to output the corresponding user's shopping amount and shopping frequency in the target shopping district: right The following calculations are performed layer by layer: , Where, For the The input vector of the layer, and when hour represents the initial input vector for concatenation; Indicates the the transpose of the layer's cross-weights, Indicates the The bias term of the layer; go through After the crossover, the cross output , and Feed it into two linear regression heads respectively to directly predict the corresponding shopping district consumption amount and shopping district consumption frequency: , , Where, Indicates the The cross output vector of the layer, Represents a user node Target business district nodes within a preset time period in the future The consumption amount forecast value, Indicates the user node Target business district nodes within the same time period The consumption frequency forecast value, and denote the transpose of the regression weight vector of the first regression head and the transpose of the regression weight vector of the second regression head, respectively. and represent the regression bias of the first regression head and the regression bias of the second regression head respectively.
7. A consumption behavior prediction system driven by spatiotemporal data, characterized by: Applied to a consumer behavior prediction management platform, the system includes: A heterogeneous ternary graph construction unit is used to define user nodes, business district nodes, and event nodes based on user attribute data, business district attribute data, and historical external events. It then analyzes historical user consumption data and business district POI data to determine the corresponding user-business district consumption edges, business district-event influence edges, and event-user trigger edges, thereby constructing a heterogeneous ternary graph. a spatial feature extraction unit configured to perform multi-scale Motif subgraph sampling on the heterogeneous ternary graph to extract a multi-granularity subgraph matching the user node, calculate the spatial coding features of the user node in each granularity subgraph in the multi-granularity subgraph, and obtain the multi-scale spatial features of the corresponding user node by weighted feature fusion; A time series feature extraction unit is used to extract the event time series impact trend factor corresponding to each event node in the heterogeneous ternary graph based on a time domain convolutional network; a spatiotemporal feature fusion unit for acquiring at least one potential external event corresponding to a preset future time period, determining a target event temporal impact trend factor of a corresponding user node by matching the event nodes with each event node in the heterogeneous ternary graph, and fusing each of the target event temporal impact trend factors with the multi-scale spatial features to obtain a spatiotemporal fusion feature of the corresponding user node; a business district consumption prediction unit, configured to process the spatiotemporal fusion features of the user node according to a multi-task deep learning model to output a consumption behavior prediction result corresponding to the corresponding user node, wherein the consumption behavior prediction result is used to indicate the business district consumption amount and business district consumption frequency of the user corresponding to the user node in the future preset time period in each business district; The user historical consumption data includes historical consumption records of at least one user in various business districts; the business district POI data includes business district range information, POI distribution density, and historical passenger flow heat value sequences; and the historical external events include at least one of the following event types: holiday events, regional public consumption voucher events, merchant promotion events, and extreme weather events; The calculation of the edge weight for the user-business district consumption edge includes: , Where, For user nodes and business district nodes The edge weight corresponding to the user-business district consumption edge between , which is used to express the user's historical consumption intensity in the business district; Represents the frequency weight coefficient, the value range is ; Represents a user node In the business district node The total number of historical transactions within; Represents any business district node, Represents a user node The sum of the number of transactions in all business district nodes; Represents a user node In the business district node The total amount of historical consumption, Represents a user node The total amount of spending in all shopping districts; The calculation of the edge weight for the business district-event impact edge includes: , Where, For business district nodes With event nodes The edge weight corresponding to the business circle-event impact edge between them is used to express the time-attenuation influence coefficient to quantify the event node During its entire effective period, Average aging impact strength; Represents an event node The inherent influence intensity of ; is the time-dependent decay rate weight, Represents an event node The starting moment; Represents a business district node In the event Effective time range The collection of all historical transaction moments in which transactions occurred within Representing a collection The total number of trading moments in Representing a collection Any historical trading moment; and Represents event nodes respectively The effective start time and effective end time of the contract; The calculation of edge weights for event-user triggered edges includes: , Where, For event nodes With user node The edge weight corresponding to the event-user trigger edge between them is used to quantify the user node For event nodes The historical responsiveness weight of Indicates that at the event node During the impact period, user nodes The actual number of purchases in the shopping district related to the event, used to reflect the user's participation in the event; represents any user node, Indicates the event nodes obtained by statistics of all user nodes The maximum number of responses.
Citation Information
Patent Citations
Method and system for analyzing user consumption behaviors in different scenes in commercial space
CN119850253A
Commercial vitality prediction and business district evaluation method based on multi-modal feature fusion
CN119918981A