Client information clustering method, device, processor and electronic device

By calculating the error function of customer information and optimizing the centroid selection using cosine distance, the inaccuracy of clustering caused by random centroid selection in the K-Means algorithm is solved, thus improving the accuracy and convergence speed of the clustering results.

CN116720094BActive Publication Date: 2026-06-09INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-06-16
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, the K-Means clustering algorithm randomly selects the initial centroid, which leads to discrete points or noisy data in the customer information being incorrectly used as centroids, resulting in inaccurate clustering results and slow convergence speed.

Method used

By calculating the error function of each customer information in the customer information set, the centroids that are close to other customer information are determined. Based on the determined centroids and other customer information, K centroids that are more dispersed are determined. The cosine distance method is used to optimize the selection of centroids until the target clustering result is obtained.

Benefits of technology

This improves the convergence speed and clustering quality of the K-Means algorithm, avoids using discrete points or noisy data as centroids, and enhances the accuracy and quality of clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116720094B_ABST
    Figure CN116720094B_ABST
Patent Text Reader

Abstract

This application discloses a clustering method, apparatus, processor, and electronic device for customer information. The method is applied in the field of big data technology and includes: S101, calculating the error function for each customer information in a customer information set to obtain a first error function, and determining the customer information corresponding to the first error function as a first centroid; S102, determining a first candidate centroid set based on the determined centroids and other customer information, and determining the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined; S103, clustering the customer information set based on the K centroids to obtain the target clustering result. This application solves the problem in related technologies where, when clustering customer information and randomly selecting centroids for clustering, discrete points or noisy data in the customer information may be used as centroids, leading to inaccurate clustering results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and more specifically, to a method, apparatus, processor, and electronic device for clustering customer information. Background Technology

[0002] Currently, to minimize default events in financial institutions (e.g., a loan becoming a bad debt), financial institution staff often need to assess customer creditworthiness when transacting with them and determine transaction strategies based on the assessment results. Existing methods for assessing customer credit typically involve clustering customers based on their transaction data with financial institutions and their asset situation, and then determining the customer's credit rating based on the clustering results.

[0003] In existing technologies, the K-Means clustering algorithm is generally used to classify customers. However, since the traditional K-Means clustering algorithm uses the method of randomly sampling the initial centroids to initialize the clustering algorithm, the randomly sampled initial centroids may be too scattered or too concentrated, and the initial centroids are unevenly distributed. This results in a slow convergence speed and poor clustering effect, which in turn leads to inaccurate customer classification results.

[0004] There is currently no effective solution to the problem that when clustering customer information in related technologies and using random selection to obtain the centroids for clustering, discrete points or noisy data in the customer information may be used as centroids, leading to inaccurate clustering results. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, processor, and electronic device for clustering customer information, in order to solve the problem in related technologies where, when clustering customer information and using a random selection method to obtain the centroids used for clustering, discrete points or noisy data in the customer information may be used as centroids, leading to inaccurate clustering results.

[0006] To achieve the above objectives, according to one aspect of this application, a clustering method for customer information is provided. The method includes: S101, calculating an error function for each customer information in a customer information set to obtain multiple error functions, determining a first error function from the multiple error functions, and identifying the customer information corresponding to the first error function as a first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; S102, determining a first candidate centroid set based on the determined centroids and other customer information in the customer information set excluding the determined centroids, and determining the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid; S103, clustering the customer information in the customer information set based on the K centroids to obtain a target clustering result.

[0007] Further, determining the first candidate centroid set based on the determined centroid and other customer information in the customer information set besides the determined centroid includes: calculating the cosine distance between the determined centroid and other customer information in the customer information set besides the determined centroid to obtain N cosine distances between each customer information and the determined centroid, wherein the determined centroid contains N centroids; determining the first customer information based on the N cosine distances between each customer information and the determined centroid, and determining the first customer information as the next candidate centroid; determining the first candidate centroid set based on the cosine distances between the next candidate centroid and other customer information in the customer information set besides the determined centroid.

[0008] Further, determining the next centroid based on the first candidate centroid set includes: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; obtaining a set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result; determining the next error function based on the determined error function and the set of candidate error functions; determining the target clustering result corresponding to the next error function, and determining the first candidate centroid corresponding to the target clustering result as the next centroid.

[0009] Further, performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results includes: combining the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; and performing M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0010] Further, obtaining the set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result includes: calculating the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; determining the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and combining the average candidate error functions of all the clustering results to obtain the set of candidate error functions.

[0011] Further, determining the next error function based on the determined error function and the set of candidate error functions includes: calculating the difference between the target error function and each candidate error function in the set of candidate error functions to obtain M differences, wherein the target error function is one of the determined error functions; sorting the M differences, and determining the candidate error function corresponding to the first difference as the next error function.

[0012] Furthermore, after clustering the customer information in the customer information set according to the K centroids to obtain the target clustering result, the method further includes: determining the K types of customers corresponding to the customer information in the customer information set according to the target clustering result; and adjusting the transaction strategy for each type of customer according to a preset transaction strategy.

[0013] To achieve the above objectives, according to another aspect of this application, a clustering apparatus for customer information is provided. The apparatus includes: a calculation unit, configured to calculate an error function for each customer information in a customer information set, obtaining multiple error functions; determining a first error function from the multiple error functions; and determining the customer information corresponding to the first error function as a first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; a first determination unit, configured to determine a first candidate centroid set based on the determined centroids and other customer information in the customer information set excluding the determined centroids; and to determine the next centroid based on the first candidate centroid set, repeating the steps of the first determination unit until K centroids are determined, wherein K is a positive integer greater than 3, and the determined centroids include the first centroid; and a clustering unit, configured to cluster the customer information in the customer information set based on the K centroids to obtain a target clustering result.

