Bill-based graph clustering method and device, electronic equipment and readable storage medium

By using a graph clustering method based on invoices to obtain customer feature vectors, and then optimizing clustering through cosine distance calculation and attention mechanism modules, the problem of poor customer group classification in corporate banking scenarios is solved, achieving more efficient customer conversion rates and advertising exposure.

CN115935214BActive Publication Date: 2026-04-28PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN BANK CO LTD
Filing Date
2022-12-21
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing customer diffusion algorithms perform poorly in customer classification within corporate banking scenarios, particularly in terms of new customer acquisition and improving customer conversion rates.

Method used

The customer feature vectors of the seed customer group are obtained based on the tickets. An initial adjacency matrix is ​​constructed by calculating the cosine distance. The node features are corrected by the attention mechanism module, and k-means clustering is performed to finally generate the optimized clustering results.

Benefits of technology

It improved the clustering effect of customer segmentation, optimized the clustering process, and increased customer conversion rate and advertising exposure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935214B_ABST
    Figure CN115935214B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of based on bill's graph clustering method, device, electronic equipment and readable storage medium, belong to computer technical field.The method includes: obtaining the multiple customer feature vectors of seed guest group based on bill;The cosine distance between any two customer feature vectors is calculated, and the initial adjacency matrix for representing customer similarity is determined according to each customer feature vector and the nearest K customer feature vector of corresponding cosine distance;The initial adjacency matrix is calculated by attention mechanism module, and a group of modified node features are obtained;A group of modified node features are carried out kmeans clustering calculation, and the cluster center of each clustering cluster is obtained, the similarity distribution result of cluster customer sample and cluster center in each clustering cluster is calculated;The final clustering result is calculated according to similarity distribution result.In this way, in bill scene, by preposition adding unsupervised graph clustering scheme, optimization clustering process, improve the clustering effect of final clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a graph clustering method, apparatus, electronic device, and readable storage medium based on tickets. Background Technology

[0002] Currently, customer base expansion technology is applied in retail customer groups and internet advertising platforms. After suppliers select relevant customer profile tags and provide a seed customer group, the algorithmic mechanism of customer base expansion expands the target customer group within the customer pool, further improving the advertising exposure and conversion rate of the targeted customer group. In the context of corporate banking, the existing customer base expansion algorithm can be used to acquire new customers and improve customer conversion rates, but its customer segmentation effect is relatively poor. Summary of the Invention

[0003] To address the aforementioned technical problems, embodiments of this application provide a graph clustering method, apparatus, electronic device, and readable storage medium based on tickets.

[0004] In a first aspect, embodiments of this application provide a graph clustering method based on invoices, the method comprising:

[0005] Multiple customer feature vectors of the seed customer group are obtained based on the invoices, and each customer feature vector includes multiple customer feature data.

[0006] Calculate the cosine distance between any two customer feature vectors, and determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features.

[0007] The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features;

[0008] The modified node features are subjected to k-means clustering to obtain the cluster center of each cluster, and the similarity distribution between the customer samples within each cluster and the cluster center is calculated.

[0009] The final clustering result is calculated based on the similarity distribution results.

[0010] In one embodiment, the method further includes:

[0011] Obtain the corrected adjacency matrix based on the set of corrected node features;

[0012] The initial adjacency matrix and the modified adjacency matrix are input into a pre-set reconstruction error function to calculate the reconstruction error.

[0013] In one embodiment, the method further includes:

[0014] The similarity distribution results and the final clustering results are input into a pre-set clustering loss function to calculate the clustering loss.

[0015] In one embodiment, the method further includes:

[0016] The joint loss function is determined based on the clustering loss function and the reconstruction error function;

[0017] Taking the derivative of the joint loss function, we obtain the derivative result;

[0018] Backpropagation is performed based on the derivative result to update the network parameters of the attention mechanism module.

[0019] In one embodiment, the method further includes:

[0020] A document clustering feature visualization is generated based on the final clustering results.

[0021] In one embodiment, the method further includes:

[0022] Based on the final clustering results, the similarity of the candidate customer pool is calculated to obtain a similar customer group.

[0023] In one embodiment, the multiple customer characteristic data include consumption stratification characteristics and customer value stratification characteristics;

[0024] Based on the ticket information, the feature vectors of each customer in the seed customer group are obtained, including:

[0025] Obtain the ticket consumption behavior data of the seed customer group;

[0026] Based on the aforementioned bill consumption behavior data, the bill consumption stratification characteristics and the customer value stratification characteristics are determined respectively.

[0027] In one embodiment, the tiered characteristics of bill consumption include a bill activity score;

[0028] The characteristics of the tiered spending patterns of the bills are determined based on the bill spending behavior data, including:

[0029] The most recent consumption, consumption frequency, and consumption amount are determined based on the aforementioned bill consumption behavior data. The bill activity score is then determined based on the most recent consumption, the consumption frequency, the consumption amount, and a preset bill activity evaluation logic.

[0030] In one embodiment, the stratified features of bill consumption include bill preference scores;

[0031] The characteristics of the tiered spending patterns of the bills are determined based on the bill spending behavior data, including:

[0032] Based on the bill consumption behavior data, determine the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, and the percentage of transactions. Based on the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, the percentage of transactions, and the preset bill preference evaluation logic, determine the bill preference score.

