A knowledge graph-based catering data analysis system and method
Patent Information
- Application Number
- CN202611182333.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-23
AI Technical Summary
传统数据分析系统在进行业务复盘和趋势发掘时,通常依赖固定时间窗口或静态规则对数据集进行划分,该类刚性切片方式难以兼顾消费者语义评价在时间轴上的连续性与突变性,也难以准确刻画文本主题演化与消费者时序行为之间的关联
[0008]本发明通过建立文本评论与交易流水的关联映射,将评价方面、情感极性及情感强度联合编码为语义指纹,用于表征评论语义不稳定性并识别顾客情感波动。进一步构建融合用户、菜品与文本主题的餐饮知识超图,并以语义不稳定性系数作为超边初始权重,实现交易行为与评价语义的高维关联表达。通过设置基于历史演化趋势更新的语义引力中心和时序行为约束,结合反馈增强型社群传播算法迭代形成局部谐振场,并对关联超边权重进行反馈调制,从复杂关联网络中划分出特征聚焦的目标数据切片。基于目标数据切片计算菜品销售贡献度和主题演化趋势,并通过周期性反馈更新分析中心,从而提升餐饮数据分析结果的关联性、时效性和趋势感知能力。
Smart Images

Figure CN122964489A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of analytics, and in particular relates to a knowledge graph-based catering data analysis system and method. Background Technology
[0002] As the catering industry becomes increasingly digitalized, businesses accumulate a wealth of operational data in their daily operations. This data primarily includes transaction records documenting consumer behavior and text reviews reflecting dining experiences. This data possesses significant commercial value, serving as crucial information for businesses to optimize menu structure, improve service quality, and formulate marketing strategies. While transaction records objectively reflect sales volume, average order value, and operational changes, they struggle to reveal the underlying consumer emotions and genuine needs behind sales fluctuations. Text reviews, though containing subjective attitudes and multi-dimensional evaluations, exhibit significant unstructured characteristics and flexible semantic expression, making it difficult for traditional analysis methods to accurately extract emotional intensity and semantic evolution trends. Furthermore, existing methods lack the ability to jointly model objective transaction facts and subjective evaluation semantics, hindering the effective identification of complex, multi-level interactions between consumers, dishes, and evaluation topics, thus limiting the uncovering of deeper patterns in catering operations.
[0003] Meanwhile, the catering market demand and consumer preferences are highly dynamic and time-sensitive, with popular dishes and review topics often evolving rapidly with seasonal changes, consumption hotspots, and social media dissemination. Traditional data analysis systems, when conducting business reviews and trend discovery, typically rely on fixed time windows or static rules to divide datasets. This rigid slicing approach struggles to balance the continuity and abrupt changes in consumer semantic evaluations over time, and also fails to accurately depict the correlation between text topic evolution and consumer temporal behavior. When the semantic focus of numerous reviews shifts rapidly, static slicing strategies cannot adjust the analysis center in a timely manner, easily leading to delayed or distorted analysis results. Faced with the complex and intertwined multi-faceted relationships in catering data, conventional clustering or network analysis methods struggle to perceive the convergence and evolution of local data features, resulting in extracted data slices that fail to represent the core consumption trends under specific market cycles. Therefore, the industry urgently needs a catering data analysis method that can overcome the limitations of isolated analysis and static segmentation to achieve a deep understanding of the semantic evolution and complex behavioral patterns of catering data. Summary of the Invention
[0004] To improve the timeliness and accuracy of analysis of multi-source time-series data in the catering industry, this invention provides a catering data analysis system and method based on knowledge graphs.
[0005] According to a first aspect of the present invention, a knowledge graph-based catering data analysis system is provided, comprising the following modules:
[0006] The calculation module is used to acquire catering business data, which includes text review data and transaction flow data, and to establish an association mapping relationship between the transaction flow data and the text review data; for the text review data, an aspect polarity multidimensional vector is constructed, and the evaluation aspect, sentiment polarity and intensity value are jointly encoded to generate a semantic fingerprint; based on the conflict and novelty measures of the semantic fingerprint elements, a semantic instability coefficient is calculated for each review. The construction module is used to build a food and beverage knowledge hypergraph based on the association mapping relationship. It sets dishes, text topics, and users as nodes, and a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight. It also constructs a slicing paradigm that includes a semantic gravity center and temporal behavior constraints. The semantic gravity center is updated by the theme evolution trend of the previous cycle. The analysis module is used to iteratively calculate the probability of a dish node belonging to the semantic gravity center on the hypergraph using a feedback-enhanced community propagation algorithm, and use the probability to perform feedback modulation on the weights of the associated hyperedges to form a local resonant field. When the local resonant field converges and the transaction data associated with the nodes in the field satisfies the temporal behavior constraints, it is divided into target data slices; the module calculates the sales contribution of dish associations and the theme evolution trend within the target data slices, and generates analysis results.
[0007] According to a second aspect of the present invention, a knowledge graph-based method for analyzing catering data is provided, comprising the following steps: Acquire catering business data, which includes text review data and transaction flow data, and establish an association mapping relationship between the transaction flow data and the text review data; for the text review data, construct an aspect polarity multidimensional vector, jointly encode the evaluation aspect with sentiment polarity and intensity value to generate a semantic fingerprint, and calculate the semantic instability coefficient for each review based on the conflict and novelty measures of the semantic fingerprint elements; Based on the association mapping relationship, a catering knowledge hypergraph is constructed, with dishes, text topics, and users set as nodes, and a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight. A slicing paradigm containing a semantic gravity center and temporal behavior constraints is constructed, with the semantic gravity center updated by the theme evolution trend of the previous cycle. A feedback-enhanced community propagation algorithm is used on the hypergraph to iteratively calculate the probability of a dish node belonging to the semantic gravity center, and the probability is used to modulate the weight of the associated hyperedge to form a local resonant field. When the local resonant field converges and the transaction data associated with the nodes in the field meets the temporal behavior constraints, it is divided into target data slices. The sales contribution of dishes associated with the target data slices and the theme evolution trend are calculated to generate analysis results.
[0008] This invention establishes a mapping between text reviews and transaction flows, jointly encoding evaluation aspects, sentiment polarity, and sentiment intensity into semantic fingerprints to characterize the semantic instability of reviews and identify customer emotional fluctuations. It further constructs a restaurant knowledge hypergraph integrating users, dishes, and text themes, using the semantic instability coefficient as the initial weight of the hyperedges to achieve a high-dimensional association between transaction behavior and evaluation semantics. By setting a semantic gravity center updated based on historical evolution trends and temporal behavioral constraints, combined with a feedback-enhanced community propagation algorithm, a local resonant field is iteratively formed, and the weights of the associated hyperedges are modulated using feedback to segment feature-focused target data slices from the complex association network. Based on these target data slices, the sales contribution of dishes and the evolution trend of themes are calculated, and the analysis center is updated through periodic feedback, thereby improving the relevance, timeliness, and trend perception capabilities of restaurant data analysis results. Attached Figure Description
[0009] Figure 1 This is a schematic diagram illustrating the changes in related indicators of the semantic instability coefficient; Figure 2 This is a schematic diagram illustrating the change in the convergence probability of candidate nodes in a local resonant field. Detailed Implementation
[0010] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0011] In the first embodiment, the present invention proposes a knowledge graph-based catering data analysis system, comprising the following modules: The calculation module is used to acquire catering business data, which includes text review data and transaction flow data, and to establish an association mapping relationship between the transaction flow data and the text review data.
[0012] Text review data and transaction log data are extracted from online food delivery platforms and local databases, and a data connection channel is established to import the raw data into a relational database for storage. After reading the data, for records where the order number, transaction number, user unique identifier, dish code, and payment amount fields are empty, the corresponding records are removed based on the key fields. For missing values in non-key fields, they are filled according to preset default values, the average value of similar categories, or empty strings, and duplicate records are deduplicated. The order number field is extracted from the text review data, and the order log identifier field corresponding to the order number is extracted from the transaction log data as the association key. Inner join matching is performed to establish an association mapping form between a single transaction log record and the corresponding text review data. The processed association mapping data is stored in a distributed file system for further processing.
[0013] For the text comment data, an aspect polarity multidimensional vector is constructed, and the evaluation aspect, sentiment polarity and intensity value are jointly encoded to generate a semantic fingerprint. Based on the conflict and novelty measures of the semantic fingerprint elements, a semantic instability coefficient is calculated for each comment.
[0014] A pre-trained language model is loaded to extract word embedding vectors from text review data, constructing a dependency parsing tree. Based on the dependency parsing tree, entity words of the evaluation object and corresponding opinion modifier words are extracted. The entity words of the evaluation object are converted into dimensional identifier values of dish features, service features, and environment features according to an attribute mapping vocabulary. Opinion modifier words are input into a sentiment tendency calculation network model trained with supervised labels, outputting one-dimensional positive and negative category feature values and sentiment intensity values. Multiple aspect polarity multidimensional vectors extracted from the same review are grouped according to the evaluation dimension identifier, and mean pooling or attention-weighted pooling is performed on vectors under the same dimension to generate a continuous numerical semantic fingerprint vector at the single review level. The semantic fingerprint vector is composed of the evaluation dimension, sentiment polarity, sentiment intensity, and effective dimension mask, without using hash mapping to generate binary fingerprints. The Manhattan distance between the semantic fingerprint vector of the current comment and the historical semantic fingerprint vector library is calculated as a novelty measure. The degree of emotional contradiction is represented by the dispersion of polarized sentiment scores of the evaluation dimensions involved in the same comment, which is used as a conflict measure. The novelty measure and the conflict measure are multiplied to obtain the numerical semantic instability coefficient of each comment.
[0015] In an optional embodiment, constructing an aspect polarity multidimensional vector for the text comment data includes: The dependency parsing tree was used to extract the evaluation object entity words and the opinion modifier words that have dependency relationships with the entity words from the text comment data; The entity vocabulary of the evaluation object is converted into dimensional identifier values of dish features, service features, and environmental features using an attribute mapping vocabulary. The opinion modifiers are input into a sentiment tendency calculation network model trained with supervised labels, and one-dimensional positive and negative category feature values are output. The Euclidean norm of the second-to-last layer of features of the sentiment tendency calculation network model is extracted as the sentiment intensity value. The dimension identifier value, the one-dimensional positive and negative category feature value, and the emotion intensity value are concatenated to output the corresponding aspect polarity multidimensional vector.
[0016] In the text comment processing stage, the comment statements are parsed, and noun subjects or objects in the subject-verb-object structure are extracted as evaluation entity words, such as roast duck, serving speed, and hall decoration. Descriptive words modifying these entities are also extracted, such as "very crispy," "too slow," and "elegant." Using a pre-constructed attribute mapping vocabulary containing approximately 5,000 to 10,000 professional terms, these entity words are mapped to fixed dimensional identifier values. For example, a three-dimensional one-hot encoding format is used. If an entity matches the vocabulary, the dish feature is identified as a 100 vector, the service feature as a 010 vector, and the environment feature as a 001 vector. For out-of-vocabulary words, cosine similarity is calculated, with a preferred threshold of 0.85 for automatic classification. In terms of sentiment representation, a text classification network based on a convolutional structure is used as the sentiment bias calculation network model. This model is pre-trained under supervision using a corpus of at least 500,000 annotated entries from the catering industry. The sentiment analysis network model includes a word embedding layer, a convolutional feature extraction layer, a fully connected hidden layer, and a classification output layer. Opinion modifiers are used as input to the word embedding layer. After feature extraction by the convolutional feature extraction layer, they are input to the fully connected hidden layer. The classification output layer outputs one-dimensional positive and negative category feature values.
[0017] When the input opinion modifier is a word like "very crispy," the classification activation function of the last layer of the model outputs a binary classification result. This result is mapped to one-dimensional positive and negative category feature values, with positive values set to +1.0 and negative values set to -1.0. The activation vector matrix of the penultimate layer (the fully connected hidden layer with multi-dimensional features) is extracted. The Euclidean norm (norm 2) of this vector is calculated, and the result is normalized to the range of 0 to 10 using min-max normalization. This result is used as the sentiment intensity value; for example, after norm extraction and normalization, the intensity value is 8.5. The values of the above dimensions are concatenated into vectors in a fixed order. For example, if the evaluation of the dish is positive and the intensity is 8.5, the generated aspect polarity multi-dimensional vector will have a vector structure containing dish features, a positive label, and an intensity value. If a single review contains multiple evaluation entities, the aspect polarity multidimensional vectors corresponding to each entity are aggregated according to a fixed dimensional order of dish features, service features, and environment features, forming a single review-level semantic fingerprint vector. For evaluation dimensions not mentioned, only the effective dimension mask is recorded in the semantic fingerprint vector, and they are not used as valid samples for conflict measurement in standard deviation calculation. In this way, single entity-level features are transformed into single review-level features to support subsequent novelty and conflict measurement calculations.
[0018] In an optional embodiment, the calculation of a semantic instability coefficient for each comment based on the conflict and novelty measures of the semantic fingerprint elements includes: The standard deviation of the sequence formed by multiplying the emotional intensity values of each evaluation dimension in the semantic fingerprint of a single comment with the one-dimensional positive and negative category feature values is used as a measure of conflict. Extract historical semantic fingerprints within a preset time window before the current calculation time to construct a basic vector matrix library. Calculate the average Manhattan distance between the continuous numerical features of the single comment and the continuous numerical features of each historical vector in the basic vector matrix library, and use this distance as a novelty measure. Multiplying the conflict metric by the novelty metric yields the semantic instability coefficient of the single comment.
[0019] In the calculation process of the semantic instability coefficient, the inherent emotional conflict fluctuation of a single review is assessed through dispersion. The effective evaluation dimensions of a single review across the three dimensions of food, service, and environment are traversed. The emotional intensity value of each effective evaluation dimension is calculated as the product of the one-dimensional positive and negative category feature values, resulting in a polarized composite emotional score sequence for each dimension. Evaluation dimensions not mentioned in the review are simply marked as invalid in the effective dimension mask and do not participate in the standard deviation calculation of the composite emotional score sequence. When the number of effective evaluation dimensions is less than two, the conflict measure is set as a preset low-conflict benchmark value, which can be zero or a non-negative constant close to zero. The dispersion of this composite emotional score sequence is calculated using the sample standard deviation formula. First, the mean is calculated, then the sum of squares of the differences between each element and the mean is calculated, and the square root is taken with the number of effective evaluation dimensions minus one as the denominator to obtain the corresponding value. This result serves as the conflict measure representing the user's contradictory psychology in multidimensional evaluations.
[0020] To identify the degree of deviation of the current comment from collective cognition, a sliding time window with a duration of 15 to 30 days is constructed. At least one thousand historical semantic fingerprints accumulated within this window are extracted to build a basic vector matrix library. Both the historical and current comment semantic fingerprints are continuous numerical semantic fingerprint vectors, possessing the same evaluation dimension order, sentiment polarity field, sentiment intensity field, and effective dimension mask field. Continuous numerical features from the current comment's semantic fingerprint are extracted, and the Manhattan distance between these numerical features and each continuous feature of the historical vector in the matrix library is calculated. When calculating the Manhattan distance, the evaluation dimensions that are commonly valid for both the current and historical comments are prioritized; if the commonly valid dimensions are empty, the normalized vector distance on the union of the valid evaluation dimensions of the current comment and the corresponding historical comment is used as a substitute distance. The arithmetic mean of all accumulated Manhattan distances is calculated, and this value is set as the novelty measure. The conflict measure calculated above is multiplied by the novelty measure to obtain the semantic instability coefficient of the comment. This coefficient represents the systemic perturbation capability of a single interactive feedback, and serves as the initial weight input parameter for subsequent hypergraph edge weights. The changes in related indicators of the semantic instability coefficient are illustrated below. Figure 1 As shown. Figure 1 In this study, the discrete volatility scaling hierarchy, cognitive bias matrix features, and global evaluation instability ratio are used to characterize the normalized changes of conflict measure, novelty measure, and semantic instability coefficient, respectively.
[0021] The construction module is used to construct a food and beverage knowledge hypergraph based on the association mapping relationship. It sets dishes, text topics, and users as nodes, and uses a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight.
[0022] Initialize an empty hypergraph structure, traverse the association mapping form, and extract the independent user identification codes from the transaction log data as user nodes. Use the dish code from the transaction log details table as the unique identifier for the dish node, and write the dish name and product cascade identifier as alias fields or attribute fields for that dish node into the dish dictionary table. When the data source only provides the dish name or product cascade identifier, first map it to a unified dish code through the dish dictionary table, and then create or update the corresponding dish node. Perform topic clustering on the text review data to obtain text topic nodes, and inject the above three types of nodes into the empty hypergraph structure. For each single associated transaction log, create a hyperedge that simultaneously encloses the user node, dish node, and text topic node corresponding to that transaction. Assign the semantic instability coefficient corresponding to the text review associated with that single transaction to the weight attribute feature of the hyperedge, completing the construction of the weighted catering knowledge hypergraph.
[0023] In an optional embodiment, the step of constructing a catering knowledge hypergraph based on the association mapping relationship, setting dishes, text topics, and users as nodes, and using a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node, and assigning the semantic instability coefficient to the hyperedge as an initial weight, includes: Extract the user's unique identification code from the transaction log data and set it as the user node; Extract the dish code from the transaction details table and set it as the dish node; The hidden topic distribution of the text comment data is fitted, and the single keyword with the highest frequency is set as the text topic node. Create a hypergraph topology in the graph database, and declare the user nodes, dish nodes, and text topic nodes that have the same transaction association as an undirected hyperedge by forming a set of connections. Write the corresponding semantic instability coefficient as the hyperedge weight into the storage field of the undirected hyperedge.
[0024] In the node and topology network construction phase of the catering knowledge hypergraph, the transaction flow details table is parsed, and strings of 16 to 32 characters in length are extracted as unique user identifiers. User nodes belonging to user attribute tags are then set in the graph database. Simultaneously, dish codes from the details table are extracted and set as dish nodes belonging to dish tags. The dish code serves as the unified primary key for the dish nodes. Dish names and product cascade identifiers are no longer created as separate dish nodes, but are mapped to the same dish code through a dish dictionary table, avoiding duplicate modeling of the same dish due to differences in name, code, or cascade identifier. Hidden topic distribution fitting is performed on the associated text review dataset. The number of topics hyperparameters is set to a range of 10 to 50. After at least 500 Gibbs sampling iterations, the single core keyword with the highest word frequency in the topic vector space with the highest mapping probability for the current review is extracted, and this word is set as a text topic node belonging to the topic tag in the graph.
[0025] After setting up the three types of heterogeneous nodes, a hypergraph topology with high-order multi-dimensional features is constructed. For complete transaction records within the same business order serial number, the user node involved in the transaction, the multiple dish nodes covered by the actual order, and the extracted text topic node are aggregated and connected. An undirected hyperedge set model that can simultaneously contain all the above nodes is declared in the database. The semantic instability coefficient corresponding to the business review calculated and output by the pre-module is read, and the semantic instability coefficient is written as the initial weight into the weight storage field of the undirected hyperedge. By traversing the transaction log set, a knowledge hypergraph containing multi-dimensional entity associations and anomaly weights is constructed.
[0026] A slice paradigm is constructed that includes a semantic gravity center and temporal behavioral constraints, wherein the semantic gravity center is updated by the theme evolution trend of the previous cycle.
[0027] A slice paradigm class is constructed, defining semantic gravity center attributes and temporal behavior constraint attributes within the class. The semantic gravity center is represented as a cluster of virtual nodes carrying a baseline feature vector in the knowledge hypergraph space. During algorithm initialization, the semantic gravity center is assigned a static initial feature vector generated based on the frequency of globally high-frequency dishes and hot topics. At the end of each subsequent analysis cycle, the topic evolution trend feature vector generated in the previous analysis cycle is directly extracted and converted to the same standard dimension as the semantic gravity center through a linear mapping layer or a fully connected mapping layer. This vector is then weighted, fused, and normalized with the current semantic gravity center's baseline feature vector for updating. The temporal behavior constraint attribute is set as a time series filter function based on the timestamp field of transaction flows. It restricts the variance of transaction frequency within a specified sliding time window of the selected hyperedge set to be less than a preset stability threshold, and restricts the absolute value of the difference in transaction frequency between adjacent natural days after weekday and rest day periodic fluctuation correction to be less than a preset fluctuation threshold. This replaces the condition of forcibly limiting the transaction time interval to conform to a Poisson distribution.
[0028] In an optional embodiment, the construction of a slice paradigm comprising a semantic gravity center and temporal behavioral constraints, wherein the semantic gravity center is updated by the theme evolution trend of the previous cycle, includes: Configure upper and lower limit constraints for a preset time window to construct a sliding decision time window for the system. Extract the cumulative number of payment requests within the system's sliding judgment time window, and obtain the transaction frequency column by daily sampling and compression; Determine the absolute value of the difference in transaction frequency between adjacent natural days within the sliding judgment time limit window of the system after the periodic fluctuation correction of weekdays and rest days. If the absolute value of the difference of all single days is less than the preset fluctuation threshold, then this judgment condition is assigned to the time sequence behavior constraint. The theme evolution trend feature vector generated in the previous analysis period is extracted as the anchor data block, and the semantic gravity center is updated after dimension alignment mapping.
[0029] During the constraint triggering and parameter initialization process of the slice paradigm, the lower and upper limits of the observation window are set, and a fixed-width system sliding judgment time limit window is preferred. The total number of all transaction orders received and successfully responded to by the system within this window is counted. To filter out random oscillation noise in high-frequency time-sharing data, a downsampling compression operation is implemented at the daily granularity level, i.e., the scattered number of transactions is aggregated on a daily basis to generate a one-dimensional transaction frequency series. To establish a stable and reliable temporal behavior constraint state, the above series is filtered using a historical time series decomposition algorithm or a fixed holiday correction multiplier to reduce periodic passenger flow fluctuations between weekdays and rest days. After smoothing, the difference in transaction frequency between two adjacent natural days within the window is calculated sequentially, and the absolute value of the difference is taken to construct a deviation sequence. A preset fluctuation threshold is set based on the specific store size. Only when the values of all elements in the generated deviation sequence are less than this fluctuation threshold is the overall transaction flow determined to be in a convergent and stable period, and this determination condition is assigned to the temporal behavior constraint as an entry condition for initiating subsequent operations. The theme evolution trend feature vector output from the previous analysis period is extracted and constructed into a base point anchor data block. The base point anchor data block is input into the dimension alignment mapping layer and converted into a standard vector of the same length as the semantic gravity center reference feature vector. The standard vector is then updated with the semantic gravity center parameters used in the current period calculation.
[0030] The analysis module is used to iteratively calculate the probability of a dish node belonging to the semantic gravity center on the hypergraph using a feedback-enhanced community propagation algorithm, and use the probability to perform feedback modulation on the weight of the associated hyperedge to form a local resonant field. When the local resonant field converges and the associated transaction data of the nodes in the field satisfies the temporal behavior constraints, it is divided into target data slices.
[0031] Before inputting into the graph neural network, the food knowledge hypergraph is converted into a node-hyperedge bipartite graph representation, or an edge index and weight matrix for message passing is generated from the hypergraph association matrix, enabling higher-order relationships between user nodes, dish nodes, text topic nodes, and hyperedges to participate in feature aggregation. A graph neural network model is built on the hypergraph structure to execute a feedback-enhanced community propagation algorithm. In each iteration, the current weight of the associated hyperedge is used as the edge weight input in the message passing process. The similarity between the feature vector of the dish node and the baseline feature vector of the semantic gravity center is calculated, and this similarity is mapped to the interval 0 to 1 as the attribution probability. The product of this attribution probability and a non-negative feedback enhancement factor is used as the feedback modulation factor. The weight attribute features of the hyperedge to which the dish node belongs are adjusted, and the updated hyperedge weights are input again into the next round of graph neural network message passing, allowing the previous weight update to influence the node feature aggregation and attribution probability calculation in the next round. In this multi-round interaction process, nodes that frequently co-occur and have high similarity to the semantic gravity center form a highly clustered local resonant field of feature similarity due to the accumulation of weight feedback. To avoid unbounded amplification of values, the system normalizes the weights of associated hyperedges to a preset non-negative interval after each weight update, or truncates them according to a preset upper limit. Euclidean distance is used to monitor the average change in the probability of all nodes belonging to their local resonant field between two consecutive iterations. When this average change is less than 1× The local resonant field is considered to have reached convergence. The timestamp distribution of transaction flows associated with nodes within the local resonant field is examined. If the transaction frequency variance and the difference in transaction frequency between adjacent natural days (corrected for periodic fluctuations) both satisfy the constraints of the time-series behavior, then all nodes and associated hyperedge data within the envelope of the local resonant field are marked and copied and stored as independent target data slices according to the node index and hyperedge index corresponding to the local resonant field. The change in the convergence probability of candidate nodes in the local resonant field is illustrated as follows: Figure 2 As shown. Figure 2 In the context of the community, local resonance candidate points correspond to local resonance field candidate nodes. Their upper limit, median, and standard benchmark values are used to represent the changes in the mapping alignment convergence probability of different candidate nodes during the message passing iteration process.
[0032] In an optional embodiment, the step of employing a feedback-enhanced community propagation algorithm on the hypergraph to iteratively calculate the probability of a dish node belonging to the semantic gravity center, and using the probability to perform feedback modulation on the weights of associated hyperedges to form a local resonant field, includes: In each iteration, the graph neural network is used to extract the feature vector of the dish node by using the current weight of the associated hyperedge as the edge weight input for message passing. After spatial alignment mapping of the feature vector with the feature vector of the semantic gravity center, the high-dimensional cosine similarity between the mapped feature vectors is calculated, and the high-dimensional cosine similarity is normalized to the interval of 0 to 1 as the belonging probability. The feedback increment parameter is obtained by multiplying the preset non-negative feedback enhancement factor by the attribution probability; The current weight of the associated superedge is added to the feedback increment parameter to obtain the corrected and updated weight of the associated superedge, and the corrected and updated weight of the associated superedge is normalized to a preset non-negative range or truncated according to a preset upper limit. The processed associated hyperedge weights are used as the edge weight inputs for the next iteration of the graph neural network message passing, and the feature vectors of the dish nodes are re-extracted and the attribution probability is recalculated. Calculate the absolute value of the difference between the belonging probabilities of two consecutive iterations. If the absolute value of the difference is less than a preset convergence threshold, stop the iteration and encapsulate the dish nodes with belonging probabilities higher than the preset belonging threshold and their associated user nodes, text topic nodes and hyperedge sets into the corresponding local resonant fields.
[0033] Within the hypergraph, a graph neural network is deployed for node feature calculation and associated weight iteration. This network comprises a message passing layer, a node state update layer, and an output embedding layer. It takes the hypergraph's adjacency matrix, the initial node feature matrix, and the current weight matrix of associated hyperedges as input. The message passing layer aggregates neighbor node information, the node state update layer updates the node representation, and the output embedding layer outputs the extracted feature vector of the dish node. In the message passing layer, the current weight of the associated hyperedges is used to adjust the message aggregation strength between connected nodes, ensuring that hyperedges with higher weights contribute more to node feature updates, thus forming a closed-loop feedback relationship between weight updates and attribution probability calculation.
[0034] After extracting the hidden layer representation of the target dish node, given that the extracted node vector may be inconsistent with the previously generated semantic gravity center in dimensional space, a multilayer perceptron containing fully connected layers is used for dimensional space alignment mapping transformation, uniformly converting it into a standard-dimensional feature vector. After alignment, the dot product of the two feature vectors is performed, divided by the product of their respective L2 norms, to calculate the high-dimensional cosine similarity between them. To construct a reasonable probability distribution interval, this cosine similarity is normalized to a closed interval of 0.0 to 1.0, and this output value serves as the probability of the target dish node moving towards the gravity center. After completing the forward probability mapping, a feedback modulation operation is performed. A preset non-negative feedback enhancement factor is read, and its value range is preferably constrained to a non-negative decimal range to control the weight enhancement amplitude and avoid excessive community expansion. The calculated belonging probability is multiplied by the non-negative feedback enhancement factor to obtain the feedback increment parameter. The system locates all associated hyperedges connecting the target dish node, extracts the weight values of these hyperedges from the previous round or the initial state, adds these weight values to the feedback increment parameter, and calculates the corrected and updated associated hyperedge weight values. The corrected and updated associated hyperedge weight values are normalized to a preset non-negative interval or truncated according to a preset upper limit and written back to the hypergraph weight matrix, serving as the edge weight input for the message passing layer in the next iteration. In the next iteration, the graph neural network re-aggregates the node neighborhood features based on the updated weights and recalculates the feature vector and belonging probability of the dish node. This calculation is iterated repeatedly. At the end of each round, the absolute value of the difference in belonging probability between the same node in two consecutive iterations is taken. When the system detects that the absolute value of this difference is less than the convergence threshold within a preset number of consecutive rounds, the iterative calculation for that local range is stopped. At this point, the group of dish nodes that have reached convergence, along with their associated hyperedges and corresponding user nodes and topic nodes, are encapsulated into a corresponding local resonant field for further processing.
[0035] Calculate the sales contribution of dishes and the theme evolution trend within the target data slice, and generate analysis results.
[0036] For each extracted independent target data slice, the total sales amount of the associated transaction data for each dish node within the slice is calculated. Using the total sales amount of all dish nodes within the target data slice as the denominator, the sales contribution value of each dish node within the current target data slice is calculated. Simultaneously, time series fields and text theme node information contained within the target data slice are extracted. The proportion distribution of each theme over a continuous time step is calculated, and the first-order difference is performed on the time series of this proportion distribution to generate a continuous theme evolution trend sequence. The descending sorting results of the dish-related sales contribution and the theme evolution trend sequence are plotted as a multi-dimensional visualization data dashboard chart as the analysis result. The generated theme evolution trend sequence is passed back to the slice paradigm class as a feedback parameter. After being converted to the same dimension as the semantic gravity center's baseline feature vector through a dimension alignment mapping layer, it is linearly weighted, fused, and normalized with the current baseline feature vector of the semantic gravity center to complete the feedback iterative update operation for the next cycle's semantic gravity center baseline feature vector.
[0037] In an optional embodiment, the calculation of the sales contribution of dishes associated with the target data slice and the generation of analysis results includes: The total sum of the actual transaction amounts of all dishes in the associated order details table within the local resonant field is obtained by summing up the total amount of the goods. Calculate the ratio of the actual transaction amount of each dish at each dish node to the total amount of the summarized goods, and establish it as the contribution of the dish to related sales. Calculate the proportion distribution of each text topic within the sliding time window, calculate the first difference of the distribution time series, and obtain the difference array vector representing the increasing or decreasing trend, which is labeled as the topic evolution trend; The data on the sales contribution of the dishes and the evolution trend of the theme are assembled, and the analysis results are generated and output by parsing the template combination and layout.
[0038] In the commercial value representation and result presentation stage of the target data slice, the dish nodes contained in the local resonance field are mapped to the historical order details table. For the matched payment records, the actual transaction amount field is accumulated according to the dish code to obtain the total sum of goods amount parameter. The total sum of goods amount is the sum of the actual transaction amounts of all dishes corresponding to all dish nodes in the current target data slice. Based on this benchmark parameter, the ratio of the actual transaction amount of each dish node to the total sum of goods amount is calculated one by one. These ratios are established as the dish-related sales contribution, used to represent the revenue weight of a single dish in the current semantic feature domain. While calculating sales indicators, the text dimension data is processed for temporal representation. The frequency of each text topic covered in the local resonance field is tracked every day within a preset sliding time window, and the frequency of each word is divided by the total number of global topic words for that day to construct a time series of proportion distribution arranged in ascending order of time axis. A first-order difference operation is performed on this series, that is, the data of the previous day is subtracted from the data of the current day to generate a difference array vector containing the slope direction and the step size of change. The difference array vector is labeled as a feature parameter representing the direction of topic popularity change, i.e., the topic evolution trend. The generated data on the sales contribution of related dishes and the topic evolution trend are injected into a preset analysis template, combined and formatted to generate an analysis result report document, and the latest calculated topic evolution trend is used to update the gravity center for the next cycle.
[0039] In a second embodiment, the present invention also provides a knowledge graph-based method for analyzing catering data, comprising the following steps: Acquire catering business data, which includes text review data and transaction flow data, and establish an association mapping relationship between the transaction flow data and the text review data; for the text review data, construct an aspect polarity multidimensional vector, jointly encode the evaluation aspect with sentiment polarity and intensity value to generate a semantic fingerprint, and calculate the semantic instability coefficient for each review based on the conflict and novelty measures of the semantic fingerprint elements; Based on the association mapping relationship, a catering knowledge hypergraph is constructed, with dishes, text topics, and users set as nodes, and a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight. A slicing paradigm containing a semantic gravity center and temporal behavior constraints is constructed, with the semantic gravity center updated by the theme evolution trend of the previous cycle. A feedback-enhanced community propagation algorithm is used on the hypergraph to iteratively calculate the probability of a dish node belonging to the semantic gravity center, and the probability is used to modulate the weight of the associated hyperedge to form a local resonant field. When the local resonant field converges and the transaction data associated with the nodes in the field meets the temporal behavior constraints, it is divided into target data slices. The sales contribution of dishes associated with the target data slices and the theme evolution trend are calculated to generate analysis results.
[0040] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A knowledge graph-based catering data analysis system, characterized in that, Includes the following modules: The calculation module is used to acquire catering business data, which includes text review data and transaction flow data, and to establish an association mapping relationship between the transaction flow data and the text review data. For the text comment data, an aspect polarity multidimensional vector is constructed, and the evaluation aspect, sentiment polarity and intensity value are jointly encoded to generate a semantic fingerprint. Based on the conflict and novelty measures of the semantic fingerprint elements, a semantic instability coefficient is calculated for each comment. The construction module is used to construct a food and beverage knowledge hypergraph based on the association mapping relationship. It sets dishes, text topics, and users as nodes, and uses a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight. Construct a slicing paradigm that includes a semantic gravity center and temporal behavioral constraints, wherein the semantic gravity center is updated by the theme evolution trend of the previous cycle; The analysis module is used to iteratively calculate the probability of a dish node belonging to the semantic gravity center on the hypergraph using a feedback-enhanced community propagation algorithm, and use the probability to perform feedback modulation on the weight of the associated hyperedge to form a local resonant field. When the local resonant field converges and the associated transaction data of the nodes in the field satisfies the temporal behavior constraints, it is divided into target data slices. Calculate the sales contribution of dishes and the theme evolution trend within the target data slice, and generate analysis results.
2. The system according to claim 1, characterized in that, The construction of an aspect polarity multidimensional vector from the text comment data includes: The dependency parsing tree was used to extract the evaluation object entity words and the opinion modifier words that have dependency relationships with the entity words from the text comment data; The entity vocabulary of the evaluation object is converted into dimensional identifier values of dish features, service features, and environmental features using an attribute mapping vocabulary. The opinion modifiers are input into a sentiment tendency calculation network model trained with supervised labels, and one-dimensional positive and negative category feature values are output. The Euclidean norm of the second-to-last layer of features of the sentiment tendency calculation network model is extracted as the sentiment intensity value. The dimension identifier value, the one-dimensional positive and negative category feature value, and the emotion intensity value are concatenated to output the corresponding aspect polarity multidimensional vector.
3. The system according to claim 2, characterized in that, The conflict and novelty measures based on the semantic fingerprint elements calculate a semantic instability coefficient for each comment, including: The standard deviation of the sequence formed by multiplying the emotional intensity values of each evaluation dimension in the semantic fingerprint of a single comment with the one-dimensional positive and negative category feature values is used as a measure of conflict. Extract historical semantic fingerprints within a preset time window before the current calculation time to construct a basic vector matrix library. Calculate the average Manhattan distance between the continuous numerical features of the single comment and the continuous numerical features of each historical vector in the basic vector matrix library, and use this distance as a novelty measure. Multiplying the conflict metric by the novelty metric yields the semantic instability coefficient of the single comment.
4. The system according to claim 1, characterized in that, The process involves constructing a food and beverage knowledge hypergraph based on association mapping relationships. Dishes, text topics, and users are designated as nodes, and a single transaction is used as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned as the initial weight to the hyperedge, including: Extract the user's unique identification code from the transaction log data and set it as the user node; Extract the dish code from the transaction details table and set it as the dish node; The hidden topic distribution of the text comment data is fitted, and the single keyword with the highest frequency is set as the text topic node. Create a hypergraph topology in the graph database, and declare the user nodes, dish nodes, and text topic nodes that have the same transaction association as an undirected hyperedge by forming a set of connections. Write the corresponding semantic instability coefficient as the hyperedge weight into the storage field of the undirected hyperedge.
5. The system according to claim 1 or 4, characterized in that, The construction of the slice paradigm includes a semantic gravity center and temporal behavioral constraints. The semantic gravity center is updated by the theme evolution trend of the previous cycle, including: Configure upper and lower limit constraints for a preset time window to construct a sliding decision time window for the system. Extract the cumulative number of payment requests within the system's sliding judgment time window, and obtain the transaction frequency column by daily sampling and compression; Determine the absolute value of the difference in transaction frequency between adjacent natural days within the sliding judgment time limit window of the system after the periodic fluctuation correction of weekdays and rest days. If the absolute value of the difference of all single days is less than the preset fluctuation threshold, then this judgment condition is assigned to the time sequence behavior constraint. The theme evolution trend feature vector generated in the previous analysis period is extracted as the anchor data block, and the semantic gravity center is updated after dimension alignment mapping.
6. The system according to claim 1, characterized in that, The process involves employing a feedback-enhanced community propagation algorithm on the hypergraph to iteratively calculate the probability of a dish node belonging to the semantic gravity center, and using the probability to modulate the weights of associated hyperedges to form a local resonant field, including: In each iteration, the graph neural network is used to extract the feature vector of the dish node by using the current weight of the associated hyperedge as the edge weight input for message passing. After spatial alignment mapping of the feature vector with the feature vector of the semantic gravity center, the high-dimensional cosine similarity between the mapped feature vectors is calculated, and the high-dimensional cosine similarity is normalized to the interval of 0 to 1 as the belonging probability. The feedback increment parameter is obtained by multiplying the preset non-negative feedback enhancement factor by the attribution probability; The current weight of the associated superedge is added to the feedback increment parameter to obtain the corrected and updated weight of the associated superedge, and the corrected and updated weight of the associated superedge is normalized to a preset non-negative range or truncated according to a preset upper limit. The processed associated hyperedge weights are used as the edge weight inputs for the next iteration of the graph neural network message passing, and the feature vectors of the dish nodes are re-extracted and the attribution probability is recalculated. Calculate the absolute value of the difference between the belonging probabilities of two consecutive iterations. If the absolute value of the difference is less than a preset convergence threshold, stop the iteration and encapsulate the dish nodes with belonging probabilities higher than the preset belonging threshold and their associated user nodes, text topic nodes and hyperedge sets into the corresponding local resonant fields.
7. The system according to claim 1, characterized in that, The calculation of the sales contribution of dishes and thematic evolution trends within the target data slice to generate analysis results includes: The total sum of the actual transaction amounts of all dishes in the associated order details table within the local resonant field is obtained by summing up the total amount of the goods. Calculate the ratio of the actual transaction amount of each dish at each dish node to the total amount of the summarized goods, and establish it as the contribution of the dish to related sales. Calculate the proportion distribution of each text topic within the sliding time window, calculate the first difference of the distribution time series, and obtain the difference array vector representing the increasing or decreasing trend, which is labeled as the topic evolution trend; The data on the sales contribution of the dishes and the evolution trend of the theme are assembled, and the analysis results are generated and output by parsing the template combination and layout.
8. A knowledge graph-based method for analyzing restaurant data, characterized in that, Includes the following steps: Acquire catering business data, which includes text review data and transaction data, and establish an association mapping relationship between the transaction data and the text review data; For the text comment data, an aspect polarity multidimensional vector is constructed, and the evaluation aspect, sentiment polarity and intensity value are jointly encoded to generate a semantic fingerprint. Based on the conflict and novelty measures of the semantic fingerprint elements, a semantic instability coefficient is calculated for each comment. Based on the association mapping relationship, a catering knowledge hypergraph is constructed, with dishes, text topics, and users set as nodes, and a single transaction as a hyperedge connecting the corresponding user node, dish node, and text topic node. The semantic instability coefficient is assigned to the hyperedge as the initial weight. A slicing paradigm containing a semantic gravity center and temporal behavior constraints is constructed, with the semantic gravity center updated by the theme evolution trend of the previous cycle. A feedback-enhanced community propagation algorithm is used on the hypergraph to iteratively calculate the probability of a dish node belonging to the semantic gravity center, and the probability is used to modulate the weight of the associated hyperedge to form a local resonant field. When the local resonant field converges and the associated transaction data of the nodes in the field satisfies the temporal behavior constraint, it is divided into target data slices. Calculate the sales contribution of dishes and the theme evolution trend within the target data slice, and generate analysis results.
9. The method according to claim 8, characterized in that, The construction of an aspect polarity multidimensional vector from the text comment data includes: The dependency parsing tree was used to extract the evaluation object entity words and the opinion modifier words that have dependency relationships with the entity words from the text comment data; The entity vocabulary of the evaluation object is converted into dimensional identifier values of dish features, service features, and environmental features using an attribute mapping vocabulary. The opinion modifiers are input into a sentiment tendency calculation network model trained with supervised labels, and one-dimensional positive and negative category feature values are output. The Euclidean norm of the second-to-last layer of features of the sentiment tendency calculation network model is extracted as the sentiment intensity value. The dimension identifier value, the one-dimensional positive and negative category feature value, and the emotion intensity value are concatenated to output the corresponding aspect polarity multidimensional vector.
10. The method according to claim 9, characterized in that, The conflict and novelty measures based on the semantic fingerprint elements calculate a semantic instability coefficient for each comment, including: The standard deviation of the sequence formed by multiplying the emotional intensity values of each evaluation dimension in the semantic fingerprint of a single comment with the one-dimensional positive and negative category feature values is used as a measure of conflict. Extract historical semantic fingerprints within a preset time window before the current calculation time to construct a basic vector matrix library. Calculate the average Manhattan distance between the continuous numerical features of the single comment and the continuous numerical features of each historical vector in the basic vector matrix library, and use this distance as a novelty measure. Multiplying the conflict metric by the novelty metric yields the semantic instability coefficient of the single comment.