[0014] Further, the first determining unit includes: a first calculation subunit, configured to calculate the cosine distances between the determined centroid and other customer information in the customer information set other than the determined centroid, to obtain N cosine distances between each customer information and the determined centroid, wherein the determined centroid includes N centroids; a first determining subunit, configured to determine a first customer information based on the N cosine distances between each customer information and the determined centroid, and determine the first customer information as the next candidate centroid; and a second determining subunit, configured to determine the first candidate centroid set based on the cosine distances between the next candidate centroid and the customer information in the customer information set other than the determined centroid.

[0015] Further, the first determining unit includes: a clustering subunit, configured to perform M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; a second calculation subunit, configured to obtain a set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result; a third determining subunit, configured to determine the next error function based on the determined error function and the set of candidate error functions; and a fourth determining subunit, configured to determine the target clustering result corresponding to the next error function and determine the first candidate centroid corresponding to the target clustering result as the next centroid.

[0016] Furthermore, the clustering subunit includes: a first processing module, used to combine the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; and a clustering module, used to perform M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0017] Further, the second calculation subunit includes: a first calculation module, used to calculate the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; a determination module, used to determine the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and a second processing module, used to integrate the average candidate error functions of all the clustering results to obtain the set of candidate error functions.

[0018] Further, the third determining subunit includes: a second calculation module, used to calculate the difference between the target error function and each candidate error function in the candidate error function set to obtain M differences, wherein the target error function is one of the determined error functions; and a third processing module, used to sort the M differences and determine the candidate error function corresponding to the first difference as the next error function.

[0019] Furthermore, the device further includes: a second determining unit, configured to determine K types of customers corresponding to the customer information in the customer information set based on the target clustering result after clustering the customer information in the customer information set according to the K centroids; and an adjusting unit, configured to adjust the transaction strategy for each type of customer according to a preset transaction strategy.

[0020] To achieve the above objectives, according to one aspect of this application, a processor is provided for running a program, wherein the program executes the clustering method for customer information described in any of the above-mentioned embodiments.

[0021] To achieve the above objectives, according to one aspect of this application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the clustering method for customer information described in any of the above claims.

[0022] This application employs the following steps: S101, calculating the error function for each customer information in the customer information set to obtain multiple error functions, determining a first error function from the multiple error functions, and identifying the customer information corresponding to the first error function as the first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; S102, based on the determined centroids and other customer information in the customer information set excluding the determined centroids, determining a first candidate centroid set, and determining the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined, wherein K is a positive integer greater than 3, and the determined centroids include the first centroid; S103, clustering the customer information in the customer information set based on the K centroids to obtain the target clustering result, thus solving the problem in related technologies where, when clustering customer information and randomly selecting centroids for clustering, discrete points or noisy data in the customer information may be used as centroids, leading to inaccurate clustering results. By calculating the error function of each customer information in the customer information set, the first centroid that is closest to other customer information can be determined in the customer information set. Based on the determined centroid and the customer information in the customer information set other than the determined centroid, K centroids with a relatively dispersed distribution are determined. This avoids the problem of the traditional K-Means algorithm, which randomly selects discrete noisy data as centroids for clustering, resulting in poor clustering results. This improves the convergence speed and clustering quality of the K-Means algorithm, and further improves the clustering quality of customer information clustering results. Attached Figure Description

[0023] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0024] Figure 1 This is a flowchart of a clustering method for customer information provided in Embodiment 1 of this application;

[0025] Figure 2 This is a schematic diagram of an optional customer information clustering method provided according to Embodiment 1 of this application;

[0026] Figure 3 This is a schematic diagram of a clustering device for customer information according to Embodiment 2 of this application;

[0027] Figure 4 This is a schematic diagram of a clustering electronic device for customer information provided in Embodiment 5 of this application. Detailed Implementation

[0028] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0029] It should be noted that the user information (including but not limited to user device information, user personal information, user transaction information, user information stored in financial institutions, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, processed data, calculated data, input data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] Example 1

[0033] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a clustering method for customer information based on Embodiment 1 of this application, as shown below. Figure 1 As shown, the method includes the following steps:

[0034] Step S101: Calculate the error function for each customer information in the customer information set to obtain multiple error functions. Determine the first error function from the multiple error functions and determine the customer information corresponding to the first error function as the first centroid. Here, the error function is the sum of the squares of the cosine distances between the customer information and other customer information in the customer information set.

[0035] In this first embodiment, customer information refers to customer-related information stored in financial institutions, such as customer transaction information, customer asset information, and customer liability information. Customer information can also be processed customer information, such as customer credit rating information and customer risk rating information within financial institutions.

[0036] In an optional embodiment, the step of determining the first centroid in the customer information set can be as follows: Step S1011, calculate the error function of each customer information in the customer information set. For example, the customer information set includes customer information A, customer information B, and customer information C. The cosine distance between customer information A and customer information B is cosine distance D1, and the cosine distance between customer information A and customer information C is cosine distance D2. The error function of customer information A in the customer information set is the sum of the squares of cosine distance D1 and cosine distance D2. And calculate the error functions of customer information B and customer information C. Step S1012, among the error functions of each customer information in the customer information set, the smallest error function can be determined as the first error function, and the customer information corresponding to the first error function is determined as the first centroid. For example, the customer information set includes customer information A, customer information B, and customer information C, and the error function of customer information A is the smallest. Then, the error function of customer information A is determined as the first error function, and customer information A is determined as the first centroid.