[0033] Secondly, embodiments of this application provide a graph clustering device based on invoices, the device comprising:

[0034] The first acquisition module is used to acquire multiple customer feature vectors of the seed customer group based on the ticket. Each customer feature vector includes multiple customer feature data.

[0035] The determination module is used to calculate the cosine distance between any two customer feature vectors, and to determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features.

[0036] The first calculation module is used to calculate the initial adjacency matrix of the customer similarity through the attention mechanism module to obtain a set of corrected node features;

[0037] The second calculation module is used to perform k-means clustering calculation on the set of modified node features to obtain the cluster center of each cluster, and calculate the similarity distribution results between the customer samples within each cluster and the cluster center.

[0038] The third calculation module is used to calculate the final clustering result based on the similarity distribution result.

[0039] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the computer program executes the ticket-based graph clustering method provided in the first aspect when the processor is running.

[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a processor, executes the ticket-based graph clustering method provided in the first aspect.

[0041] The graph clustering method, apparatus, electronic device, and readable storage medium based on invoices provided in this application obtain multiple customer feature vectors of a seed customer group based on invoices. Each customer feature vector includes multiple customer feature data. The method calculates the cosine distance between any two customer feature vectors and determines an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K nearest customer feature vectors with corresponding cosine distances. The initial adjacency matrix includes a set of initial node features. An attention mechanism module is used to calculate the initial adjacency matrix to obtain a set of modified node features. The modified node features are then subjected to k-means clustering to obtain the cluster centers of each cluster. The similarity distribution between the in-cluster customer samples and the cluster centers of each cluster is calculated. The final clustering result is calculated based on the similarity distribution result. Thus, in the invoice scenario, by incorporating an unsupervised graph clustering scheme beforehand, the clustering process is optimized, and the clustering effect of the final clustering result is improved. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be considered as a limitation on the scope of protection of this application. In the various drawings, similar components are numbered similarly.

[0043] Figure 1 A flowchart illustrating a graph clustering method based on invoices provided in an embodiment of this application is shown.

[0044] Figure 2 This illustration shows another flowchart of the graph clustering method based on tickets provided in an embodiment of this application;

[0045] Figure 3 A schematic diagram of a scoring radar chart provided in an embodiment of this application is shown;

[0046] Figure 4 A schematic diagram of a feature radar map provided in an embodiment of this application is shown;

[0047] Figure 5 A schematic diagram of a graph clustering device based on tickets provided in an embodiment of this application is shown.

[0048] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.

[0049] Icons: 500 - Ticket-based graph clustering device, 501 - First acquisition module, 502 - Determination module, 503 - First calculation module, 504 - Second calculation module, 505 - Third calculation module;

[0050] 600 - Electronic equipment, 601 - Transceiver, 602 - Processor, 603 - Memory. Detailed Implementation

[0051] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0052] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0053] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.

[0054] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0055] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0056] Existing technologies offer customer diffusion algorithms based on lookalike, distance, and classification. Lookalike algorithms, used for explicit metrics, require large amounts of customer data for profiling and are more suited to retail scenarios in terms of customer feature selection and application. Distance-based algorithms, used for large-scale seed customer groups, are computationally intensive, especially when recalling similar customer groups to the candidate pool. Classification-based algorithms, when selecting negative samples, can lead to feature selection errors, affecting the scoring and recall ranking of the candidate customer pool, and are also complex in model construction. In summary, existing customer classification methods generally perform poorly.

[0057] Example 1

[0058] This application provides a graph clustering method based on invoices.

[0059] See Figure 1 The graph clustering method based on tickets includes steps S101-S105, and each step is explained below.

[0060] Step S101: Obtain multiple customer feature vectors of the seed customer group based on the ticket, each customer feature vector including multiple customer feature data.

[0061] In this embodiment, "bill of exchange" refers to various types of bills in the financial and banking industry. For example, a bill of exchange is a bank's corporate bill of exchange, which may include discounted bills of exchange, bills of exchange, etc., without limitation. A seed customer group refers to a customer group with relatively rich bill of exchange data; a seed customer group includes multiple seed customers. Exemplarily, metadata from bill of exchange transaction records registered within the past year can be used to obtain long-term bill of exchange behavior data, such as bill of exchange issuance, discounting, endorsement, and receiving first-hand bills. Obtaining multiple customer feature vectors from the seed customer group based on bills of exchange can also be understood as obtaining customer feature vectors for various sub-users of the seed customer group.

[0062] In one embodiment, the multiple customer characteristic data include consumption stratification characteristics and customer value stratification characteristics;

[0063] Based on the ticket information, the feature vectors of each customer in the seed customer group are obtained, including:

[0064] Obtain the ticket consumption behavior data of the seed customer group;

[0065] Based on the aforementioned bill consumption behavior data, the bill consumption stratification characteristics and the customer value stratification characteristics are determined respectively.

[0066] In this embodiment, long-term bill behavior data can be obtained, such as metadata of bill transaction records including invoicing, discounting, endorsement, and receiving first-hand bills. Based on the bill transaction record metadata, the bill consumption behavior of seed customer groups can be queried. The bill consumption stratification feature is mainly used to characterize the level of activity of customers in bill transactions, while the customer value stratification feature is mainly used to characterize the value of the customer to the corresponding financial institutions such as banks and securities firms.

