A method and system for clustering agricultural product information applied to fusion information
By learning and clustering the structured, behavioral and supply and demand data of agricultural products, and generating multi-view feature representations, the problem of inaccurate supply and demand assessment in traditional methods is solved, and a more refined and comprehensive agricultural product portrait and personalized recommendation are achieved.
Patent Information
- Application Number
- CN202411200931.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-08-29
AI Technical Summary
Traditional agricultural product supply and demand assessment methods are difficult to fully explore the value of multi-dimensional attributes, sales behaviors and supply and demand relationships, resulting in low accuracy of supply and demand assessment and recommendation, and failing to fully characterize the characteristics of agricultural products and consider the differences in purchasing groups.
A method of agricultural product information clustering that integrates structured attribute data, sales behavior data and supply and demand network data is proposed. Feature learning is performed through autoencoder, LDA theme model, Word2Vec and graph convolution network, combining multi-view feature representation and clustering The algorithm generates supply and demand clusters and calculates membership scores to improve the accuracy of supply and demand scores.
Through multi-dimensional clustering and feature fusion, the diversity and differences of agricultural products are captured, the accuracy of supply and demand assessment is improved, and personalized supply and demand relationship matching services are provided, which is in line with the current precise marketing trend.
Smart Images

Figure CN118690218B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an agricultural product information clustering method and system for fusion information. Background Art
[0002] With the rapid development of information technology, all kinds of information are growing explosively. In the marketing and customer management of agricultural product enterprises, it is often necessary to process a large amount of information from different agricultural product marketing channels, such as customer information, agricultural product sales information, agricultural product market feedback, etc. This information is usually called fused information, which has the characteristics of large data volume, diverse types, and scattered sources. How to effectively manage and utilize fused information and tap its value is an important issue facing enterprises.
[0003] A Chinese patent with publication number CN109544248A discloses a method for mining sales leads based on Internet information, including: determining which factors will affect the number of leads to be mined: insufficient source channels for leads, only traditional channels for obtaining leads, such as websites, telephones, and mailings; the marketing team does not consider the methods and scenarios for obtaining leads when designing marketing strategies; how to obtain more sales leads: in-depth research on the characteristics of target customers of products, multi-dimensional analysis of target customers, and finding places and scenarios where target customers may appear; obtaining leads through multiple channels, not relying on a certain source of leads, and making more attempts; how to determine high-quality leads: the contacts in the leads are interested in the product or have a clear intention to buy; the contacts in the leads have the decision-making power to purchase the product; the data dimensions contained in the leads help sales staff to follow up and convert; how to improve the quality of sales leads: data-based evaluation of the quality of leads from different sources; starting from the standards of high-quality leads, when obtaining leads, the data dimensions of high-quality leads and more appropriate scenarios for obtaining leads are introduced.
[0004] Traditional agricultural product supply and demand assessment methods have limitations in the integration of multi-source heterogeneous information of agricultural products. It is difficult to fully tap the value of integrated information such as the multi-dimensional attributes of agricultural products, sales behavior, supply and demand relationships, etc., fails to comprehensively characterize the characteristics of agricultural products, and fails to fully consider the differences between different agricultural product purchasing groups, resulting in low accuracy in agricultural product supply and demand assessment and recommendations. Summary of the invention
[0005] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one purpose of the present application is to propose an agricultural product information clustering method and system for fusion information, which improves the accuracy and personalization of agricultural product supply and demand information recommendation.
[0006] One aspect of the present application provides an agricultural product information clustering method applied to fusion information, comprising:
[0007] Step S100: Collecting structured attribute data, sales behavior data, and supply and demand network data of agricultural products to form an original data set D;
[0008] The specific method of collecting the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D is:
[0009] Step S110: Collecting structured attribute data of agricultural products from the agricultural product information management database , including: agricultural product category attributes, agricultural product value attributes, among which, Represents the quantity of structured attribute data; Indicates Structured attribute data;
[0010] Step S120: Collecting sales behavior data of agricultural products from e-commerce platforms , including: browsing history, purchase history, search history, among which, Indicates the quantity of sales behavior data; Indicates Sales behavior data;
[0011] Step S130: Collecting supply and demand network data of agricultural products from the supply and demand media platform , including: supply information, demand information, transaction data, among which, Represents the quantity of supply and demand network data; Indicates Supply and demand network data;
[0012] Step S140: Structured attribute data , sales behavior data and supply and demand network data Preprocessing to obtain the original data set ;
[0013] Step S200: performing feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features and perform feature fusion to obtain a multi-view feature representation of agricultural products;
[0014] The specific method of performing feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features and performing feature fusion to obtain multi-view feature representation of agricultural products is:
[0015] Step S210: Use the autoencoder to perform feature learning on the structured attribute data to extract attribute features ;
[0016] The autoencoder is used to perform feature learning on structured attribute data to extract attribute features. The specific method is:
[0017] Step S211: construct an autoencoder, wherein the autoencoder includes an encoder and a decoder;
[0018] Step S212: using the structured attribute data to train the autoencoder, using reconstruction loss and regularization loss as loss functions for training the autoencoder, minimizing the loss function as a training goal, and optimizing the weight matrix and bias vector of the autoencoder;
[0019] The optimization goal of the autoencoder is: ,in, For input data With output data The reconstruction loss between is the regularization term, λ is the regularization coefficient, Indicates minimization of the weight matrix W and the bias vector b;
[0020] Step S213: When the weight matrix W and the bias vector b reach the minimum value, the trained autoencoder is obtained, the encoder part is extracted, and the structured attribute data is forward propagated to obtain the attribute feature ;
[0021] Step S220: Use LDA topic model and Word2Vec to perform feature learning on sales behavior data to obtain behavior features , the behavioral characteristics include subject behavioral characteristics and word embedding behavior features ;
[0022] The LDA topic model is a generative probabilistic model used to discover potential topics in a document collection.
[0023] The Word2Vec is a model for word vector representation, which maps words to a vector space through a neural network so that words with similar semantics are close to each other in the vector space.
[0024] The LDA topic model and Word2Vec are used to learn the characteristics of the sales behavior data respectively to obtain the behavior characteristics. , the behavioral characteristics include subject behavioral characteristics and word embedding behavior features The specific method is:
[0025] Use the LDA topic model to learn the features of sales behavior data, and perform probability distribution statistics on the keywords of each topic in the purchase records in the sales behavior data to obtain the topic behavior features. ;
[0026] The formula of the LDA topic model is: ,in, Indicates that the keyword is observed in the purchase record d of the sales behavior data The probability of is the kth topic of the purchase record, K represents the total number of topics; k≤K;
[0027] Maximizing the co-occurrence frequency of the central word and background words in the sales behavior data, and minimizing the co-occurrence frequency of the central word and negative sample words are used as the objective function of training Word2Vec to obtain Word2Vec;
[0028] The objective function of Word2Vec is:
[0029] ;
[0030] in, represents maximizing the co-occurrence frequency of the central word and background word in the sales behavior data, represents minimizing the co-occurrence frequency of the central word and the negative sample word, represents the transpose of the vector embedding of the central word wo, represents the vector embedding of the background word wI, represents the negative sampling word, k' represents the number of negative sampling, It means to average the loss of k' negative sampled words; Indicates sub-negative sampling; ≤k';
[0031] Use Word2Vec to learn the features of sales behavior data, obtain the embedding vector of each keyword, and concatenate the embedding vectors to obtain the word embedding behavior features. ;
[0032] Step S230: Use graph convolutional networks to learn the characteristics of supply and demand network data to obtain supply and demand characteristics ;
[0033] The training process of the graph convolutional network is as follows: each agricultural product in the supply and demand network data is regarded as an agricultural product node, a node set V is created, the supply and demand relationship between agricultural products is used as an edge, the weight of the edge is set according to the strength of the supply and demand relationship, and an edge set is constructed. , we get the agricultural product supply and demand network diagram ;
[0034] Extract node features of agricultural products for each agricultural product node, wherein the node features include: supply, demand, and price fluctuations of agricultural products, represent each node feature as a vector, and construct a node feature matrix;
[0035] Construct an adjacency matrix A based on the edge set, where the value of the element in matrix A is the weight of edge (i, j) ; i and j represent agricultural product node i and agricultural product node j respectively;
[0036] Initialize the number of layers L of the graph convolutional network and the weight matrix of each layer , the node feature matrix As the initial node representation ;
[0037] For each layer l, l∈[1,L], its adjacency matrix is normalized to obtain ;
[0038] According to the node representation of the previous layer , weight matrix and the normalized adjacency matrix , the node representation of the next layer is obtained through the activation function , the calculation formula is: , get the node representation of the last layer As the supply and demand characteristics of the node; is the activation function;
[0039] Use the cross entropy loss function as the loss function for training the graph convolutional network, use the back propagation algorithm and optimizer to minimize the loss function, and when the loss function reaches the minimum value, the training is completed and the trained graph convolutional network is obtained;
[0040] Step S240: Fusing the learned attribute features, behavior features, and supply and demand features to obtain a multi-view feature representation E of agricultural products;
[0041] The agricultural product multi-view feature representation , is the sub-feature of the multi-view feature representation of agricultural products. ;
[0042] Step S300: Using clustering algorithm to classify agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters;
[0043] The clustering algorithm is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into The specific method of a supply and demand cluster is:
[0044] The agricultural products are divided into The specific method of attribute cluster is:
[0045] Step S311: Randomly determine Cluster centers are calculated. For each agricultural product, it is regarded as a sample point. The cluster center closest to the sample point is calculated and the sample point is assigned to the corresponding cluster center. Each cluster center and its sample point form a cluster.
[0046] Step S312: for each cluster, recalculate its cluster center, and use the average value of the sample points in the cluster as the new cluster center;
[0047] Step S313: Re-divide each sample point into the cluster closest to the cluster center until the clustering result no longer changes, and obtain Attribute clusters of agricultural products clustered based on attribute characteristics;
[0048] The agricultural products are divided into The specific method of a behavior cluster is:
[0049] Step S321: The topic distribution of the purchase records in the sales behavior data is obtained by learning the trained LDA topic model. The K-means clustering algorithm is used to classify agricultural products according to the characteristics of the topic behavior. Thematic behavior clusters;
[0050] Step S322: Based on word embedding behavior features , using K-means clustering algorithm to classify agricultural products based on behavior patterns, we get Each word is embedded in a behavior cluster;
[0051] The agricultural products are divided into The specific method of a supply and demand cluster is:
[0052] Step S331: Set each agricultural product node as a community, then the number of initial communities is the number of node sets V, and calculate the total edge weight in the agricultural product supply and demand network graph as , It represents the sum of the strength of supply and demand relationships in the agricultural product supply and demand network diagram;
[0053] Step S332: for each agricultural product node i, traverse all its neighboring agricultural product nodes j, and calculate the change in modularity Q when the agricultural product node i is assigned to the community where the neighboring agricultural product node j is located;
[0054] The calculation formula of the modularity Q is: ,in, , is the sum of the edge weights connected to agricultural product node i and agricultural product node j, Refers to whether the communities to which agricultural product i and agricultural product j belong are the same. If they are the same, is 1, otherwise it is 0;
[0055] Step S333: Calculate the modularity of each agricultural product node assigned to each community, obtain the community corresponding to the maximum modularity improvement, and assign the agricultural product node to the community until the result of the agricultural product node assigned by the community no longer changes;
[0056] Step S334: Treat each community as a community node, build a community network, and The edge weight between them is set as the sum of the edge weights between each original community, and the self-loop edge weight of the community node is the sum of the edge weights within each original community;
[0057] Step S335: Obtain community division results based on the community network, where each community represents a supply and demand cluster divided according to the supply and demand characteristics of agricultural products;
[0058] Step S400: construct a group portrait for each cluster using attribute clusters, behavior clusters, and supply and demand clusters, obtain agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score;
[0059] The method of constructing a group portrait for each cluster by using attribute clusters, behavior clusters and supply and demand clusters, obtaining agricultural product information of the current agricultural products in real time, calculating the membership scores between the agricultural products and each cluster, and calculating the supply and demand scores of the agricultural products according to the membership scores is as follows:
[0060] Step S410: Number the attribute clusters, behavior clusters, and supply and demand clusters. For the rj-th feature of the ri-th cluster, calculate the mean and standard deviation of all agricultural products in the cluster on this feature to obtain the group portrait of the ri-th cluster. , Represents the mean of the rJth feature of the rith cluster and standard deviation , rJ represents the total number of features, rj∈{1,2,...,rJ}; the features refer to the attribute features, behavior features, and supply and demand features corresponding to the attribute cluster, behavior cluster, and supply and demand cluster, respectively;
[0061] Step S420: Calculate the distance between the agricultural product and each group portrait, and convert the distance into a membership score;
[0062] The calculation formula of the membership score is: , where vi represents agricultural product vi, represents the distance between the agricultural product vi and the group portrait of the ri-th cluster, and γ is the control parameter; represents the membership score of agricultural product vi;
[0063] Step S430: Calculate the supply and demand score of the agricultural product according to the membership scores between the agricultural product and each cluster;
[0064] The supply and demand score is calculated as follows: ,in represents the weight coefficient of the ri-th cluster, represents the maximum membership score of agricultural product vi among all clusters;
[0065] Step S500: Select the product most similar to the agricultural product according to its membership score. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information;
[0066] According to the membership score of the agricultural product, the most similar agricultural product is selected. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the The specific method of obtaining supply and demand information is as follows:
[0067] Step S510: Calculate the membership scores of agricultural products and each cluster, sort each cluster in descending order according to the membership scores, and select the top The clusters are used as candidate supply and demand sets for the agricultural product;
[0068] Step S520: Select clusters from the candidate supply and demand set in sequence according to the sequence of sorted clusters, and generate the characteristics of the agricultural product according to the characteristics of the clusters. Supply and demand information.
[0069] One aspect of the present application provides an agricultural product information clustering system for fusion information, including:
[0070] The data set construction module is used to collect the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D;
[0071] The feature fusion module is used to learn the features of the structured attribute data, sales behavior data and supply and demand network data of agricultural products, obtain attribute features, behavior features and supply and demand features, and perform feature fusion to obtain multi-view feature representation of agricultural products;
[0072] The clustering module is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters;
[0073] The supply and demand score calculation module is used to use attribute clusters, behavior clusters and supply and demand clusters to build a group portrait for each cluster, obtain the agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score;
[0074] The personalized recommendation module is used to select the agricultural products that are most similar to the agricultural products according to their membership scores. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information.
[0075] One aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a method for clustering agricultural product information applied to fused information are implemented.
[0076] One aspect of the present application provides a readable storage medium storing a computer program suitable for loading by a processor to execute steps in a method for clustering agricultural product information applied to fused information.
[0077] Compared with the prior art, the agricultural product information clustering method and system proposed in this application for fusion information have the following advantages:
[0078] This application considers multiple data sources such as structured attribute data, sales behavior data, and supply and demand network data, and proposes corresponding preprocessing and feature learning methods for different data types, such as autoencoders, LDA, Word2Vec, and GCN. This multi-source data fusion idea helps to comprehensively characterize the characteristics of agricultural products and improve the accuracy of supply and demand assessment.
[0079] When clustering agricultural products, this application adopts the idea of multi-dimensional clustering, clustering them separately in different feature subspaces, and then fusing the clustering results of different dimensions. This multi-granularity and multi-angle clustering method can capture the diversity and differences of agricultural products and obtain a more detailed and comprehensive portrait of agricultural products.
[0080] When constructing group portraits, this application not only considers the cluster center, but also introduces the standard deviation information of the cluster, characterizing the group characteristics from the two levels of mean and dispersion. When scoring supply and demand, a method for calculating membership scores is proposed to quantify the relative matching degree of agricultural products to different clusters. These fine-grained modeling helps to explore the hidden supply and demand relationship of agricultural products and improve the accuracy of supply and demand matching.
[0081] This application embodies the idea of personalization from multiple levels such as data, algorithms, and strategies. It strives to explore the differentiated characteristics and supply and demand relationships of agricultural products from both the group and individual levels, and provide customized agricultural product supply and demand matching services. This personalized concept is highly consistent with the current trend of precision marketing of agricultural products. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 A method flow chart of a method for clustering agricultural product information applied to fusion information provided in this application;
[0083] Figure 2 A functional module diagram of an agricultural product information clustering system for fusion information provided in this application;
[0084] Figure 3 A schematic diagram of the structure of an electronic device provided in this application;
[0085] Figure 4 It is a schematic diagram of the structure of a readable storage medium provided by this application. DETAILED DESCRIPTION
[0086] In order to better understand the present application, various aspects of the present application will be described in more detail with reference to the accompanying drawings. It should be understood that these detailed descriptions are only descriptions of exemplary embodiments of the present application and do not limit the scope of the present application in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.
[0087] In the accompanying drawings, the size, dimensions and shapes of the elements have been slightly adjusted for ease of illustration. The drawings are for illustration only and are not strictly drawn to scale. As used herein, the terms "substantially", "approximately" and similar terms are used as terms of approximation, not as terms of degree, and are intended to illustrate the inherent deviations in measurements or calculations that will be recognized by those of ordinary skill in the art. In addition, in this application, the order in which the steps are described does not necessarily represent the order in which these processes occur in actual operation, unless otherwise specified or can be derived from the context.
[0088] It should also be understood that expressions such as "including", "comprising", "having", "containing" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features rather than just the individual elements in the list. In addition, when describing embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.
[0089] Unless otherwise defined, all words (including engineering terms and scientific and technological terms) used in this article have the same meaning as those commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that unless there is a clear explanation in this application, words defined in commonly used dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.
[0090] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0091] Example 1
[0092] like Figure 1 As shown, a method for clustering agricultural product information applied to fusion information provided by the present application includes:
[0093] Step S100: Collecting structured attribute data, sales behavior data, and supply and demand network data of agricultural products to form an original data set D;
[0094] The specific method of collecting the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D is:
[0095] Step S110: Collecting structured attribute data of agricultural products from the agricultural product information management database , including: agricultural product category attributes, agricultural product value attributes, among which, Represents the quantity of structured attribute data; Indicates Structured attribute data;
[0096] The structured attribute data refers to data stored in a table format with fields and data types, which represents the basic attributes of agricultural products.
[0097] The agricultural product category attributes refer to the type, origin, specification, grade, and certification information of the agricultural product.
[0098] The agricultural product value attributes refer to the price, sales volume, and rating of the agricultural product, which are used to judge the market value of the agricultural product.
[0099] Step S120: Collecting sales behavior data of agricultural products from e-commerce platforms , including: browsing history, purchase history, search history, among which, Indicates the quantity of sales behavior data; Indicates Sales behavior data;
[0100] The sales behavior data refers to consumers' browsing and purchasing behaviors of agricultural products on the Internet, which is used to reflect consumers' demand preferences for agricultural products;
[0101] Step S130: Collecting supply and demand network data of agricultural products from the supply and demand media platform , including: supply information, demand information, transaction data, among which, Represents the quantity of supply and demand network data; Indicates Supply and demand network data;
[0102] The supply and demand network data refers to various supply and demand information and transaction conditions of agricultural products on the supply and demand media platform, which is used to reflect the market supply and demand relationship of agricultural products;
[0103] Step S140: Structured attribute data , sales behavior data and supply and demand network data Preprocessing to obtain the original data set ;
[0104] The above steps form a more comprehensive and accurate characterization of agricultural products from different dimensions through data fusion, empowering subsequent personalized analysis and marketing, enriching the feature representation of the data, and laying a good data foundation for subsequent feature learning, agricultural product clustering and other links.
[0105] Step S200: performing feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features and perform feature fusion to obtain a multi-view feature representation of agricultural products;
[0106] The specific method of performing feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features and performing feature fusion to obtain multi-view feature representation of agricultural products is:
[0107] Step S210: Use the autoencoder to perform feature learning on the structured attribute data to extract attribute features ;
[0108] The autoencoder is used to perform feature learning on structured attribute data to extract attribute features. The specific method is:
[0109] Step S211: construct an autoencoder, wherein the autoencoder includes an encoder and a decoder;
[0110] Step S212: using the structured attribute data to train the autoencoder, using reconstruction loss and regularization loss as loss functions for training the autoencoder, minimizing the loss function as a training goal, and optimizing the weight matrix and bias vector of the autoencoder;
[0111] The optimization goal of the autoencoder is: ,in, For input data With output data The reconstruction loss between is the regularization term, λ is the regularization coefficient, Indicates minimization of the weight matrix W and the bias vector b;
[0112] Step S213: When the weight matrix W and the bias vector b reach the minimum value, the trained autoencoder is obtained, the encoder part is extracted, and the structured attribute data is forward propagated to obtain the attribute feature ;
[0113] Step S220: Use LDA topic model and Word2Vec to perform feature learning on sales behavior data to obtain behavior features , the behavioral characteristics include subject behavioral characteristics and word embedding behavior features ;
[0114] The LDA topic model and Word2Vec are used to learn the characteristics of the sales behavior data respectively to obtain the behavior characteristics. , the behavioral characteristics include subject behavioral characteristics and word embedding behavior features The specific method is:
[0115] Use the LDA topic model to learn the features of sales behavior data, and perform probability distribution statistics on the keywords of each topic in the purchase records in the sales behavior data to obtain the topic behavior features. ;
[0116] The formula of the LDA topic model is: ,in, Indicates that the keyword is observed in the purchase record d of the sales behavior data The probability of is the kth topic of the purchase record, where K represents the total number of topics;
[0117] The purchase record refers to the consumer's purchase behavior for each agricultural product, and the keyword refers to the key factor when the consumer purchases the agricultural product;
[0118] Maximizing the co-occurrence frequency of the central word and background words in the sales behavior data, and minimizing the co-occurrence frequency of the central word and negative sample words are used as the objective function of training Word2Vec to obtain Word2Vec;
[0119] The objective function of Word2Vec is:
[0120] ;
[0121] in, represents maximizing the co-occurrence frequency of the central word and background word in the sales behavior data, represents minimizing the co-occurrence frequency of the central word and the negative sample word, represents the transpose of the vector embedding of the central word wo, represents the vector embedding of the background word wI, represents the negative sampling word, k' represents the number of negative sampling, It means to average the loss of k' negative sampled words; Indicates sub-negative sampling; ≤k';
[0122] Use Word2Vec to learn the features of sales behavior data, obtain the embedding vector of each keyword, and concatenate the embedding vectors to obtain the word embedding behavior features. ;
[0123] Step S230: Use graph convolutional networks to learn the characteristics of supply and demand network data to obtain supply and demand characteristics ;
[0124] The training process of the graph convolutional network is as follows: each agricultural product in the supply and demand network data is regarded as an agricultural product node, a node set V is created, the supply and demand relationship between agricultural products is used as an edge, the weight of the edge is set according to the strength of the supply and demand relationship, and an edge set is constructed. , we get the agricultural product supply and demand network diagram ;
[0125] Extract node features of agricultural products for each agricultural product node, wherein the node features include: supply, demand, and price fluctuation of agricultural products, represent each node feature as a vector, and construct a node feature matrix;
[0126] Construct an adjacency matrix A based on the edge set, where the value of the element in matrix A is the weight of edge (i, j) ; i and j represent agricultural product node i and agricultural product node j respectively;
[0127] Initialize the number of layers L of the graph convolutional network and the weight matrix of each layer , the node feature matrix As the initial node representation ;
[0128] For each layer l, l∈[1,L], its adjacency matrix is normalized to obtain ;
[0129] According to the node representation of the previous layer , weight matrix and the normalized adjacency matrix , the node representation of the next layer is obtained through the activation function , the calculation formula is: , get the node representation of the last layer As the supply and demand characteristics of the node; is the activation function;
[0130] Use the cross entropy loss function as the loss function for training the graph convolutional network, use the back propagation algorithm and optimizer to minimize the loss function, and when the loss function reaches the minimum value, the training is completed and the trained graph convolutional network is obtained;
[0131] Step S240: Fusing the learned attribute features, behavior features, and supply and demand features to obtain a multi-view feature representation E of agricultural products;
[0132] The agricultural product multi-view feature representation , is the sub-feature of the multi-view feature representation of agricultural products. .
[0133] Step S300: Using clustering algorithm to classify agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters;
[0134] The clustering algorithm is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into The specific method of a supply and demand cluster is:
[0135] The agricultural products are divided into The specific method of attribute cluster is:
[0136] Step S311: Randomly determine Cluster centers are calculated. For each agricultural product, it is regarded as a sample point. The cluster center closest to the sample point is calculated and the sample point is assigned to the corresponding cluster center. Each cluster center and its sample point form a cluster.
[0137] Step S312: for each cluster, recalculate its cluster center, and use the average value of the sample points in the cluster as the new cluster center;
[0138] Step S313: Re-divide each sample point into the cluster closest to the cluster center until the clustering result no longer changes, and obtain Attribute clusters of agricultural products clustered based on attribute features;
[0139] The agricultural products are divided into The specific method of a behavior cluster is:
[0140] Step S321: The topic distribution of the purchase records in the sales behavior data is obtained by learning the trained LDA topic model. The K-means clustering algorithm is used to classify agricultural products according to the characteristics of the topic behavior. Thematic behavior clusters;
[0141] Step S322: Based on word embedding behavior features , using K-means clustering algorithm to classify agricultural products based on behavior patterns, we get Each word is embedded in a behavior cluster;
[0142] The agricultural products are divided into The specific method of a supply and demand cluster is:
[0143] Step S331: Set each agricultural product node as a community, then the number of initial communities is the number of node sets V, and calculate the total edge weight in the agricultural product supply and demand network graph as , It represents the sum of the strength of supply and demand relationships in the agricultural product supply and demand network diagram;
[0144] Step S332: for each agricultural product node i, traverse all its neighboring agricultural product nodes j, and calculate the change in modularity Q when the agricultural product node i is assigned to the community where the neighboring agricultural product node j is located;
[0145] The calculation formula of the modularity Q is: ,in, , is the sum of the edge weights connected to agricultural product node i and agricultural product node j, Refers to whether the communities to which agricultural product i and agricultural product j belong are the same. If they are the same, is 1, otherwise it is 0;
[0146] Step S333: Calculate the modularity of each agricultural product node assigned to each community, obtain the community corresponding to the maximum modularity improvement, and assign the agricultural product node to the community until the result of the agricultural product node assigned by the community no longer changes;
[0147] Step S334: Treat each community as a community node, build a community network, and The edge weight between them is set as the sum of the edge weights between each original community, and the self-loop edge weight of the community node is the sum of the edge weights within each original community;
[0148] Step S335: Obtain community division results based on the community network, where each community represents a supply and demand cluster divided according to the supply and demand characteristics of agricultural products.
[0149] Step S400: construct a group portrait for each cluster using attribute clusters, behavior clusters, and supply and demand clusters, obtain agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score;
[0150] The group portrait is a summary description of an agricultural product group in various characteristic dimensions. The group portrait depicts the overall characteristics and differences of the group.
[0151] The membership score measures the similarity between an agricultural product and each group, reflecting the degree of match between the agricultural product and each group. The higher the score, the more similar the agricultural product is to the group.
[0152] The supply and demand score is an overall score obtained by comprehensively considering the membership scores of agricultural products and each cluster.
[0153] The method of constructing a group portrait for each cluster by using attribute clusters, behavior clusters and supply and demand clusters, obtaining agricultural product information of the current agricultural products in real time, calculating the membership scores between the agricultural products and each cluster, and calculating the supply and demand scores of the agricultural products according to the membership scores is as follows:
[0154] Step S410: Number the attribute clusters, behavior clusters, and supply and demand clusters. For the rj-th feature of the ri-th cluster, calculate the mean and standard deviation of all agricultural products in the cluster on this feature to obtain the group portrait of the ri-th cluster. , Represents the mean of the rJth feature of the rith cluster and standard deviation , rJ represents the total number of features, rj∈{1,2,...,rJ}; the features refer to the attribute features, behavior features, and supply and demand features corresponding to the attribute cluster, behavior cluster, and supply and demand cluster, respectively;
[0155] Step S420: Calculate the distance between the agricultural product and each group portrait, and convert the distance into a membership score;
[0156] The calculation formula of the membership score is: , where vi represents agricultural product vi, represents the distance between the agricultural product vi and the group portrait of the ri-th cluster, and γ is the control parameter; represents the membership score of agricultural product vi;
[0157] The larger γ is, the more the membership scores are concentrated in the closest cluster, and the smaller γ is, the more evenly the membership scores are distributed;
[0158] Step S430: Calculate the supply and demand score of the agricultural product according to the membership scores between the agricultural product and each cluster;
[0159] The calculation formula for the supply and demand score is: ,in represents the weight coefficient of the ri-th cluster, represents the maximum membership score of agricultural product vi among all clusters;
[0160] The maximum membership degree is used here instead of the average membership degree in order to highlight the matching degree between agricultural products and the most similar clusters and avoid being affected by other less relevant clusters.
[0161] Step S500: Select the product most similar to the agricultural product according to its membership score. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information;
[0162] According to the membership score of the agricultural product, the most similar agricultural product is selected. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the The specific method of obtaining supply and demand information is as follows:
[0163] Step S510: Calculate the membership scores of agricultural products and each cluster, sort each cluster in descending order according to the membership scores, and select the top The clusters are used as candidate supply and demand sets for the agricultural product;
[0164] Step S520: Select clusters from the candidate supply and demand set in sequence according to the sequence of sorted clusters, and generate the characteristics of the agricultural product according to the characteristics of the clusters. Supply and demand information;
[0165] forward The clusters are most similar to agricultural products and are the preferred choice for generating personalized supply and demand information. The candidate supply and demand set is obtained by sorting them in descending order according to the membership scores. Clusters are selected from the candidate supply and demand set in order from high to low. According to the characteristics of the cluster, such as agricultural product attributes, sales behavior, etc., corresponding recommendation content is generated, such as agricultural product recommendations, supply and demand matching, etc.
[0166] Example 2
[0167] like Figure 2 As shown, an agricultural product information clustering system for fusion information provided by the present application includes:
[0168] The data set construction module is used to collect the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D;
[0169] The feature fusion module is used to learn the features of the structured attribute data, sales behavior data and supply and demand network data of agricultural products, obtain attribute features, behavior features and supply and demand features, and perform feature fusion to obtain multi-view feature representation of agricultural products;
[0170] The clustering module is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters;
[0171] The supply and demand score calculation module is used to use attribute clusters, behavior clusters and supply and demand clusters to build a group portrait for each cluster, obtain the agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score;
[0172] The personalized recommendation module is used to select the agricultural products that are most similar to the agricultural products according to their membership scores. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information.
[0173] Example 3
[0174] Figure 3 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are run by the one or more processors, the agricultural product information clustering method applied to fusion information as described above may be executed.
[0175] The method or system according to the embodiment of the present application can also be used by Figure 3 The electronic device architecture shown in FIG. Figure 3 As shown, the electronic device may include a bus, one or more CPUs, a read-only memory (ROM), a random access memory (RAM), a communication port connected to a network, an input / output component, a hard disk, etc. A storage device in the electronic device, such as a ROM or a hard disk, may store an agricultural product information clustering method applied to fusion information provided in the present application. An agricultural product information clustering method applied to fusion information may, for example, include: collecting structured attribute data, sales behavior data, and supply and demand network data of agricultural products to form an original data set D; performing feature learning on the structured attribute data, sales behavior data, and supply and demand network data of agricultural products to obtain attribute features, behavior features, and supply and demand features, and performing feature fusion to obtain a multi-view feature representation of agricultural products; using a clustering algorithm to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters; construct a group portrait for each cluster using attribute clusters, behavior clusters, and supply and demand clusters, obtain the agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score; select the agricultural product that is most similar to the agricultural product based on the membership score The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information. Furthermore, the electronic device may also include a user interface. Of course, Figure 3 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 3 One or more components of an electronic device are shown.
[0176] Example 4
[0177] Figure 4 Schematic diagram of a readable storage medium structure provided by an embodiment of the present application. Figure 4 As shown, a computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by a processor, a method for clustering agricultural product information applied to fusion information according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache). Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0178] In addition, according to the implementation mode of the present application, the process described in the above reference flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, such as: collecting structured attribute data, sales behavior data, and supply and demand network data of agricultural products to form an original data set D; performing feature learning on the structured attribute data, sales behavior data, and supply and demand network data of agricultural products to obtain attribute features, behavior features, and supply and demand features, and performing feature fusion to obtain a multi-view feature representation of agricultural products; using a clustering algorithm to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters; construct a group portrait for each cluster using attribute clusters, behavior clusters, and supply and demand clusters, obtain the agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score; select the agricultural product that is most similar to the agricultural product based on the membership score The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0179] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0180] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0181] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for clustering agricultural product information applied to fusion information, characterized in that: include: Collect the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D; Perform feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features, and perform feature fusion to obtain multi-view feature representation of agricultural products; Use clustering algorithms to classify agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters; Agricultural products are divided into The specific method of a supply and demand cluster is: Each agricultural product node is set as a community, then the number of initial communities is the number of node sets V, and the total edge weight in the agricultural product supply and demand network graph is calculated as , It represents the sum of the strength of supply and demand relationships in the agricultural product supply and demand network diagram; For each agricultural product node i, traverse all its neighboring agricultural product nodes j and calculate the change in modularity Q when agricultural product node i is assigned to the community where neighboring agricultural product node j is located; The calculation formula of the modularity Q is: ,in, , is the sum of the edge weights connected to agricultural product node i and agricultural product node j, Refers to whether the communities to which agricultural product i and agricultural product j belong are the same. If they are the same, is 1, otherwise it is 0; Calculate the modularity of each agricultural product node assigned to each community, obtain the community corresponding to the maximum modularity improvement, and assign the agricultural product node to the community until the result of the agricultural product node assigned to the community no longer changes; Treat each community as a community node, build a community network, and The edge weight between them is set as the sum of the edge weights between each original community, and the self-loop edge weight of the community node is the sum of the edge weights within each original community; The community division results are obtained based on the community network. Each community represents a supply and demand cluster divided according to the supply and demand characteristics of agricultural products. Using attribute clusters, behavior clusters, and supply and demand clusters, a group portrait is constructed for each cluster, agricultural product information of the current agricultural product is obtained in real time, the membership score between the agricultural product and each cluster is calculated, and the supply and demand score of the agricultural product is calculated based on the membership score; According to the membership score of the agricultural product, select the product that is most similar to the agricultural product The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information; The specific method of performing feature learning on the structured attribute data, sales behavior data and supply and demand network data of agricultural products to obtain attribute features, behavior features and supply and demand features and performing feature fusion to obtain multi-view feature representation of agricultural products is: Use autoencoders to learn the features of structured attribute data and extract attribute features ; Use LDA topic model and Word2Vec to learn the characteristics of sales behavior data and obtain behavior characteristics , the behavioral characteristics include subject behavioral characteristics and word embedding behavior features ; Use graph convolutional networks to learn the features of supply and demand network data and obtain supply and demand features ; The learned attribute features, behavior features, and supply and demand features are fused to obtain the multi-view feature representation E of agricultural products; The agricultural product multi-view feature representation , is the sub-feature of the multi-view feature representation of agricultural products, ; The training process of the graph convolutional network is as follows: Treat each agricultural product in the supply and demand network data as an agricultural product node, create a node set V, take the supply and demand relationship between agricultural products as an edge, set the edge weight according to the strength of the supply and demand relationship, and construct an edge set , we get the agricultural product supply and demand network diagram ; Extract node features of agricultural products for each agricultural product node, wherein the node features include: supply, demand, and price fluctuation of agricultural products, represent each node feature as a vector, and construct a node feature matrix; Construct an adjacency matrix A based on the edge set, where the value of the element in matrix A is the weight of edge (i, j) ; i and j represent agricultural product node i and agricultural product node j respectively; Initialize the number of layers L of the graph convolutional network and the weight matrix of each layer , the node feature matrix As the initial node representation ; For each layer l, l∈[1,L], its adjacency matrix is normalized to obtain ; According to the node representation of the previous layer , weight matrix and the normalized adjacency matrix , the node representation of the next layer is obtained through the activation function , the calculation formula is: , get the node representation of the last layer As the supply and demand characteristics of the node; is the activation function; Use the cross entropy loss function as the loss function for training the graph convolutional network, use the back propagation algorithm and optimizer to minimize the loss function, and when the loss function reaches the minimum value, the training is completed and the trained graph convolutional network is obtained; The method of constructing a group portrait for each cluster by using attribute clusters, behavior clusters and supply and demand clusters, obtaining agricultural product information of the current agricultural products in real time, calculating the membership scores between the agricultural products and each cluster, and calculating the supply and demand scores of the agricultural products according to the membership scores is as follows: Number the attribute clusters, behavior clusters, and supply and demand clusters. For the rj-th feature of the ri-th cluster, calculate the mean and standard deviation of all agricultural products in the cluster on this feature to obtain the group portrait of the ri-th cluster. , Represents the mean of the rJth feature of the rith cluster and standard deviation , rJ represents the total number of features, rj∈{1,2,...,rJ}; the features refer to the attribute features, behavior features, and supply and demand features corresponding to the attribute cluster, behavior cluster, and supply and demand cluster, respectively; The distance between the agricultural product and each group portrait is calculated, and the distance is converted into a membership score; the calculation formula of the membership score is: , where vi represents agricultural product vi, represents the distance between the agricultural product vi and the group portrait of the ri-th cluster, and γ is the control parameter; represents the membership score of agricultural product vi; According to the membership scores between agricultural products and each cluster, the supply and demand scores of the agricultural products are calculated; The supply and demand score is calculated as follows: ,in represents the weight coefficient of the ri-th cluster, Represents the maximum membership score of agricultural product vi in all clusters.
2. The agricultural product information clustering method applied to fusion information as claimed in claim 1, characterized in that: The specific method of collecting the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D is: Collecting structured attribute data of agricultural products from agricultural product information management database : , including: agricultural product category attributes, agricultural product value attributes, among which, Represents the quantity of structured attribute data; Indicates Structured attribute data; Collecting sales behavior data of agricultural products from e-commerce platforms : , including: browsing history, purchase history, search history, among which, Indicates the quantity of sales behavior data; Indicates Sales behavior data; Collect supply and demand network data of agricultural products from supply and demand media platforms : , including: supply information, demand information, transaction data, among which, Represents the quantity of supply and demand network data; Indicates Supply and demand network data; Structured attribute data , sales behavior data and supply and demand network data Preprocessing to obtain the original data set .
3. The agricultural product information clustering method applied to fusion information as claimed in claim 2, characterized in that: The clustering algorithm is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into The specific method of a supply and demand cluster is: Agricultural products are divided into The specific method of attribute cluster is: Randomly determined Cluster centers are calculated. For each agricultural product, it is regarded as a sample point. The cluster center closest to the sample point is calculated and the sample point is assigned to the corresponding cluster center. Each cluster center and its sample point form a cluster. For each cluster, recalculate its cluster center and use the average value of the sample points in the cluster as the new cluster center; Re-divide each sample point into the cluster closest to its cluster center until the clustering result no longer changes, and get Attribute clusters of agricultural products clustered based on attribute features; Agricultural products are divided into The specific method of a behavior cluster is: The topic distribution in the purchase records in the sales behavior data is obtained by learning the trained LDA topic model. The K-means clustering algorithm is used to classify agricultural products according to the characteristics of the topic behavior. Thematic behavior clusters; According to word embedding behavior characteristics , using K-means clustering algorithm to classify agricultural products based on behavior patterns, we get Words are embedded into behavior clusters.
4. The agricultural product information clustering method applied to fusion information as claimed in claim 3, characterized in that: According to the membership score of the agricultural product, the most similar agricultural product is selected. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the The specific method of obtaining supply and demand information is as follows: Calculate the membership scores of agricultural products and each cluster, sort each cluster in descending order according to the membership scores, and select the top The clusters are used as candidate supply and demand sets for the agricultural product; According to the sequence of sorted clusters, clusters are selected from the candidate supply and demand sets in turn, and the characteristics of the agricultural product are generated according to the characteristics of the cluster. Supply and demand information.
5. An agricultural product information clustering system applied to fusion information, the system is used to implement an agricultural product information clustering method applied to fusion information as described in any one of claims 1 to 4, characterized in that: include: The data set construction module is used to collect the structured attribute data, sales behavior data and supply and demand network data of agricultural products to form the original data set D; The feature fusion module is used to learn the features of the structured attribute data, sales behavior data and supply and demand network data of agricultural products, obtain attribute features, behavior features and supply and demand features, and perform feature fusion to obtain multi-view feature representation of agricultural products; The clustering module is used to divide agricultural products into attribute clusters, and divide agricultural products into Behavioral clusters, agricultural products are divided into supply and demand clusters; The supply and demand score calculation module is used to use attribute clusters, behavior clusters and supply and demand clusters to build a group portrait for each cluster, obtain the agricultural product information of the current agricultural product in real time, calculate the membership score between the agricultural product and each cluster, and calculate the supply and demand score of the agricultural product based on the membership score; The personalized recommendation module is used to select the agricultural products that are most similar to the agricultural products according to their membership scores. The clusters are used as the candidate supply and demand sets of the agricultural product, and the candidate supply and demand sets are sorted in descending order according to the membership scores to generate the Supply and demand information.
6. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the agricultural product information clustering method applied to fusion information as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the agricultural product information clustering method applied to fusion information as described in any one of claims 1-4.