[0037] It is important to note that before performing calculations on the customer information in the customer information set, it is necessary to obtain text data of customer information related to the customers and preprocess this text data to convert it into word vectors. The set of word vectors is then used to obtain the customer information set. Specifically, text data of customer information within a preset time period (e.g., 6 months, 1 year) is obtained from a preset database containing customer information of a financial institution. Then, the obtained text data of customer information is preprocessed (e.g., word segmentation, stop word removal, etc.) to obtain preprocessed customer information. Next, the preprocessed customer information is input into a word2vec model for further processing to obtain word vectors. Finally, the customer information set is composed of the word vectors corresponding to the customer information.

[0038] Step S102: Based on the determined centroids and other customer information in the customer information set excluding the determined centroids, determine the first candidate centroid set, and determine the next centroid based on the first candidate centroid set. Repeat step S102 until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid.

[0039] In this first embodiment, the determined centroid refers to the centroid determined when this step is performed, wherein the determined centroid includes at least a first centroid. For example, after determining the first centroid, the determined centroid is the first centroid, and step S102 can be specifically expressed as determining a first candidate centroid set based on the first centroid and customer information in the customer information set other than the first centroid, and determining a second centroid based on the first candidate centroid set; after determining the second centroid, the determined centroid is the first centroid and the second centroid, and step S102 can be specifically expressed as determining a third centroid based on the first centroid, the second centroid, and customer information in the customer information set other than the first centroid and the second centroid.

[0040] Step S103: Cluster the customer information in the customer information set according to the K centroids to obtain the target clustering result.

[0041] In this first embodiment, in order to classify customers into different categories, it is necessary to cluster the customer information in the customer information set according to the K centroids obtained in step S102.

[0042] In summary, the customer information clustering method provided in Embodiment 1 of this application, through step S101, calculates the error function of each customer information in the customer information set to obtain multiple error functions, determines the first error function from the multiple error functions, and determines the customer information corresponding to the first error function as the first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; step S102, based on the determined centroids and other customer information in the customer information set excluding the determined centroids, determines the first candidate centroid set, and determines the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined, wherein K is a positive integer greater than 3, and the determined centroids include the first centroid; step S103, clusters the customer information in the customer information set based on the K centroids to obtain the target clustering result, solving the problem in related technologies where, when clustering customer information and using a random selection method to obtain the centroids used for clustering, discrete points or noisy data in the customer information may be used as centroids, leading to inaccurate clustering results. By calculating the error function of each customer information in the customer information set, the first centroid that is closest to other customer information can be determined in the customer information set. Based on the determined centroid and the customer information in the customer information set other than the determined centroid, K centroids with a more dispersed distribution are determined. This avoids the problem of the traditional K-Means algorithm randomly selecting discrete noisy data (i.e., customer information in the customer information set that is far away from other customer information and has a more dispersed distribution) as centroids for clustering, which leads to poor clustering results. This improves the convergence speed and clustering quality of the K-Means algorithm, and further improves the clustering quality of customer information clustering results.

[0043] Optionally, in the customer information clustering method provided in Embodiment 1 of this application, determining the first candidate centroid set based on the determined centroids and other customer information in the customer information set excluding the determined centroids includes: calculating the cosine distance between the determined centroids and other customer information in the customer information set excluding the determined centroids to obtain N cosine distances between each customer information and the determined centroids, wherein the determined centroids contain N centroids; determining the first customer information based on the N cosine distances between each customer information and the determined centroids, and determining the first customer information as the next candidate centroid; and determining the first candidate centroid set based on the cosine distances between the next candidate centroid and other customer information in the customer information set excluding the determined centroids.

[0044] In this first embodiment, in order to determine the next centroid based on the determined centroid, N cosine distances between each customer information and the determined centroid can be calculated, the average distance of the N cosine distances can be obtained, and the customer information corresponding to the maximum average distance is determined as the first customer information, i.e. the next candidate centroid. The first candidate centroid set is composed of customer information in the customer information set whose cosine distance to the next candidate centroid is less than the threshold T1, and the next centroid is determined based on the first candidate centroid set.

[0045] In an optional embodiment, the customer information set includes customer information A, customer information B, customer information C, and customer information D, and customer information A has been determined to be the first centroid and customer information D to be the second centroid. The steps for determining the first candidate centroid set based on customer information A and customer information D (i.e., the determined centroids) and customer information B and customer information C (i.e., customer information in the customer information set other than the determined centroids) can be as follows:

[0046] Step S201: Calculate the cosine distance D1 between customer information B and customer information A as 0.6, the cosine distance D2 between customer information B and customer information D as 0.8 (i.e., the two cosine distances between customer information A and the determined centroid), the cosine distance D3 between customer information C and customer information A as 0.5, and the cosine distance D4 between customer information C and customer information D as 1.0;

[0047] Step S202: Calculate the average of cosine distance D1 and cosine distance D2 to obtain the average distance between customer information B and the determined centroid as 0.7. Calculate the average of cosine distance D3 and cosine distance D4 to obtain the average distance between customer information C and the determined centroid as 0.75. Determine the customer information C corresponding to the maximum average distance of 0.75 as the next candidate centroid, i.e. the third candidate centroid.