[0067] In one embodiment, the stratification features of bill consumption include a bill activity score; determining the stratification features of bill consumption based on the bill consumption behavior data includes:

[0068] The most recent consumption, consumption frequency, and consumption amount are determined based on the aforementioned bill consumption behavior data. The bill activity score is then determined based on the most recent consumption, the consumption frequency, the consumption amount, and a preset bill activity evaluation logic.

[0069] It should be further explained that using the most recent transaction (Recency), transaction frequency (Frequency), and transaction amount (Monetary) as characteristics of a customer's active bill trading can also be called RFM stratification. The main purpose of RFM stratification is to characterize the customer's bill trading behavior. The preset bill activity evaluation logic can be based on pre-set scoring rules, weight values, and weighted calculation rules for the bill activity field.

[0070] As an example, the process of calculating the activity score of a bill includes the following steps: reading the variables of the corresponding fields from a pre-set list of table fields, determining the field scores based on the read fields and the scoring conversion rules of each field, and calculating the activity score of the bill by combining the scores of each field, the weight values, and the weighted calculation rules.

[0071] For example, based on the bill consumption behavior data, the number of days since the most recent endorsement, discounting, receipt of a bill, or receipt is determined. If the number of days since the most recent endorsement, discounting, receipt of a bill, or receipt is 0-7 days, the score is 5 points; if it is 7-14 days, the score is 4 points. Based on the bill consumption behavior data, the number of endorsements, receipts of bills, discounting, or issuances in the past 90 days is determined. If the number of endorsements, receipts of bills, discounting, or issuances in the past 90 days is 5 or more, the score is 5 points; if the number of endorsements, receipts of bills, discounting, or issuances in the past 90 days is 4, the score is 4. Based on the bill consumption behavior data, the amount of bills received, discounted, or issued in the past 90 days is determined. If the amount of bills received, discounted, or issued in the past 90 days is 100 million or more, the score is 5 points; if the amount of bills received, discounted, or issued in the past 90 days is between 50 million and 100 million, the score is 4.

[0072] In one embodiment, the stratification features of bill consumption include bill preference scores; determining the stratification features of bill consumption based on the bill consumption behavior data includes:

[0073] Based on the bill consumption behavior data, determine the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, and the percentage of transactions. Based on the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, the percentage of transactions, and the preset bill preference evaluation logic, determine the bill preference score.

[0074] It should be noted that the preset bill preference evaluation logic can be based on pre-defined scoring rules, weight values, and weighted calculation rules for bill preference fields. Weight values ​​can be set differently based on behaviors such as discounting, bill issuance, bill acceptance, and endorsement. For example, discounting weight 0.4, bill issuance weight 0.3, bill acceptance weight 0.2, and endorsement weight 0.1. Weights can also be called coefficients, such as discount coefficient 0.4, bill issuance coefficient 0.3, bill acceptance coefficient 0.2, and endorsement coefficient 0.1. The weighted calculation rule can be to sum the products of each weight and its corresponding score.

[0075] As an example, the percentage of bills held for 1-2 days can be determined based on bill consumption behavior data. A score of 3 is assigned to bills held for 1-2 days or more if this percentage is greater than 35%, and 0 to bills held for less than 35%. Similarly, the percentage of bills held for 3-7 days can be determined based on the same data. A score of 2 is assigned to bills held for 3-7 days or more if this percentage is greater than 35%, and 0 to bills held for less than 35%. Finally, the percentage of bills held for more than 8 days can be determined based on the same data. A score of 1 is assigned to bills held for more than 8 days or more if this percentage is greater than 35%, and 0 to bills held for less than 35%.

[0076] Furthermore, based on bill consumption behavior data, the number of endorsements, the number of initial bills received, the number of discounts, and the number of bills issued in the past 350 days can be determined. A score of 5 points is awarded if these numbers are greater than or equal to 50. A score of 4 points is awarded if these numbers are greater than or equal to 20 and less than 50. A score of 3 points is awarded if these numbers are greater than or equal to 10 and less than 20.

[0077] Furthermore, based on bill consumption data, the endorsement amount, received bill amount, issued bill amount, and discount amount over the past 350 days can be determined. If these amounts are greater than or equal to 1 billion, the score is 5 points. If they are less than 1 billion but greater than 100 million, the score is 4 points.

[0078] Furthermore, based on bill consumption behavior data, the percentage of bank bill discounting frequency over the past 350 days can be determined. A score of 5 is awarded if the percentage of bank bill discounting frequency is between 90% and 100%, and 4 points if it's between 80% and 90%. Similarly, the percentage of bank bill discounting amount over the past 350 days can be determined based on the same data. A score of 5 is awarded if the percentage of bank bill discounting amount is between 90% and 100%, and 4 points if it's between 80% and 90%. Finally, the percentage of discounting frequency by state-owned banks over the past 350 days can also be determined based on the same data.

[0079] Furthermore, based on bill consumption behavior data, it can be determined whether the primary issuing bank in the past 350 days is a preset target bank. If it is, the score is 1 point; otherwise, the score is 0 points. Similarly, based on bill consumption behavior data, it can be determined whether the primary discounting bank in the past 350 days is a preset target bank. If it is, the score is 1 point; otherwise, the score is 0 points.

