Product recommendation method and device based on homomorphic encryption DBSCAN, equipment and medium
By using the homomorphic encryption DBSCAN algorithm for data interaction, the issues of data security and real-time performance in financial scenarios are resolved. This enables privacy-preserving data interaction between the service provider and the requester, improving data interaction efficiency and recommendation accuracy.
Patent Information
- Application Number
- CN202511169406.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2026-01-06
AI Technical Summary
Existing technologies pose data security issues when used for data interaction in financial scenarios. They cannot enable direct privacy data interaction between service providers and requesters, and they cannot meet the requirements for real-time performance and low latency.
The DBSCAN algorithm with homomorphic encryption is used to encrypt the sample set data during interaction. The requester calculates the reachability matrix and performs customer group classification based on the reachability matrix. Finally, product recommendations are made based on the customer group classification results.
It enables calculations without exposing the original data of both parties, ensuring data privacy, improving the efficiency and accuracy of data interaction, and adapting to the real-time requirements of financial scenarios.
Smart Images

Figure CN121278418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data privacy technology, and in particular to a product recommendation method, apparatus, device, and medium based on homomorphic encryption DBSCAN. Background Technology
[0002] When conducting financial matching business on the platform, it is necessary to select the most suitable financial product for each user from a wide range of financial products offered by multiple funding sources. Currently, public data held by various government agencies records high-quality profile data of individuals across multiple dimensions, including education level, consumption habits, travel history, click preferences, occupation, gender, and age. Different communities have drastically different data distributions. Based on this data, the population is divided into multiple subgroups, and refined product recommendation strategies are developed based on historical data such as clicks, applications, approvals, and delinquencies of various financial products within the applicant's group.
[0003] In the field of machine learning, clustering, as an unsupervised learning method, aims to divide data points in a complex dataset into several different groups based on their inherent feature similarity. DBSCAN is one such method and has been widely applied in multiple fields.
[0004] Chinese patent CN119128640A discloses a DBSCAN classification method, apparatus, device, and medium based on secret sharing for privacy protection. It involves a service provider, a requester, and three independent, non-colluding proxy computing parties. The service provider and requester each possess different features of the same sample. The method includes the following steps: the service provider and requester secretly share and encrypt their respective sample features before sending them to the proxy computing parties; the proxy computing parties calculate a reachability matrix and send it to the requester; the requester executes the DBSCAN algorithm based on the reachability matrix to classify the data. However, this method requires three independent, non-colluding proxy computing parties to achieve encrypted data interaction. The requester and service provider have weak control over the data, and the interaction process is complex, increasing communication complexity and data transmission volume. It cannot directly achieve interaction between the requester and service provider and is unsuitable for the real-time and low-latency requirements of financial scenarios. Summary of the Invention
[0005] The purpose of this invention is to provide a product recommendation method, apparatus, device, and medium based on homomorphic encryption DBSCAN, which solves the data security problem of all parties being sensitive to their own data, and enables direct privacy data interaction between the service provider and the requester to classify customer groups, thereby making product recommendations based on the customer group classification results, meeting the real-time requirements of financial scenarios.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] According to a first aspect of the present invention, a product recommendation method based on homomorphic encryption DBSCAN is provided, the method comprising the following steps:
[0008] S1: Acquire user data related to financial scenarios, digitize it, and then randomly distribute it to the service provider and the requester to build their respective sample sets;
[0009] S2, the requester and the service provider exchange sample set data using a homomorphic encryption algorithm, and the reachability matrix is calculated by the requester;
[0010] S3, the requester executes the DBSCAN algorithm to classify customers in the financial scenario based on the reachability matrix;
[0011] S4, based on the customer group classification results, calculates the preference index of each user group for each product, performs probability sampling according to the preference index among all products, and makes product recommendations.
[0012] The user data includes education level data, travel data, and consumption and income data. The education level data is classified according to the education level and secondary variables are derived from the school level. The travel data includes the user's land, sea and air travel data, including total consumption amount, travel mileage and membership rating, and is assigned values according to preset threshold ranges. The consumption and income data includes the most recent consumption data, the average consumption over the past year, stability and current account status. The stability measures consumption fluctuations and is calculated by combining changes in consumption frequency and amount.
[0013] When there is only one service provider, step S2 includes the following steps:
[0014] The requester generates a public / private key pair;
[0015] The requesting party calculates the distance between each sample point in its sample set along the feature dimension and takes the sum of squares to obtain the first distance matrix, which is then encrypted using a public key and sent to the service provider.
[0016] The service provider calculates the distance between each sample point in its sample set along the feature dimension and takes the sum of squares to obtain the second distance matrix. The second distance matrix is then summed with the encrypted first distance matrix to obtain the encrypted total distance matrix.
[0017] The service provider calculates the difference between the total encrypted distance matrix and the square of the preset radius to obtain the encrypted difference matrix;
[0018] The service provider generates a random positive integer matrix of the same size as the encryption difference matrix, multiplies the random positive integer matrix by the corresponding elements in the encryption difference matrix to obtain the encryption judgment matrix, and sends it to the requester.
[0019] The requester decrypts the encrypted judgment matrix to obtain the judgment matrix, and calculates the reachable matrix based on the judgment matrix. If an element in the judgment matrix is less than or equal to 0, the corresponding element in the reachable matrix is assigned the value 1; if an element in the judgment matrix is greater than 0, the corresponding element in the reachable matrix is assigned the value 0.
[0020] When there are multiple service providers, step S2 includes the following steps:
[0021] The requester generates a public / private key pair;
[0022] The requesting party calculates the distance between each sample point in its sample set along the feature dimension and takes the sum of squares to obtain the first distance matrix, which is then encrypted using a public key and sent to the first service provider.
[0023] Each service provider performs the following steps to transmit the encrypted distance matrix: The current service provider calculates the distance between each sample point in its sample set in the feature dimension and takes the sum of squares to obtain the second distance matrix. It then calculates the sum of the second distance matrix and the distance matrix it received to obtain the encrypted third distance matrix. All service providers except the last one transmit the encrypted third distance matrix to the next service provider. The encrypted third distance matrix calculated by the last service provider is the total encrypted distance matrix. The distance matrix received by the first service provider is the encrypted first distance matrix sent by the requester, and the distance matrices received by the other service providers are the encrypted third distance matrices sent by the previous service provider.
[0024] The last service provider calculates the difference between the total encrypted distance matrix and the square of the preset radius to obtain the encrypted difference matrix, and generates a random positive integer matrix of the same size as the encrypted difference matrix. The random positive integer matrix is multiplied by the corresponding element in the corresponding encrypted difference matrix to obtain the corresponding encrypted judgment matrix, which is then sent to the requester.
[0025] The requester decrypts the encrypted judgment matrix to obtain the judgment matrix, and calculates the reachable matrix based on the judgment matrix. If an element in the judgment matrix is less than or equal to 0, the corresponding element in the reachable matrix is assigned the value 1; if an element in the judgment matrix is greater than 0, the corresponding element in the reachable matrix is assigned the value 0.
[0026] S3 includes the following steps:
[0027] S31, based on the reachability matrix, calculate the total number of reachable points for each sample point, where the total number of reachable points is the sum of the elements in the reachability matrix, and mark all sample points whose total number of reachable points is greater than the minimum number of cluster points as core points;
[0028] S32, randomly select an unclustered core point, mark it as clustered, generate a new cluster class, and traverse the remaining unclustered points. If the element corresponding to the reachable matrix between the core point and the traversed unclustered point is 1, then classify the unclustered point into the new cluster class and mark it as clustered.
[0029] S33, repeat step S32 until all core points have been marked, the classification is completed, and the remaining unclustered points are classified as noise set.
[0030] The preference metrics include the total click-through rate, total application rate, total loan disbursement rate, and total delinquency rate of the user group for each product.
[0031] The process of probabilistically sampling all products based on preference metrics for product recommendation specifically involves:
[0032] For each product, the user group's rating of the product is calculated based on preference indicators and corresponding weights, and the rating is normalized to obtain the recommendation probability; then, based on the recommendation probability, samples are taken from the products to select recommended financial products.
[0033] According to a second aspect of the present invention, a product recommendation apparatus based on homomorphic encryption DBSCAN is provided for implementing the method, the apparatus comprising:
[0034] Data acquisition and sample set construction module: Acquire user data related to financial scenarios, digitize it, and then randomly distribute it to the service provider and the requester to construct their respective sample sets;
[0035] Reachability matrix calculation module: The requester and the service provider exchange sample set data in encrypted form using a homomorphic encryption algorithm, and the requester calculates the reachability matrix.
[0036] Customer segmentation module: The requester performs customer segmentation in the financial scenario by executing the DBSCAN algorithm based on the reachability matrix;
[0037] Product recommendation module: Based on customer group classification results, calculate the preference index of each user group for each product, and perform probability sampling according to the preference index among all products to make product recommendations.
[0038] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described thereon.
[0039] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) This invention can perform calculations without exposing the original data of both parties, thus avoiding the leakage of data between the two parties. It does not require the participation of a secure and trusted third party, and directly realizes the privacy data interaction between the service provider and the requester, thereby improving the control of the data by both the service provider and the requester. Data privacy is guaranteed, and the direct interaction also reduces the number of data interactions, improves processing efficiency, and can better adapt to financial scenarios.
[0042] (2) After classifying the population, this invention improves the existing recommendation algorithm based on the uniqueness of financial products, optimizes the scheduling of existing financial scenario products, and improves the accuracy of recommendations.
[0043] (3) The present invention uses homomorphic encryption, which allows computational operations to be performed on data in an encrypted state without decrypting the data, and returns the result to the data owner after encryption. Compared with methods such as secret sharing, the principle of homomorphic encryption algorithm is simpler, avoiding the introduction of complex protocols and communication processes, and reducing the complexity and overhead of the system. Attached Figure Description
[0044] Figure 1 This is a flowchart of the method of the present invention;
[0045] Figure 2 This is a schematic diagram illustrating the privacy computation process of the reachable matrix when there is only one service provider. Detailed Implementation
[0046] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0047] This embodiment provides a product recommendation method based on homomorphic encryption DBSCAN. First, variable mining is performed on user data to digitize text tags, thus vectorizing the data spatially. Second, a clustering method using DBSCAN is implemented based on the full plaintext data. Further improvements are made to calculate the reachability matrix while protecting the characteristics and distance information of both parties, thereby achieving clustering. Finally, after classifying similar users, products are rated within each user group based on click-through rate, application rate, loan disbursement rate, and delinquency rate. Then, for other users within the same customer group, random sampling is performed using the rating as weight to select products to display on the promotion page.
[0048] Specifically, such as Figure 1 As shown, the method includes the following steps:
[0049] S1: Acquire user data related to financial scenarios, digitize it, and then randomly distribute it to the service provider and the requester to build their respective sample sets.
[0050] To comprehensively analyze users' preferences for financial products, multi-dimensional data was collected from multiple institutions, covering areas such as education, consumption, and travel. The preprocessing logic for some tags is as follows:
[0051] (1) Educational background data: The educational level is divided into 1 to 8 levels from low to high, representing different educational levels from primary school to doctoral degree. At the same time, secondary variables such as whether the school is a 985 or 211 university will be derived.
[0052] (2) Travel data: For personal land, sea and air travel data, the detailed data is processed based on the total consumption amount, travel mileage, club membership rating and other dimensions.
[0053] (3) Consumption and income data: The underlying detailed data is statistically summarized based on derivative logic such as the most recent amount, the average value over the past year, stability (volatility), and current status. Among them, stability measures consumption fluctuations and is calculated by combining changes in consumption frequency and amount.
[0054] For each party's portion of the labels, PCA dimensionality reduction is used to remove highly repetitive features within the same category. Subsequently, the PCA-reduced variables are normalized to unify the data dimensions to the range [0,1]. Examples of the labels used in privacy computation after the above processing are shown in Table 1 below, with each participating party (service provider and requester) retaining a portion of each label.
[0055] Table 1
[0056]
[0057] Currently, if population classification is needed based on data from two institutions, the feature information of both parties needs to be aggregated (either the requesting party provides its feature information to the service provider, the service provider provides its feature information to the requesting party, or both parties send their feature information to another third party). Then, the computing party that has aggregated the data from both parties completes the classification calculation based on the original feature information data. Therefore, in this process, at least one party has to expose its sensitive features or distance information. This embodiment proposes an encrypted data interaction method to achieve privacy protection. The specific implementation process is shown in steps S2 to S3 below.
[0058] S2, the requester and the service provider exchange sample set data using a homomorphic encryption algorithm, and the reachability matrix is calculated by the requester.
[0059] This embodiment first introduces a method for classification using DBSCAN when full plaintext data is obtained, and then introduces a method for calculating the reachability matrix while protecting the characteristics and distance information of both parties.
[0060] DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm that determines clusters based on the density surrounding data points. In DBSCAN, high-density regions are considered clusters, while low-density regions are considered noise.
[0061] The clustering steps for performing a complete DBSCAN operation on one side are as follows:
[0062] Step 1: Input:
[0063] 1) The feature matrix Xij for each point;
[0064] 2) Radius r;
[0065] 3) Minimum number of clustering points MinPts;
[0066] Step 2: Calculate the Euclidean distance between the two points and compare it with r to obtain the matrix β(β) indicating whether the two points are reachable. ij =1 represents reachable, β ij =0 represents unreachable;
[0067] Step 3: For each point i, calculate the total number of reachable points. Mark all points whose results are greater than MinPts as core points;
[0068] Step 4: Randomly select an unclustered core point, mark it as clustered, generate a new cluster class, and traverse the remaining unclustered points. If the β between the core point and this point ij = 1, this point is also classified into the new cluster class, and at the same time this point is marked as clustered;
[0069] Step 5: Loop Step 4 until all core points are marked, and classify the remaining unclustered points into the noise set.
[0070] Based on the above process, it can be seen that the solution of the reachability matrix is the core of DBSCAN clustering. This step introduces the method of calculating the DBSCAN reachability matrix through homomorphic encryption in the privacy scenario.
[0071] When there is only one service provider, the requester C has the first sample set, each sample of which contains m features, and the service provider has the second sample set, each sample of which contains k features. The number of samples in the first sample set and the second sample set is both n. As Figure 2 shown, the acquisition of the reachability matrix includes the following steps:
[0072] The requester C generates a public-private key pair (pk G , sk G ) of the CKKS encryption algorithm;
[0073] The requester C calculates the sum of the squares of the distances between each sample point in its sample set in the feature dimension to obtain the first distance matrix D1, where a ij is the sum of the squares of the feature distances between the i-th sample point X1 i and the j-th sample point X1 j in the first sample set X1, i, j = 1, 2, … n and i < j. After encrypting with the public key pk G , ||D1|| is sent to the service provider S;
[0074] The service provider S calculates the sum of the squares of the distances between each sample point in its sample set in the feature dimension to obtain the second distance matrix D2, where b ij is the sum of the squares of the feature distances between the i-th sample point X2 i and the j-th sample point X2 j in the first sample set X2. The service provider S sums the second distance matrix D2 and the encrypted first distance matrix ||D1|| to obtain the encrypted total distance matrix, that is, ||D|| = ||D1|| + D2;
[0075] The service provider S calculates the difference between the encrypted total distance matrix ||D|| and the square of the preset radius r to obtain the encrypted difference matrix, that is, ||D′|| = ||D|| - r 2 ;
[0076] The service provider S generates a random positive integer matrix of the same size as the encrypted difference matrix, and multiplies the corresponding elements in the random positive integer matrix and the encrypted difference matrix, that is, ||D″ ij || = ||D′ ij || * ∈ ij , to obtain the encrypted judgment matrix ||D″||, and send it to the requestor C;
[0077] The requestor C decrypts the encrypted judgment matrix ||D″|| to obtain the judgment matrix D″, and calculates the reachable matrix based on the judgment matrix. Among them, if the element d″ in the judgment matrix D″ ij is less than or equal to 0, the corresponding element β in the reachable matrix ij is assigned 1. If the element D″ in the judgment matrix D″ ij is greater than 0, the corresponding element β in the reachable matrix ij is assigned 0.
[0078] When there are multiple service providers, the requestor C has a first sample set, each sample in which contains m features, and each service provider has a corresponding sample set. Among them, each sample in the sample set corresponding to the a-th service provider contains k a features, and the number of samples in each sample set is n. The acquisition of the reachable matrix includes the following steps:
[0079] The requestor C generates a public-private key pair of the CKKS encryption algorithm (pk G , sk G );
[0080] The requestor C calculates the sum of squares of the distances between each sample point in its sample set in the feature dimension to obtain the first distance matrix D1. Among them, a ij is the sum of the squares of the feature distances between the i-th sample point X1 i and the j-th sample point X1 j in the first sample set X1, i, j = 1, 2, …n and i < j, and after encryption using the public key pk G , ||D1|| is sent to the first service provider S1;
[0081] Each service provider S performs the following steps to transfer the encrypted distance matrix: The current a-th service provider calculates the sum of squares of the distances between each sample point in its sample set in the feature dimension to obtain the second distance matrix D2 a , where, is the sum of the squares of the feature distances between the i-th sample point Xa iand the j-th sample point Xa j Calculate the second distance matrix D2 by summing the squared feature distances between them. a The first service provider calculates its own encrypted third distance matrix by summing it with the distance matrix it received. All service providers except the last one pass the calculated encrypted third distance matrix to the next service provider. The encrypted third distance matrix calculated by the last service provider is the total encrypted distance matrix. Specifically, the distance matrix received by the first service provider is the encrypted first distance matrix sent by the requester, and the distance matrices received by the other service providers are the encrypted third distance matrices sent by the previous service provider. That is, for the first service provider, ||D1|| + D21 = ||D31|| is calculated; for the second service provider, ||D31|| + D22 = ||D32|| is calculated, and so on. The total encrypted distance matrix calculated by the last service provider is ||D31|| + D22 = ||D32||. K-1 ||+D2 K =||D3 K ||=||D||, where K is the total number of service providers.
[0082] The last service provider S calculates the difference between the total encrypted distance matrix ||D|| and the square of the preset radius r, obtaining the encrypted difference matrix, i.e., ||D′|| = ||D|| - r. 2 Then, a random positive integer matrix of the same size as the encrypted difference matrix is generated, and the random positive integer matrix is multiplied by the corresponding element in the corresponding encrypted difference matrix, i.e., ||D″. ij ||=||D′ ij ||*∈ ij The corresponding encryption judgment matrix ||D″|| is obtained and sent to the requester C;
[0083] Requestor C decrypts the encrypted judgment matrix ||D″|| to obtain the judgment matrix D″, and calculates the reachable matrix based on the judgment matrix, where if the element D″ in the judgment matrix D″ is... ij If the value is less than or equal to 0, then the corresponding element β in the matrix can be reached. ij If assigned a value of 1, then the element D″ in matrix D″ is evaluated. ij If the value is greater than 0, then the corresponding element β in the matrix can be reached. ij It was assigned the value 0.
[0084] S3, the requester executes the DBSCAN algorithm to classify customers in the financial scenario based on the reachability matrix.
[0085] S31, Based on the reachability matrix, calculate the total number of reachable points for each sample point i. Mark all sample points whose total reachable points A is greater than the minimum clustering point number as core points;
[0086] S32, randomly select an unclustered core point, mark it as clustered, generate a new cluster class, and traverse the remaining unclustered points. If the reachability matrix between the core point and the traversed unclustered points corresponds to the element β... ij If the value is 1, then the unclustered point is classified into a new cluster and marked as clustered;
[0087] S33, repeat step S32 until all core points have been marked, complete the customer group classification, and classify the remaining un-clustered points into the noise set.
[0088] S4, based on the customer group classification results, calculates the preference index of each user group for each product, performs probability sampling according to the preference index among all products, and makes product recommendations.
[0089] Suppose there are N products, and the k-th user group C k There are M users. Calculate the user group C. k Preference indicators for each product include:
[0090] User Group C k Total click-through rate for each product: click ki = Total number of clicks / M, i∈[0,N-1]
[0091] User Group C k Overall application rate for all products: apply ki = Total number of applications / M, i∈[0,N-1]
[0092] User Group C k Overall loan-to-value ratio for all products: approve ki = Total loans / M, i∈[0,N-1]
[0093] User Group C k Total delinquency rate for each product: default ki = Total number of overdue payments / M, i∈[0,N-1]
[0094] The algorithm for recommending financial products references user-based collaborative filtering algorithms commonly used in e-commerce, and optimizes the calculation of customer similarity and rating logic to address the specific differences in product characteristics within the financial context. The calculation of user similarity is described in detail in the DBSCAN section. When it is necessary to recommend user group C... k When a user recommends a product, the specific steps for user rating and sampling are as follows:
[0095] For each product i, calculate the user group C based on preference metrics and corresponding weights. k Rate this product:
[0096] score ki = (2*click) ki +5*apply ki +10*approve ki -600*default ki )
[0097] The ratings are normalized using softmax to obtain the recommendation probability:
[0098]
[0099] The recommended financial products are selected by sampling based on the recommendation probability score′ within the product.
[0100] The above is an introduction to the method embodiments. The following describes the solution of the present invention further through device embodiments.
[0101] This embodiment provides a product recommendation device based on homomorphic encryption DBSCAN, used to implement the method described above. The device includes:
[0102] Data acquisition and sample set construction module: Acquire user data related to financial scenarios, digitize it, and then randomly distribute it to the service provider and the requester to construct their respective sample sets;
[0103] Reachability matrix calculation module: The requester and the service provider exchange sample set data in encrypted form using a homomorphic encryption algorithm, and the requester calculates the reachability matrix.
[0104] Customer segmentation module: The requester performs customer segmentation in the financial scenario by executing the DBSCAN algorithm based on the reachability matrix;
[0105] Product recommendation module: Based on customer group classification results, calculate the preference index of each user group for each product, and perform probability sampling according to the preference index among all products to make product recommendations.
[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0107] The electronic device of this invention includes a processor, which can be a field-programmable gate array (FPGA), application-specific integrated circuit (ASIC), system-on-chip (SoC), central processing unit (CPU), application processor (AP), digital signal processor (DSP), graphics processing unit (GPU), or neural-network processing unit (NPU), etc. The processor can execute various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from storage units into random access memory (RAM). The RAM can also store various programs and data required for device operation. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0108] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0109] The processor executes the various methods and processes described above, such as methods S1 to S4. For example, in some embodiments, methods S1 to S4 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the processor, one or more steps of methods S1 to S4 described above may be performed. Alternatively, in other embodiments, the processor may be configured to execute methods S1 to S4 by any other suitable means (e.g., by means of firmware).
[0110] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), and so on.
[0111] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0112] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0113] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A product recommendation method based on homomorphic encryption DBSCAN, characterized by, The method comprises the following steps: S1, obtaining user data related to a financial scene, performing digital processing, and randomly assigning to a service party and a request party to construct respective sample sets; S2, performing sample set data encryption interaction between the request party and the service party through a homomorphic encryption algorithm, and calculating an accessible matrix by the request party; S3, performing DBSCAN algorithm according to the accessible matrix to classify customer groups in the financial scene by the request party; S4, calculating preference indexes of each user group to each product based on the customer group classification result, performing probability sampling in all products according to the preference indexes, and performing product recommendation.
2. The product recommendation method based on homomorphic encryption DBSCAN according to claim 1, characterized in that, The user data comprises education data, travel data, consumption and income data, wherein the education data is classified according to education levels, and secondary variables are derived according to school levels; the travel data is sea-land-air travel data of the user, including total consumption amount, travel mileage and member rating, and is assigned according to a preset threshold interval; the consumption and income data comprises last consumption data, last year consumption average, stability and current account status, and the stability measures consumption fluctuation and is calculated in combination with consumption frequency and amount changes. 3.The product recommendation method based on homomorphic encryption DBSCAN of claim 1, wherein, When there is only one service party, the S2 comprises the following steps: The request party generates a public-private key pair; The request party calculates distances between each sample point in the sample set in the feature dimension and takes square sums to obtain a first distance matrix, and sends the first distance matrix to the service party after encryption using the public key; The service party calculates distances between each sample point in the sample set in the feature dimension and takes square sums to obtain a second distance matrix, and sums the second distance matrix and the encrypted first distance matrix to obtain an encrypted total distance matrix; The service party calculates a difference value between the encrypted total distance matrix and a square of a preset radius to obtain an encrypted difference matrix; The service party generates a random positive integer matrix with the same size as the encrypted difference matrix, multiplies corresponding elements in the random positive integer matrix and the encrypted difference matrix to obtain an encrypted judgment matrix, and sends the encrypted judgment matrix to the request party; The request party decrypts the encrypted judgment matrix to obtain a judgment matrix, and calculates an accessible matrix based on the judgment matrix, wherein if an element in the judgment matrix is less than or equal to 0, a corresponding element in the accessible matrix is assigned a value of 1, and if the element in the judgment matrix is greater than 0, the corresponding element in the accessible matrix is assigned a value of 0.
4. The product recommendation method based on homomorphic encryption DBSCAN according to claim 1, characterized in that, When there are multiple service parties, the S2 comprises the following steps: The request party generates a public-private key pair; The request party calculates distances between each sample point in the sample set in the feature dimension and takes square sums to obtain a first distance matrix, and sends the first distance matrix to the first service party after encryption using the public key; Each service party performs the following steps to transfer the encrypted distance matrix: the current service party calculates the distance between each sample point in its sample set in the feature dimension and takes the sum of squares to obtain a second distance matrix, calculates the sum of the second distance matrix and the distance matrix received by itself to obtain an encrypted third distance matrix, and the service party other than the last service party transfers the calculated encrypted third distance matrix to the next service party, and the last service party calculates the encrypted third distance matrix as the total encrypted distance matrix, wherein the distance matrix received by the first service party itself is the encrypted first distance matrix sent by the request party, and the distance matrix received by the remaining service parties themselves is the encrypted third distance matrix sent by the previous service party; The last service party calculates the difference between the total encrypted distance matrix and the square of the preset radius to obtain an encrypted difference matrix, generates a random positive integer matrix with the same size as the encrypted difference matrix, multiplies the random positive integer matrix with the corresponding elements in the encrypted difference matrix to obtain a corresponding encrypted judgment matrix, and sends the encrypted judgment matrix to the request party; The request party decrypts the encrypted judgment matrix to obtain a judgment matrix, and calculates a reachable matrix based on the judgment matrix, wherein if an element in the judgment matrix is less than or equal to 0, the corresponding element in the reachable matrix is assigned a value of 1, and if the element in the judgment matrix is greater than 0, the corresponding element in the reachable matrix is assigned a value of 0.
5. The product recommendation method based on homomorphic encryption DBSCAN according to claim 1, characterized in that, The S3 includes the following steps: S31, based on the reachable matrix, calculating the total number of reachable points for each sample point, the total number of reachable points being the sum of elements in the reachable matrix, and marking all sample points with a total number of reachable points greater than the minimum clustering point number as core points; S32, randomly selecting an unclustered core point, marking it as clustered, generating a new cluster class, and traversing the remaining unclustered points, if the corresponding element of the reachable matrix between the core point and the unclustered point traversed is 1, the unclustered point is classified into the new cluster class and marked as clustered; S33, repeating step S32 until all core points are marked, completing the classification, and classifying the remaining unclustered points into a noise set.
6. The product recommendation method based on homomorphic encryption DBSCAN according to claim 1, characterized in that, The preference index includes the total click rate, the total application rate, the total loan rate and the total overdue rate of the user group to each product.
7. The product recommendation method based on homomorphic encryption DBSCAN according to claim 1, characterized in that, The probability sampling according to the preference index in all products to recommend products is specifically: For each product, calculating the score of the user group to the product based on the preference index and the corresponding weight, and normalizing the score to obtain a recommendation probability; Sampling in the products based on the recommendation probability to select the recommended financial product. 8.A product recommendation device based on homomorphic encryption DBSCAN, characterized by, The device is used to implement the method in any of claims 1-7, and comprises: a data acquisition and sample set construction module: acquiring user data related to a financial scenario, performing digital processing, and then randomly distributing the data to service parties and a request party to construct respective sample sets; a reachable matrix calculation module: the request party and the service parties perform sample set data encryption interaction through a homomorphic encryption algorithm, and the request party calculates a reachable matrix; Customer classification module: the request party performs DBSCAN algorithm according to the reachable matrix to classify customers in the financial scenario; Product recommendation module: based on the customer classification result, the preference index of each user group to each product is calculated, and probability sampling is performed among all products according to the preference index to recommend products.
9. An electronic device comprising a memory and a processor, said memory having stored thereon a computer program, characterized in that, The processor executes the program to realize the method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the method of any one of claims 1-7. The processor executes the program to realize the method of any one of claims 1-7.
Citation Information
Patent Citations
DBSCAN classification method and device based on secret sharing privacy protection, equipment and medium
CN119128640A