[0048] Step S203: If the cosine distance between customer information B and customer information C is greater than the threshold T1, then the first candidate centroid set includes only customer information C; if the cosine distance between customer information B and customer information C is less than or equal to the threshold T1, then the first candidate centroid set includes both customer information B and customer information C.

[0049] By calculating the N cosine distances between each customer information and the determined centroids, the customer information with the largest average distance from the determined centroids is determined as the next candidate centroid. Based on the next candidate centroid, a first candidate centroid set is determined, so that the next centroid determined from the first candidate centroid set is far from the determined centroids, thus obtaining centroids with a more dispersed distribution. This improves the quality of the centroids used for clustering, thereby improving the clustering quality of the clustering results.

[0050] Optionally, in the customer information clustering method provided in Embodiment 1 of this application, determining the next centroid based on the first candidate centroid set includes: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; obtaining a set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result; determining the next error function based on the determined error function and the set of candidate error functions; determining the target clustering result corresponding to the next error function, and determining the first candidate centroid corresponding to the target clustering result as the next centroid.

[0051] In this first embodiment, in order to determine the next centroid from the first candidate centroid set, the customer information set can be clustered M times based on the customer information in the first candidate centroid set and the determined centroids to obtain M clustering results. Then, the candidate error function in each cluster of each clustering result is calculated to obtain the candidate error function set corresponding to the M clustering results. The difference between each candidate error function in the candidate error function set and the last determined error function is calculated respectively. The candidate error function with the largest difference is determined as the next error function. The clustering result corresponding to the candidate error function with the largest difference is determined as the target clustering result. The candidate centroid corresponding to the target clustering result is determined as the next centroid.

[0052] Specifically, the first candidate centroid set includes customer information A and customer information B, the determined centroid is customer information C, the error function corresponding to customer information C is the first error function H1, and the customer information set also includes customer information D. The steps to determine the next centroid from the first candidate centroid set are as follows:

[0053] Step S301: Clustering is performed based on customer information A and customer information C (i.e., the determined centroids) to obtain clustering result Yac. Clustering result Yac contains two clusters (i.e., cluster G1 containing customer information A and cluster G2 containing customer information C). Clustering is performed based on customer information B and customer information C to obtain clustering result Ybc. Clustering result Ybc contains two clusters (i.e., cluster G3 containing customer information B and cluster G4 containing customer information C).

[0054] Step S302: Calculate the candidate error function H2 of the clustering result Yac (i.e., the candidate error function obtained by calculating the error functions of cluster G1 and cluster G2) and the candidate error function H3 of the clustering result Ybc, and form a candidate error function set by the candidate error function H2 and the candidate error function H3.

[0055] Step S303: Subtract the candidate error function H2 from the determined first error function H1 to obtain the difference L1, subtract the candidate error function H3 from the first error function H1 to obtain the difference L2, and determine the candidate error function H2 corresponding to the smaller difference L1 as the second error function (i.e. the next error function).

[0056] Step S304: Determine the clustering result Yac corresponding to the candidate error function H2 as the target clustering result, and determine the customer information A (i.e., candidate centroid) corresponding to the clustering result Yac as the second centroid (i.e., the next centroid).

[0057] By performing multiple clustering operations on customer information in the first candidate centroid set and the determined centroids, and evaluating the clustering quality of multiple clustering results (i.e., calculating the candidate error function for each clustering result and determining the next error function), the next centroid with better clustering results can be determined from the first candidate centroid set, thereby improving the quality of the centroids used for clustering and thus achieving the effect of improving the clustering quality of the clustering results.

[0058] Optionally, in the customer information clustering method provided in Embodiment 1 of this application, performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results includes: combining the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; and performing M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0059] Specifically, if the determined centroids are customer information A (i.e., the determined first centroid), customer information B (i.e., the determined second centroid), and customer information C (i.e., the determined third centroid), and the first candidate centroid set includes customer information D and customer information E, and the customer information set also includes customer information F and customer information H, then the customer information set is clustered twice based on the determined centroids (i.e., M equals 2), resulting in two clustering results as follows:

[0060] Step S401: Combine customer information A, customer information B, customer information C and customer information D to obtain the second candidate centroid set J1; combine customer information A, customer information B, customer information C and customer information E to obtain the second candidate centroid set J2.

[0061] Step S402: Clustering is performed based on the second candidate centroid set J1 {customer information A, customer information B, customer information C, customer information D}. The cosine distance between customer information F in the customer information set and customer information B in the second candidate centroid set J1 is the smallest. Customer information B and customer information F are assigned to the same cluster. The cosine distance between customer information H in the customer information set and customer information C in the second candidate centroid set J1 is the smallest. Customer information H and customer information C are assigned to the same cluster. The clustering result Y1 is obtained (i.e., including clusters G1 {customer information A}, G2 {customer information B, customer information F}, G3 {customer information C, customer information H}, G4 {customer information D}).

[0062] Step S403: Clustering is performed based on the second candidate centroid set J2 {customer information A, customer information B, customer information C, customer information E}. Customer information F in the customer information set has the smallest cosine distance with customer information A in the second candidate centroid set J2, so customer information A and customer information F are assigned to the same cluster. Similarly, customer information H in the customer information set has the smallest cosine distance with customer information E in the second candidate centroid set J2, so customer information H and customer information E are assigned to the same cluster, resulting in clustering result Y2 (i.e., including clusters G5 {customer information A, customer information F}, G6 {customer information B}, G7 {customer information C}, and G8 {customer information E, customer information H}).