[0080] Furthermore, based on bill consumption behavior data, the discount amount of a preset target bank within the past 350 or 90 days can be determined, and a score ranging from 0 to 5 can be set based on the preset target bank discount amount. Similarly, the bill issuance amount of a preset target bank within the past 350 or 90 days can be determined based on bill consumption behavior data, and a score ranging from 0 to 5 can be set based on the preset target bank issuance amount.

[0081] It should be added that the customer value stratification characteristics can also be determined based on credit information and customer level. These customer value stratification characteristics are customer tags, which are mainly used to assess the value of customers to the bank.

[0082] In this embodiment, based on unsupervised learning, the dimensionality reduction process, such as calculating ticket activity scores and ticket preference scores, can improve the clustering effect.

[0083] It should be further noted that customer qualification scores and industry information scores can also be calculated, but these will not be elaborated on here.

[0084] Step S102: Calculate the cosine distance between any two customer feature vectors, and determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features.

[0085] In this embodiment, customer feature vectors are first concatenated, and the similarity between any two customer feature vectors is calculated. Cosine similarity can be used to quickly calculate the similarity between customers. Based on the KNN principle, corresponding k-order neighbors are selected, and an initial adjacency matrix is ​​obtained from these k-order neighbors. This initial adjacency matrix characterizes the neighbor relationships of customer similarity. This can also be understood as: selecting the K customers with the closest cosine distance for each customer as neighbors, with neighboring customers having connected edges.

[0086] Step S103: The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features.

[0087] In this embodiment, the attention mechanism module includes a graph attention (GA) layer, and the initial set of node features input to the GA layer is denoted as... Where N is the number of initial nodes, and F is the number of features for each initial node. The output of the GA layer is a set of corrected node features, denoted as... The number of correction nodes N remains constant, while the number of features of each correction node can be changed to F'.

[0088] To transform the input features into high-dimensional features to obtain sufficient expressive power, each initial node undergoes a shared linear transformation. The parameters of this attention mechanism module are defined by a weight matrix. Let represent that a linear transformation on any initial node can be expressed as A self-attention mechanism is shared among each initial node; The attention coefficients between initial node i and initial node j can be calculated as follows:

[0089]

[0090] The e ij The coefficients represent the importance of the features of initial node i to initial node j. Note that mechanism a(.) is a single-layer feedforward neural network, represented by a weight vector: The attention mechanism a(.) maps the concatenated high-dimensional features of length 2F to a real number, which serves as the attention coefficient e. ij .

[0091] This paper adopts masked graph attention, which only allows neighboring nodes to participate in the attention mechanism of the current node, thereby introducing the structural information of the graph. Furthermore, the neighboring nodes are first-order neighboring nodes, which include the node itself.

[0092]

[0093] To facilitate comparison of attention coefficients between different initial nodes, the aforementioned softmax function is used to normalize all attention coefficients for initial node i. In this embodiment, the attention mechanism employs a shared-weight linear transformation, masked self attention, and LeakyReLU nonlinear (negative input slope α = 0.2) normalized calculation formula, as follows, where T represents transpose and || represents concatenation:

[0094]

[0095] After obtaining the normalized attention coefficients, the node's own features can be updated as output by linearly combining the features of neighboring nodes and passing them through a non-linear activation function, thus obtaining the features of the corresponding corrected node:

[0096]

[0097] Therefore, the output of the GA layer is a set of modified node features, denoted as...

[0098] In this embodiment, the connections between nodes can also be understood as a graph structure. Because the attention mechanism module causes changes in the initial node features, it also causes changes in the distances between the initial nodes, further altering the graph structure. Therefore, A can be used. ij This represents the initial adjacency matrix of the previous graph structure. This represents the corrected adjacency matrix after being updated by the attention module.

[0099] Step S104: Perform k-means clustering calculation on the set of modified node features to obtain the cluster center of each cluster, and calculate the similarity distribution results between the customer samples within each cluster and the cluster center.

[0100] In this embodiment, the pseudo-labels (soft labels) calculated by the k-means clustering algorithm are used to perform k-means clustering on the node features obtained through the attention mechanism to obtain the vector representation of the cluster centers of each cluster. The cluster centers can also be called the centroids. The feature representation of the cluster points of cluster u is denoted as μ. u The similarity distribution between the customer samples within each cluster and the cluster center is calculated using a t-distribution to obtain the similarity distribution result Q. The cluster center is the center of the corresponding sample within the cluster in the clustering result, which is the average feature vector of that cluster.

[0101] Step S105: Calculate the final clustering result based on the similarity distribution result.

[0102] As an example, the target distribution is calculated once using the similarity distribution result Q to obtain the final clustering result P.

[0103] Based on the previous output, we can now obtain the feature representation of each corrected node and the feature representation of the cluster center of each cluster. Therefore, we can represent the probability that corrected node i belongs to cluster u. When measuring the similarity between the target node and the cluster center, a t-distribution can be used. The formula for calculating the similarity distribution is as follows:

[0104]