[0063] By combining customer information from the first candidate centroid set with the determined centroids, M second candidate centroid sets are obtained. Clustering is then performed based on the M second candidate centroid sets to obtain M clustering results. This is beneficial for selecting the next centroid from the first candidate centroid set based on the clustering quality of the M clustering results, thereby improving the quality of the centroids used for clustering.

[0064] Optionally, in the clustering method for customer information provided in Embodiment 1 of this application, obtaining a set of candidate error functions corresponding to M clustering results based on the candidate error functions within each cluster in each clustering result includes: calculating the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; determining the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and combining the average candidate error functions of all clustering results to obtain a set of candidate error functions.

[0065] In this first embodiment, in order to evaluate the clustering quality of M clustering results, the error function of each cluster in each clustering result can be calculated, and the average candidate error function of each clustering result can be calculated to obtain a set of candidate error functions. Then, based on the set of candidate error functions, the clustering result with better clustering quality among the M clustering results can be determined.

[0066] Specifically, if clustering result Y1 contains clusters G1 and G2, the steps for calculating the average candidate error function of clustering result Y1 can be as follows: Step S501, calculate the average word vector of each customer information in cluster G1, and use the average word vector as the cluster center P1 of cluster G1; Step S502, calculate the sum of squares of the cosine distances between each customer information in cluster G1 and the cluster center P1. For example, the cosine distance between customer information A and the cluster center P1 is the cosine distance D1, and the cosine distance between customer information B and the cluster center P1 is the cosine distance D2. The candidate error function of cluster G1 is the sum of the squares of the cosine distances D1 and D2; Step S503, similarly, calculate the candidate error function of cluster G2; Step S504, calculate the average of the candidate error functions of cluster G1 and cluster G2 to obtain the average candidate error function of clustering result Y1.

[0067] By calculating the error function of each cluster in each clustering result, the clustering quality of the clustering result can be determined based on the error function of each cluster in each clustering result. This is helpful in determining the clustering result with the best clustering quality among M clustering results, and then determining the next centroid based on the clustering result with the best clustering quality, thereby improving the quality of the centroids used for clustering.

[0068] Optionally, in the clustering method for customer information provided in Embodiment 1 of this application, determining the next error function based on the determined error function and the set of candidate error functions includes: calculating the difference between the target error function and each candidate error function in the set of candidate error functions to obtain M differences, wherein the target error function is one of the determined error functions; sorting the M differences, and determining the candidate error function corresponding to the first difference as the next error function.

[0069] In this first embodiment, in order to determine the next centroid based on the clustering quality of the clustering results, the next error function can be determined from the candidate error functions based on the determined error function, and then the next centroid can be determined based on the next error function.

[0070] Specifically, the determined centroids include a first centroid C1 and a second centroid C2. The error function corresponding to the first centroid C1 is the first error function L1, and the error function corresponding to the second centroid C2 is the second error function L2. The candidate error function set includes candidate error functions LS1, LS2, and LS3. The process of determining the next error function from the candidate error function set can be as follows:

[0071] Step S601: Calculate the difference between the last determined error function in the determined error function set and each candidate error function in the candidate error function set, that is, the difference Y1 obtained by subtracting candidate error function LS1 from the second error function L2, the difference Y2 obtained by subtracting candidate error function LS2 from the second error function L2, and the difference Y3 obtained by subtracting candidate error function LS3 from the second error function L2.

[0072] Step S602: Sort the differences Y1, Y2 and Y3, and determine the first positive difference as the next error function.

[0073] By calculating the difference between the determined error function and the candidate error functions corresponding to the M clustering results, the obtained difference can be used to represent the clustering quality of the M clustering results. The candidate error function corresponding to the largest difference is determined as the next error function. The clustering result with the best clustering quality among the M clustering results can be determined as the next centroid, thus improving the quality of the centroid used for clustering.

[0074] Optionally, in the customer information clustering method provided in Embodiment 1 of this application, after clustering the customer information in the customer information set according to K centroids to obtain the target clustering result, the above method further includes: determining the K types of customers corresponding to the customer information in the customer information set according to the target clustering result; and adjusting the transaction strategy for each type of customer according to the preset transaction strategy.

[0075] In this first embodiment, to reduce transaction risks and default events within financial institutions, K types of customers can be identified based on the customer information contained in each cluster of the target clustering results. Then, the transaction strategies between the financial institution and different customer categories are adjusted according to preset transaction strategies. For example, for the first type of customer with good repayment credit, operations such as appropriately increasing loan amounts and extending repayment periods can be implemented to maintain a good transaction relationship between the financial institution and the first type of customer; for the second type of customer with poor repayment credit, operations such as appropriately decreasing loan amounts and shortening repayment periods can be implemented to reduce the risk of default events between the financial institution and the second type of customer. By adjusting the transaction strategies with different customer categories through the target clustering results, the probability of default events occurring within the financial institution is reduced.

[0076] Optionally, in this first embodiment, the process for determining the K centroids can be as follows: Figure 2As shown. Step 201: Collect customer information from multiple customers to obtain a customer information set Dataset. Step 202: Calculate the error function for each customer information in the customer information set Dataset, and select the customer information with the smallest error function as the first centroid C1. Step 203: Calculate the cosine distance between the first centroid C1 and other customer information in the customer information set Dataset, and select the customer information with the smallest cosine distance as the second candidate centroid Cn2. The first candidate centroid set list_C2 is composed of customer information in the customer information set Dataset whose cosine distance to the second candidate centroid Cn2 is less than a threshold T1. Step 204: Combine each customer information in the first candidate centroid set list_C2 with the first centroid C1 to obtain multiple second candidate centroid sets. Cluster the customer information set Dataset based on the multiple second candidate centroid sets to obtain the clustering result corresponding to each second candidate centroid set, and calculate the error function for each second candidate centroid set. Calculate the difference between the error function of each second candidate centroid set and the error function of the first centroid C1, and determine the largest and positive difference as the second error function, and determine the second centroid C2 based on the candidate centroid corresponding to the second error function. Step 205: Determine whether the number of determined centroids has reached K. Step 206: If the number of determined centroids has reached K, end the calculation; if the number of determined centroids has not reached K, repeat steps 207 to 210 until the number of determined centroids reaches K. Step 207: Calculate the average distance between each customer information in the customer information set Dataset and the determined centroids, determine the customer information corresponding to the maximum average distance as the next candidate centroid CnX, and form the first candidate centroid set list_CX by customer information whose cosine distance to CnX is less than T1. Step 208: Combine each customer information in list_CX with the determined centroids to obtain multiple second candidate centroid sets, and perform clustering based on each second candidate centroid set. Step 209: Determine the clustering result corresponding to each second candidate centroid set, and calculate the average error function corresponding to each second candidate centroid set. Determine the second candidate centroid set corresponding to the average error function with the largest difference from the previous error function and the difference being positive. Step 210: Based on the second candidate centroid sets determined in the previous step, determine the next centroid CX, and the error function corresponding to CX.

[0077] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0078] Example 2

[0079] This application also provides a customer information clustering device in Embodiment 2. It should be noted that the customer information clustering device in Embodiment 2 can be used to execute the customer information clustering method provided in Embodiment 1. The customer information clustering device provided in Embodiment 2 is described below.

[0080] Figure 3 This is a schematic diagram of a clustering device for customer information according to Embodiment 2 of this application. Figure 3 As shown, the device includes: a calculation unit 301, a first determination unit 302, and a clustering unit 303.

[0081] Specifically, the calculation unit 301 is used to calculate the error function of each customer information in the customer information set, obtain multiple error functions, determine the first error function from the multiple error functions, and determine the customer information corresponding to the first error function as the first centroid. The error function is the sum of the squares of the cosine distances between the customer information and other customer information in the customer information set.

[0082] The first determining unit 302 is used to determine a first candidate centroid set based on the determined centroids and other customer information in the customer information set other than the determined centroids, and to determine the next centroid based on the first candidate centroid set. The steps of the first determining unit are repeated until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid.

[0083] Clustering unit 303 is used to cluster customer information in the customer information set based on K centroids to obtain the target clustering result.

[0084] The customer information clustering device provided in Embodiment 2 of this application calculates the error function of each customer information in the customer information set by the calculation unit 301, obtains multiple error functions, determines the first error function from the multiple error functions, and determines the customer information corresponding to the first error function as the first centroid. The error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set. The first determination unit 302 determines the first candidate centroid set based on the determined centroids and other customer information in the customer information set other than the determined centroids, and determines the next centroid based on the first candidate centroid set. The steps of the first determination unit 302 are repeated until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid. The clustering unit 303 clusters the customer information in the customer information set based on the K centroids to obtain the target clustering result. This solves the problem in related technologies where, when clustering customer information and randomly selecting the centroids used for clustering, discrete points or noise data in the customer information may be used as centroids, leading to inaccurate clustering results. By calculating the error function of each customer information in the customer information set, the first centroid that is closest to other customer information can be determined in the customer information set. Based on the determined centroid and the customer information in the customer information set other than the determined centroid, K centroids with a relatively dispersed distribution are determined. This avoids the problem of the traditional K-Means algorithm, which randomly selects discrete noisy data as centroids for clustering, resulting in poor clustering results. This improves the convergence speed and clustering quality of the K-Means algorithm, and further improves the clustering quality of customer information clustering results.

[0085] Optionally, in the customer information clustering apparatus provided in Embodiment 2 of this application, the first determining unit 302 includes: a first calculation subunit, used to calculate the cosine distance between the determined centroid and other customer information in the customer information set other than the determined centroid, to obtain N cosine distances between each customer information and the determined centroid, wherein the determined centroid includes N centroids; a first determining subunit, used to determine a first customer information based on the N cosine distances between each customer information and the determined centroid, and to determine the first customer information as the next candidate centroid; and a second determining subunit, used to determine a first candidate centroid set based on the cosine distances between the next candidate centroid and the customer information in the customer information set other than the determined centroid.

[0086] Optionally, in the customer information clustering apparatus provided in Embodiment 2 of this application, the first determining unit 302 includes: a clustering subunit, used to perform M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; a second calculation subunit, used to obtain a set of candidate error functions corresponding to the M clustering results based on the candidate error functions in each cluster of each clustering result; a third determining subunit, used to determine the next error function based on the determined error function and the set of candidate error functions; and a fourth determining subunit, used to determine the target clustering result corresponding to the next error function and determine the first candidate centroid corresponding to the target clustering result as the next centroid.

[0087] Optionally, in the customer information clustering device provided in Embodiment 2 of this application, the above-mentioned clustering subunit includes: a first processing module, used to combine the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; and a clustering module, used to perform M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0088] Optionally, in the customer information clustering device provided in Embodiment 2 of this application, the second calculation subunit includes: a first calculation module, used to calculate the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; a determination module, used to determine the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and a second processing module, used to integrate the average candidate error functions of all clustering results to obtain a set of candidate error functions.