[0105] Where, q iu Z represents the probability that node i belongs to cluster u. i represents the modified node features obtained by the attention mechanism from the initial node i, and k represents the number of clusters.

[0106] The final clustering result is calculated using the following formula:

[0107]

[0108] p iu q represents the final clustering result. iu represents the probability that node i belongs to cluster u, and k represents the number of clusters.

[0109] Please see Figure 2 Graph clustering methods based on invoices include:

[0110] Step S106: Obtain the corrected adjacency matrix based on the set of corrected node features;

[0111] Step S107: Input the initial adjacency matrix and the modified adjacency matrix into a pre-set reconstruction error function to calculate the reconstruction error.

[0112] As an example, the reconstruction error function includes the following formula:

[0113]

[0114] Among them, A ij Represents the initial adjacency matrix. This represents the modified adjacency matrix.

[0115] In one embodiment, the ticket-based graph clustering method includes:

[0116] The similarity distribution results and the final clustering results are input into a pre-set clustering loss function to calculate the clustering loss.

[0117] In one implementation,

[0118] The clustering loss function includes the following formula:

[0119]

[0120] Where, q iu p represents the probability that node i belongs to cluster u. iu This represents the final clustering result.

[0121] The reconstruction error of the graph structure was obtained by comparing the differences between the encoder and decoder.

[0122]

[0123] In one embodiment, the ticket-based graph clustering method includes:

[0124] The joint loss function is determined based on the clustering loss function and the reconstruction error function;

[0125] Taking the derivative of the joint loss function, we obtain the derivative result;

[0126] Backpropagation is performed based on the derivative result to update the network parameters of the attention mechanism module.

[0127] As an example, the joint loss function includes the following formula:

[0128]

[0129] The joint loss function can be optimized using stochastic gradient descent. The derivative of the joint loss function is calculated, and then backpropagation is performed to update the network parameters. After updating the network parameters, the previous steps are repeated to recalculate the final clustering result P, further improving the accuracy of the final clustering result.

[0130] In one embodiment, the ticket-based graph clustering method includes:

[0131] A document clustering feature visualization is generated based on the final clustering results.

[0132] In this embodiment, the ticket clustering feature visualization may include a scoring radar chart and a feature radar chart. Please refer to [link / reference]. Figure 3 and Figure 4 , Figure 3 The image shown is a score radar chart obtained based on the final clustering results. Figure 4 The image shown is a feature radar chart obtained based on the final clustering results. This allows for a more detailed analysis of customer segment performance and recall accuracy by examining the clustering results in both the scoring radar chart and the feature radar chart.

[0133] In one embodiment, the ticket-based graph clustering method includes:

[0134] Based on the final clustering results, the similarity of the candidate customer pool is calculated to obtain a similar customer group.

[0135] In this embodiment, the candidate customer pool includes multiple customer feature data. Based on the final clustering results, the similarity of each customer feature data is calculated and sorted. Corresponding similar customers are then recalled from the candidate customer pool according to the sorting results. Compared with other existing clustering algorithms, the ticket-based graph clustering method in this embodiment not only has better clustering results but also offers end-to-end application optimization.

[0136] This embodiment provides a graph clustering method based on invoices. It obtains multiple customer feature vectors for a seed customer group based on invoices, each customer feature vector including multiple customer feature data. The method calculates the cosine distance between any two customer feature vectors. Based on each customer feature vector and the K nearest customer feature vectors with corresponding cosine distances, an initial adjacency matrix is ​​determined to characterize customer similarity. This initial adjacency matrix includes a set of initial node features. An attention mechanism module is used to calculate the initial adjacency matrix to obtain a set of modified node features. The modified node features are then subjected to k-means clustering to obtain the cluster centers of each cluster. The similarity distribution between the in-cluster customer samples and the cluster centers of each cluster is calculated. Finally, the final clustering result is calculated based on the similarity distribution result. Thus, in the invoice scenario, by incorporating an unsupervised graph clustering scheme beforehand, the clustering process is optimized, and the clustering effect of the final clustering result is improved.

[0137] Example 2

[0138] Furthermore, embodiments of this application provide a graph clustering apparatus based on tickets.

[0139] like Figure 5 As shown, the ticket-based graph clustering device 500 includes:

[0140] The first acquisition module 501 is used to acquire multiple customer feature vectors of the seed customer group based on the ticket, and each customer feature vector includes multiple customer feature data.

[0141] The determination module 502 is used to calculate the cosine distance between any two customer feature vectors, and to determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features.

[0142] The first calculation module 503 is used to calculate the initial adjacency matrix of the customer similarity through the attention mechanism module to obtain a set of corrected node features;

[0143] The second calculation module 504 is used to perform k-means clustering calculation on the set of modified node features to obtain the cluster center of each cluster, and calculate the similarity distribution results between the customer samples within each cluster and the cluster center.

[0144] The third calculation module 505 is used to calculate the final clustering result based on the similarity distribution result.

[0145] In one embodiment, the ticket-based graph clustering apparatus 500 further includes:

[0146] The first processing module is used to obtain a corrected adjacency matrix based on the set of corrected node features;

[0147] The initial adjacency matrix and the modified adjacency matrix are input into a pre-set reconstruction error function to calculate the reconstruction error.

[0148] In one embodiment, the ticket-based graph clustering apparatus 500 further includes:

[0149] The second processing module is used to input the similarity distribution results and the final clustering results into a pre-set clustering loss function to calculate the clustering loss.

[0150] In one embodiment, the ticket-based graph clustering apparatus 500 further includes:

[0151] The update module is used to determine the joint loss function based on the clustering loss function and the reconstruction error function;

[0152] Taking the derivative of the joint loss function, we obtain the derivative result;

[0153] Backpropagation is performed based on the derivative result to update the network parameters of the attention mechanism module.

[0154] In one embodiment, the ticket-based graph clustering apparatus 500 further includes:

[0155] The generation module is used to generate a visual representation of the clustering features of the invoices based on the final clustering results.

[0156] In one embodiment, the ticket-based graph clustering apparatus 500 further includes:

[0157] The third processing module is used to calculate the similarity of the candidate customer pool based on the final clustering results to obtain similar customer groups.

[0158] In one embodiment, the multiple customer characteristic data include consumption stratification characteristics and customer value stratification characteristics; the first acquisition module 501 is also used to acquire the ticket consumption behavior data of the seed customer group;

[0159] Based on the aforementioned bill consumption behavior data, the bill consumption stratification characteristics and the customer value stratification characteristics are determined respectively.

[0160] In one embodiment, the tiered characteristics of bill consumption include a bill activity score;

[0161] The first acquisition module 501 is further configured to determine the most recent consumption, consumption frequency and consumption amount based on the bill consumption behavior data, and to determine the bill activity score based on the most recent consumption, the consumption frequency and the consumption amount and the preset bill activity evaluation logic.

[0162] In one embodiment, the stratified features of bill consumption include bill preference scores;

[0163] The first acquisition module 501 is further configured to determine the proportion of bills held for a preset number of days, the number of transactions, the transaction amount, and the transaction percentage based on the bill consumption behavior data, and to determine the bill preference score based on the proportion of bills held for a preset number of days, the number of transactions, the transaction amount, the transaction percentage, and the preset bill preference evaluation logic.

[0164] The ticket-based graph clustering device 500 provided in this embodiment can implement the ticket-based graph clustering method provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0165] This embodiment provides a graph clustering device based on invoices. It obtains multiple customer feature vectors from a seed customer group based on invoices, each customer feature vector including multiple customer feature data. It calculates the cosine distance between any two customer feature vectors and determines an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K nearest customer feature vectors with corresponding cosine distances. This initial adjacency matrix includes a set of initial node features. An attention mechanism module is used to calculate the initial adjacency matrix to obtain a set of modified node features. The modified node features are then subjected to k-means clustering to obtain the cluster centers of each cluster. The similarity distribution between the in-cluster customer samples and the cluster centers of each cluster is calculated. Finally, the final clustering result is calculated based on the similarity distribution result. Thus, in the invoice scenario, by incorporating an unsupervised graph clustering scheme beforehand, the clustering process is optimized, and the clustering effect of the final clustering result is improved.

[0166] Example 3

[0167] Furthermore, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program, which, when run on the processor, executes the ticket-based graph clustering method provided in Embodiment 1.

[0168] For details, see Figure 6The electronic device 600 includes: a transceiver 601, a bus interface and a processor 602. The processor 602 is used to: obtain multiple customer feature vectors of a seed customer group based on the ticket, and each customer feature vector includes multiple customer feature data.

[0169] Calculate the cosine distance between any two customer feature vectors, and determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features.

[0170] The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features;

[0171] The modified node features are subjected to k-means clustering to obtain the cluster center of each cluster, and the similarity distribution between the customer samples within each cluster and the cluster center is calculated.

[0172] The final clustering result is calculated based on the similarity distribution results.

[0173] In one embodiment, the processor 602 is further configured to: obtain a corrected adjacency matrix based on the set of corrected node features;

[0174] The initial adjacency matrix and the modified adjacency matrix are input into a pre-set reconstruction error function to calculate the reconstruction error.

[0175] In one embodiment, the processor 602 is further configured to: input the similarity distribution result and the final clustering result into a pre-set clustering loss function to calculate the clustering loss.

[0176] In one embodiment, the processor 602 is further configured to: determine a joint loss function based on the clustering loss function and the reconstruction error function;

[0177] Taking the derivative of the joint loss function, we obtain the derivative result;

[0178] Backpropagation is performed based on the derivative result to update the network parameters of the attention mechanism module.

[0179] In one embodiment, the processor 602 is further configured to: generate a ticket clustering feature visualization based on the final clustering result.

[0180] In one embodiment, the processor 602 is further configured to: perform similarity calculation on the candidate customer pool based on the final clustering result to obtain a similar customer group.

[0181] In one embodiment, the multiple customer characteristic data include consumption stratification characteristics and customer value stratification characteristics;

[0182] The processor 602 is also used to: acquire ticket consumption behavior data of the seed customer group;

[0183] Based on the aforementioned bill consumption behavior data, the bill consumption stratification characteristics and the customer value stratification characteristics are determined respectively.

[0184] In one embodiment, the tiered characteristics of bill consumption include a bill activity score;