[0089] Optionally, in the customer information clustering device provided in Embodiment 2 of this application, the third determining subunit includes: a second calculation module, used to calculate the difference between the target error function and each candidate error function in the candidate error function set to obtain M differences, wherein the target error function is one of the determined error functions; and a third processing module, used to sort the M differences and determine the candidate error function corresponding to the first difference as the next error function.

[0090] Optionally, in the customer information clustering device provided in Embodiment 2 of this application, the device further includes: a second determining unit, used to determine the K types of customers corresponding to the customer information in the customer information set based on the target clustering result after clustering the customer information in the customer information set according to the K centroids; and an adjusting unit, used to adjust the transaction strategy for each type of customer according to a preset transaction strategy.

[0091] The customer information clustering device includes a processor and a memory. The aforementioned calculation unit 301, first determination unit 302, and clustering unit 303 are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to implement the corresponding functions.

[0092] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the accuracy of clustering results.

[0093] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0094] Embodiment 3 of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a clustering method for customer information.

[0095] Embodiment 4 of the present invention provides a processor for running a program, wherein the program executes a clustering method for customer information during runtime.

[0096] like Figure 4 As shown, Embodiment 5 of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: S101, calculates the error function of each customer information in the customer information set to obtain multiple error functions, determines a first error function from the multiple error functions, and determines the customer information corresponding to the first error function as the first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; S102, determines a first candidate centroid set based on the determined centroids and other customer information in the customer information set other than the determined centroids, and determines the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined, wherein K is a positive integer greater than 3, and the determined centroids include the first centroid; S103, clusters the customer information in the customer information set based on the K centroids to obtain the target clustering result.

[0097] When the processor executes the program, it also performs the following steps: determining the first candidate centroid set based on the determined centroid and other customer information in the customer information set other than the determined centroid includes: calculating the cosine distance between the determined centroid and other customer information in the customer information set other than the determined centroid to obtain N cosine distances between each customer information and the determined centroid, wherein the determined centroid contains N centroids; determining the first customer information based on the N cosine distances between each customer information and the determined centroid, and determining the first customer information as the next candidate centroid; determining the first candidate centroid set based on the cosine distances between the next candidate centroid and other customer information in the customer information set other than the determined centroid.

[0098] When the processor executes the program, it also performs the following steps: determining the next centroid based on the first candidate centroid set includes: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, where the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; obtaining a set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result; determining the next error function based on the determined error function and the set of candidate error functions; determining the target clustering result corresponding to the next error function, and determining the first candidate centroid corresponding to the target clustering result as the next centroid.

[0099] When the processor executes the program, it also performs the following steps: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, including: combining the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; performing M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0100] When the processor executes the program, it also performs the following steps: Based on the candidate error functions within each cluster in each clustering result, a set of candidate error functions corresponding to M clustering results is obtained, including: calculating the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; determining the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and combining the average candidate error functions of all clustering results to obtain the set of candidate error functions.

[0101] When the processor executes the program, it also performs the following steps: determining the next error function based on the determined error function and the candidate error function set includes: calculating the difference between the target error function and each candidate error function in the candidate error function set to obtain M differences, where the target error function is one of the determined error functions; sorting the M differences, and determining the candidate error function corresponding to the first difference as the next error function.

[0102] When the processor executes the program, it also performs the following steps: After clustering the customer information in the customer information set according to K centroids to obtain the target clustering result, the above method also includes: determining the K types of customers corresponding to the customer information in the customer information set according to the target clustering result; and adjusting the transaction strategy for each type of customer according to the preset transaction strategy.

[0103] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0104] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: S101, calculating the error function for each customer information in the customer information set to obtain multiple error functions, determining a first error function from the multiple error functions, and determining the customer information corresponding to the first error function as the first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; S102, determining a first candidate centroid set based on the determined centroids and other customer information in the customer information set excluding the determined centroids, and determining the next centroid based on the first candidate centroid set, repeating step S102 until K centroids are determined, wherein K is a positive integer greater than 3, and the determined centroids include the first centroid; S103, clustering the customer information in the customer information set based on the K centroids to obtain the target clustering result.

[0105] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: determining a first candidate centroid set based on a determined centroid and other customer information in the customer information set other than the determined centroid, including: calculating the cosine distance between the determined centroid and other customer information in the customer information set other than the determined centroid, obtaining N cosine distances between each customer information and the determined centroid, wherein the determined centroid contains N centroids; determining a first customer information based on the N cosine distances between each customer information and the determined centroid, and determining the first customer information as the next candidate centroid; determining the first candidate centroid set based on the cosine distances between the next candidate centroid and customer information in the customer information set other than the determined centroid.

[0106] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: determining the next centroid based on the first candidate centroid set includes: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, where the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; obtaining a set of candidate error functions corresponding to the M clustering results based on the candidate error functions within each cluster in each clustering result; determining the next error function based on the determined error function and the set of candidate error functions; determining the target clustering result corresponding to the next error function, and determining the first candidate centroid corresponding to the target clustering result as the next centroid.

[0107] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: performing M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, including: combining the determined centroids with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; performing M clustering operations on the customer information set based on the M second candidate centroid sets to obtain M clustering results.

[0108] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: obtaining a set of candidate error functions corresponding to M clustering results based on the candidate error functions within each cluster in each clustering result, including: calculating the error function of each cluster in each clustering result to obtain the candidate error function corresponding to each cluster in the clustering result; determining the average candidate error function of the clustering result based on the candidate error function corresponding to each cluster in the clustering result; and combining the average candidate error functions of all clustering results to obtain a set of candidate error functions.

[0109] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: determining the next error function based on the determined error function and the set of candidate error functions includes: calculating the difference between the target error function and each candidate error function in the set of candidate error functions to obtain M differences, where the target error function is one of the determined error functions; sorting the M differences and determining the candidate error function corresponding to the first difference as the next error function.

[0110] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: after clustering customer information in the customer information set according to K centroids to obtain the target clustering result, the above method further includes: determining the K types of customers corresponding to the customer information in the customer information set according to the target clustering result; and adjusting the transaction strategy for each type of customer according to the preset transaction strategy.

[0111] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0112] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0113] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0114] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0115] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0116] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0117] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0118] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. 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 apparatus that includes that element.

[0119] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A clustering method for customer information, characterized in that, include: S101, calculate the error function for each customer information in the customer information set to obtain multiple error functions, determine the first error function from the multiple error functions, and determine the customer information corresponding to the first error function as the first centroid, wherein the error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set; S102, based on the determined centroid and other customer information in the customer information set other than the determined centroid, determine the first candidate centroid set, and determine the next centroid based on the first candidate centroid set. Repeat step S102 until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid. S103, cluster the customer information in the customer information set according to the K centroids to obtain the target clustering result; Determining the next centroid based on the first candidate centroid set includes: The customer information set is clustered M times based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; Based on the candidate error functions within each cluster in each clustering result, a set of candidate error functions corresponding to the M clustering results is obtained; The next error function is determined based on the established error function and the set of candidate error functions; Determine the target clustering result corresponding to the next error function, and determine the first candidate centroid corresponding to the target clustering result as the next centroid.

2. The method according to claim 1, characterized in that, Based on the determined centroids and other customer information in the customer information set besides the determined centroids, the first candidate centroid set is determined to include: The cosine distances between the determined centroid and other customer information in the customer information set (excluding the determined centroid) are calculated to obtain N cosine distances between each customer information and the determined centroid, wherein the determined centroid contains N centroids. Based on the N cosine distances between each customer information and the determined centroid, the first customer information is determined, and the first customer information is determined as the next candidate centroid; The first candidate centroid set is determined based on the cosine distance between the next candidate centroid and the customer information in the customer information set excluding the determined centroids.

3. The method according to claim 1, characterized in that, Based on the first candidate centroid set and the determined centroids, the customer information set is clustered M times to obtain M clustering results, including: The determined centroids are combined with each customer information in the first candidate centroid set to obtain M second candidate centroid sets; The customer information set is clustered M times based on the M second candidate centroid sets to obtain M clustering results.

4. The method according to claim 1, characterized in that, Based on the candidate error functions within each cluster in each clustering result, the set of candidate error functions corresponding to the M clustering results is obtained, including: The error function of each cluster in each clustering result is calculated to obtain the candidate error function corresponding to each cluster in the clustering result; The average candidate error function of the clustering result is determined based on the candidate error function corresponding to each cluster in the clustering result; The set of candidate error functions is obtained by combining the average candidate error functions of all the clustering results.

5. The method according to claim 1, characterized in that, Determining the next error function based on the established error function and the set of candidate error functions includes: Calculate the difference between the target error function and each candidate error function in the set of candidate error functions to obtain M difference values, wherein the target error function is one of the determined error functions; The M differences are sorted, and the candidate error function corresponding to the first difference is determined as the next error function.

6. The method according to claim 1, characterized in that, After clustering the customer information in the customer information set according to the K centroids to obtain the target clustering result, the method further includes: Based on the target clustering results, determine the K types of customers corresponding to the customer information in the customer information set; The trading strategy for each type of client is adjusted based on the preset trading strategy.

7. A clustering device for customer information, characterized in that, include: The calculation unit is used to calculate the error function of each customer information in the customer information set to obtain multiple error functions, determine the first error function from the multiple error functions, and determine the customer information corresponding to the first error function as the first centroid. The error function is the sum of squares of the cosine distances between the customer information and other customer information in the customer information set. The first determining unit is configured to determine a first candidate centroid set based on the determined centroid and other customer information in the customer information set other than the determined centroid, and determine the next centroid based on the first candidate centroid set. The steps of the first determining unit are repeated until K centroids are determined, where K is a positive integer greater than 3, and the determined centroids include the first centroid. A clustering unit is used to cluster customer information in the customer information set based on the K centroids to obtain the target clustering result. The first determining unit includes: a clustering subunit, used to perform M clustering operations on the customer information set based on the first candidate centroid set and the determined centroids to obtain M clustering results, wherein the first candidate centroid set contains M customer data, M is an integer, and the clustering results contain multiple clusters; a second calculation subunit, used to obtain a set of candidate error functions corresponding to the M clustering results based on the candidate error functions in each cluster of each clustering result; a third determining subunit, used to determine the next error function based on the determined error function and the set of candidate error functions; and a fourth determining subunit, used to determine the target clustering result corresponding to the next error function and determine the first candidate centroid corresponding to the target clustering result as the next centroid.

8. A processor, characterized in that, The processor is used to run a program, wherein the program executes the clustering method for customer information according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the clustering method for customer information as described in any one of claims 1 to 6.