[0185] The processor 602 is further configured to: determine the most recent consumption, consumption frequency, and consumption amount based on the bill consumption behavior data, and determine the bill activity score based on the most recent consumption, the consumption frequency, the consumption amount, and a preset bill activity evaluation logic.

[0186] In one embodiment, the stratified features of bill consumption include bill preference scores;

[0187] The processor 602 is further configured to: determine the proportion of bills held for a preset number of days, the number of transactions, the transaction amount, and the transaction percentage based on the bill consumption behavior data; and determine the bill preference score based on the proportion of bills held for a preset number of days, the number of transactions, the transaction amount, the transaction percentage, and a preset bill preference evaluation logic.

[0188] In this embodiment of the invention, the electronic device 600 further includes a memory 603. Figure 6 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 602) and memory (memory 603). The bus architecture can also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 601 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 602 is responsible for managing the bus architecture and general processing, and the memory 603 can store data used by the processor 602 during operation.

[0189] The electronic device 600 provided in this embodiment of the invention can execute the steps of the graph clustering method based on tickets provided in the above method embodiment 1. To avoid repetition, it will not be described again here.

[0190] The electronic device provided in this embodiment obtains multiple customer feature vectors of a seed customer group based on invoices. Each customer feature vector includes multiple customer feature data. It calculates the cosine distance between any two customer feature vectors and determines an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K nearest customer feature vectors with corresponding cosine distances. The initial adjacency matrix includes a set of initial node features. An attention mechanism module is used to calculate the initial adjacency matrix to obtain a set of modified node features. The modified node features are then subjected to k-means clustering to obtain the cluster centers of each cluster. The similarity distribution between the in-cluster customer samples and the cluster centers of each cluster is calculated. The final clustering result is calculated based on the similarity distribution result. Thus, in the invoice scenario, by incorporating an unsupervised graph clustering scheme beforehand, the clustering process is optimized, and the clustering effect of the final clustering result is improved.

[0191] Example 4

[0192] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the ticket-based graph clustering method provided in Embodiment 1.

[0193] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0194] The computer-readable storage medium provided in this embodiment can implement the ticket-based graph clustering method provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0195] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0196] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0197] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A graph clustering method based on invoices, characterized in that, The method includes: Multiple customer feature vectors of the seed customer group are obtained based on the invoices, and each customer feature vector includes multiple customer feature data. Calculate the cosine distance between any two customer feature vectors, and determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features. The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features; The modified node features are subjected to k-means clustering to obtain the cluster center of each cluster, and the similarity distribution between the customer samples within each cluster and the cluster center is calculated. The final clustering result is calculated based on the similarity distribution results; The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features, including: The attention mechanism module includes a graph attention layer, and a set of initial node features input to the graph attention layer is denoted as... Where N is the number of initial nodes, F is the number of features for each initial node, and the output of the graph attention layer is a set of corrected node features, denoted as... The number of correction nodes N remains constant, while the number of features of each correction node can be changed to F'. To transform the input features into high-dimensional features to obtain sufficient expressive power, each initial node undergoes a shared linear transformation. The parameters of this attention mechanism module are defined by a weight matrix. Let represent that a linear transformation on any initial node can be expressed as ; Share self-attention mechanism among each initial node; The attention coefficients between initial node i and initial node j can be calculated as follows: ; Should The coefficients represent the importance of the features of initial node i to initial node j; attention mechanism It is a single-layer feedforward neural network, represented by a weight vector: Attention mechanism Map the concatenated high-dimensional features of length 2F to a real number, which serves as the attention coefficient. ; The masked graph attention mechanism is adopted, which only allows adjacent nodes to participate in the attention mechanism of the current node, thereby introducing the structural information of the graph. Furthermore, the adjacent nodes are first-order adjacent nodes, which include the node itself. ; To facilitate comparison of attention coefficients between different initial nodes, the softmax function described above is used to normalize all attention coefficients for initial node i. The attention mechanism employs a shared weight linear transformation, masked self-attention, and LeakyReLU nonlinear normalization, and the calculation formula is as follows, where T represents transpose and || represents concatenation: ; After obtaining the normalized attention coefficients, the node's own features are updated by a linear combination of the features of neighboring nodes through a non-linear activation function, which is the output, thus obtaining the features of the corresponding corrected node: ; The output of the graph attention layer is a set of modified node features, denoted as... The step involves performing k-means clustering on the set of modified node features to obtain the cluster values ​​of each cluster. Cluster center: Calculate the similarity distribution between the customer samples within each cluster and the cluster center, including: The pseudo-labels obtained by the k-means clustering algorithm are then used to perform k-means clustering on the node features obtained through the attention mechanism, resulting in the vector representation of the cluster centers of each cluster. The cluster centers can also be called the centroids. The feature representation of the cluster points of cluster u is denoted as... The similarity distribution between the customer samples within each cluster and the cluster center is calculated using a t-distribution to obtain the similarity distribution result Q.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the corrected adjacency matrix based on the set of corrected node features; The initial adjacency matrix and the modified adjacency matrix are input into a pre-set reconstruction error function to calculate the reconstruction error.

3. The method according to claim 2, characterized in that, The method further includes: The similarity distribution results and the final clustering results are input into a pre-set clustering loss function to calculate the clustering loss.

4. The method according to claim 3, characterized in that, The method further includes: The joint loss function is determined based on the clustering loss function and the reconstruction error function; Taking the derivative of the joint loss function, we obtain the derivative result; Backpropagation is performed based on the derivative result to update the network parameters of the attention mechanism module.

5. The method according to claim 1, characterized in that, The method further includes: A document clustering feature visualization is generated based on the final clustering results.

6. The method according to claim 1, characterized in that, The method further includes: Based on the final clustering results, the similarity of the candidate customer pool is calculated to obtain a similar customer group.

7. The method according to claim 1, characterized in that, Multiple customer characteristic data include consumption segmentation characteristics and customer value segmentation characteristics; Based on the ticket information, the feature vectors of each customer in the seed customer group are obtained, including: Obtain the ticket consumption behavior data of the seed customer group; Based on the aforementioned bill consumption behavior data, the bill consumption stratification characteristics and the customer value stratification characteristics are determined respectively.

8. The method according to claim 7, characterized in that, The tiered characteristics of bill consumption include a bill activity score; The characteristics of the tiered spending patterns of the bills are determined based on the bill spending behavior data, including: The most recent consumption, consumption frequency, and consumption amount are determined based on the aforementioned bill consumption behavior data. The bill activity score is then determined based on the most recent consumption, the consumption frequency, the consumption amount, and a preset bill activity evaluation logic.

9. The method according to claim 7, characterized in that, The stratified features of bill consumption include bill preference scores; The characteristics of the tiered spending patterns of the bills are determined based on the bill spending behavior data, including: Based on the bill consumption behavior data, determine the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, and the percentage of transactions. Based on the percentage of bills held for a preset number of days, the number of transactions, the transaction amount, the percentage of transactions, and the preset bill preference evaluation logic, determine the bill preference score.

10. A graph clustering device based on tickets, characterized in that, The device includes: The first acquisition module is used to acquire multiple customer feature vectors of the seed customer group based on the ticket. Each customer feature vector includes multiple customer feature data. The determination module is used to calculate the cosine distance between any two customer feature vectors, and to determine an initial adjacency matrix to characterize customer similarity based on each customer feature vector and the K customer feature vectors with the closest corresponding cosine distance. The initial adjacency matrix includes a set of initial node features. The first calculation module is used to calculate the initial adjacency matrix of the customer similarity through the attention mechanism module to obtain a set of corrected node features; The second calculation module is used to perform k-means clustering calculation on the set of modified node features to obtain the cluster center of each cluster, and calculate the similarity distribution results between the customer samples within each cluster and the cluster center. The third calculation module is used to calculate the final clustering result based on the similarity distribution result; The initial adjacency matrix is ​​calculated using the attention mechanism module to obtain a set of corrected node features, including: The attention mechanism module includes a graph attention layer, and a set of initial node features input to the graph attention layer is denoted as... Where N is the number of initial nodes, F is the number of features for each initial node, and the output of the graph attention layer is a set of corrected node features, denoted as... The number of correction nodes N remains constant, while the number of features of each correction node can be changed to F'. To transform the input features into high-dimensional features to obtain sufficient expressive power, each initial node undergoes a shared linear transformation. The parameters of this attention mechanism module are defined by a weight matrix. Let represent that a linear transformation on any initial node can be expressed as ; Share self-attention mechanism among each initial node; The attention coefficients between initial node i and initial node j can be calculated as follows: ; Should The coefficients represent the importance of the features of initial node i to initial node j; attention mechanism It is a single-layer feedforward neural network, represented by a weight vector: Attention mechanism Map the concatenated high-dimensional features of length 2F to a real number, which serves as the attention coefficient. ; The masked graph attention mechanism is adopted, which only allows adjacent nodes to participate in the attention mechanism of the current node, thereby introducing the structural information of the graph. Furthermore, the adjacent nodes are first-order adjacent nodes, which include the node itself. ; To facilitate comparison of attention coefficients between different initial nodes, the softmax function described above is used to normalize all attention coefficients for initial node i. The attention mechanism employs a shared weight linear transformation, masked self-attention, and LeakyReLU nonlinear normalization, and the calculation formula is as follows, where T represents transpose and || represents concatenation: ; After obtaining the normalized attention coefficients, the node's own features are updated by a linear combination of the features of neighboring nodes through a non-linear activation function, which is the output, thus obtaining the features of the corresponding corrected node: ; The output of the graph attention layer is a set of modified node features, denoted as... ; The step of performing k-means clustering on the set of modified node features to obtain the cluster centers of each cluster, and calculating the similarity distribution between the intra-cluster customer samples and the cluster centers of each cluster, includes: The pseudo-labels obtained by the k-means clustering algorithm are then used to perform k-means clustering on the node features obtained through the attention mechanism, resulting in the vector representation of the cluster centers of each cluster. The cluster centers can also be called the centroids. The feature representation of the cluster points of cluster u is denoted as... The similarity distribution between the customer samples within each cluster and the cluster center is calculated using a t-distribution to obtain the similarity distribution result Q.

11. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that executes the ticket-based graph clustering method according to any one of claims 1 to 9 when the processor is running.

12. A computer-readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the ticket-based graph clustering method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Clustering system and method

    CN111461225A

  • User clustering method and device, terminal equipment and storage medium

    CN114154590A