Customer rating calculation methods, devices, storage media and electronic equipment
By associating and computing homomorphically encrypted data in a trusted execution environment, the problem of low customer rating accuracy caused by uneven computing resources among enterprises is solved, and efficient and accurate customer rating results are achieved.
Patent Information
- Application Number
- CN202611559665.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-09
- Publication Date
- 2026-11-17
AI Technical Summary
Without transferring the data itself, joint computing between enterprises results in low customer rating accuracy due to imbalances in computing power or hardware and software conditions, and the range of data available for joint computing is small.
In a trusted execution environment, homomorphic encryption technology is used to correlate and calculate encrypted data from data providers and the production environment to obtain customer rating results, ensuring that the data always remains in encrypted form and avoiding decryption and plaintext transmission.
It improved the accuracy of customer ratings, reduced the hardware and software requirements for data providers and production environments, simplified the coordination process, and improved computational efficiency.
Smart Images

Figure CN123118149A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a customer rating calculation method, apparatus, storage medium and electronic device. Background Technology
[0002] As data applications become increasingly sophisticated, businesses need to leverage data held by other companies or institutions to perform calculations, in addition to their own data, when conducting customer rating and other business operations. The data held by these entities includes customers' personal and business information. When this data is provided externally, it is subject to relevant compliance requirements, necessitating collaboration with other parties to complete calculations without transferring the data itself.
[0003] Currently, enterprises rely primarily on secure multi-party computation (SMPC) to collaborate on computations without transferring the data itself. SMPC involves all participating parties jointly executing a computation protocol, requiring each party to contribute corresponding computing power and hardware / software resources. Parties with weaker computing power or hardware / software capabilities may be unable to undertake this, limiting collaborative computation to parties with comparable resources. This results in a limited range of data available for collaborative computation and low accuracy in customer ratings. Summary of the Invention
[0004] The technical problem this application aims to solve is to provide a customer rating calculation method, apparatus, storage medium, and electronic device that can effectively improve the accuracy of customer ratings. The specific solution is as follows:
[0005] A customer rating calculation method, comprising:
[0006] In response to receiving first homomorphic encrypted data sent by the data provider and second homomorphic encrypted data sent by the production environment, the computing task configuration corresponding to the customer to be rated is read in the trusted execution environment. The first homomorphic encrypted data is obtained by the data provider homomorphically encrypting the rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting the customer information data of the customer to be rated.
[0007] Based on the computing task configuration, determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data;
[0008] According to the ciphertext association field, the first homomorphic encrypted data and the second homomorphic encrypted data are associated to obtain the target homomorphic encrypted data;
[0009] According to the algorithm type, the target homomorphic encrypted data is ciphertext calculated in the trusted execution environment to obtain the ciphertext calculation result;
[0010] The encrypted calculation result is sent to the production environment so that the production environment can perform homomorphic decryption on the encrypted calculation result to obtain the customer rating result of the customer to be rated.
[0011] Optionally, in the above method, determining the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data according to the computing task configuration includes:
[0012] Based on the customer type and industry of the customer to be rated, determine the target configuration record corresponding to the customer to be rated from the calculation task configuration;
[0013] Read the ciphertext association field and the algorithm type from the target configuration record.
[0014] Optionally, after reading the ciphertext association field and the algorithm type from the target configuration record, the above method further includes:
[0015] Read the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data from the target configuration record;
[0016] If the homomorphic encryption type corresponding to the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data are different, the ciphertext calculation is not performed, and a re-encryption instruction is sent to the data provider and at least one of the production environments.
[0017] Optionally, in the above method, the step of performing ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type to obtain the ciphertext calculation result includes:
[0018] Read the data sources required for rating and the weights allocated to rating calculation from the aforementioned computing task configuration;
[0019] According to the algorithm type, the target homomorphic encrypted data is ciphertext calculated in the trusted execution environment to obtain the intermediate ciphertext calculation result corresponding to the data source required for the rating.
[0020] According to the weights assigned to the rating calculations, the intermediate ciphertext calculation results corresponding to the data sources required for the rating are weighted to obtain the ciphertext calculation results.
[0021] Optionally, after reading the computing task configuration corresponding to the customer to be rated in the trusted execution environment, the above method further includes:
[0022] The system receives multiple sets of candidate homomorphic encrypted data sent by the data provider, wherein the multiple sets of candidate homomorphic encrypted data are obtained by the data provider homomorphically encrypting the rating source data according to multiple homomorphic encryption types.
[0023] In the trusted execution environment, ciphertext computation is performed on the multiple sets of candidate homomorphic encrypted data to obtain the computation time corresponding to each set of candidate homomorphic encrypted data;
[0024] The set of candidate homomorphic encrypted data with the shortest computation time is determined as the first homomorphic encrypted data.
[0025] The above methods may also include:
[0026] When there are multiple customers to be rated, batch ciphertext calculation is performed on the first homomorphic encrypted data and the second homomorphic encrypted data corresponding to the multiple customers to be rated to obtain the ciphertext calculation result corresponding to each customer to be rated.
[0027] Optionally, in the above method, the step of associating the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data includes:
[0028] In the trusted execution environment, according to the value of the ciphertext association field, the ciphertext data corresponding to the same customer in the first homomorphic encrypted data and the second homomorphic encrypted data are associated to obtain the target homomorphic encrypted data. During the association process, the first homomorphic encrypted data and the second homomorphic encrypted data remain in ciphertext state.
[0029] A customer rating calculation device, comprising:
[0030] The receiving unit is used to receive first homomorphic encrypted data sent by the data provider and second homomorphic encrypted data sent by the production environment. The first homomorphic encrypted data is obtained by the data provider homomorphically encrypting the rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting the customer information data of the customer to be rated.
[0031] The reading unit is used to read the computing task configuration corresponding to the customer to be rated in a trusted execution environment.
[0032] The determining unit is configured to determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data based on the computing task configuration.
[0033] The association unit is used to associate the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data;
[0034] A computing unit is configured to perform ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type, and obtain the ciphertext calculation result;
[0035] The sending unit is used to send the ciphertext calculation result to the production environment, so that the production environment can perform homomorphic decryption on the ciphertext calculation result to obtain the customer rating result of the customer to be rated.
[0036] A storage medium comprising stored instructions, wherein, when the instructions are executed, the device in which the storage medium resides executes the customer rating calculation method described above.
[0037] An electronic device includes a memory and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described above in the customer rating calculation method.
[0038] This application provides a customer rating calculation method, apparatus, storage medium, and electronic device. The method includes: responding to receiving first homomorphic encrypted data sent by a data provider and second homomorphic encrypted data sent by a production environment; reading a calculation task configuration corresponding to a customer to be rated in a trusted execution environment; wherein the first homomorphic encrypted data is obtained by the data provider homomorphically encrypting rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting customer information data of the customer to be rated; determining a ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data according to the calculation task configuration; associating the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain target homomorphic encrypted data; performing ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type to obtain a ciphertext calculation result; and sending the ciphertext calculation result to the production environment so that the production environment homomorphically decrypts the ciphertext calculation result to obtain the customer rating result of the customer to be rated. Applying the method provided in this application can effectively improve the accuracy of customer rating. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 A flowchart of a customer rating calculation method provided in this application;
[0041] Figure 2 An example diagram for customer rating calculation provided in this application;
[0042] Figure 3 A flowchart illustrating a customer rating calculation scheduling process provided in this application;
[0043] Figure 4 A schematic diagram of a customer rating calculation device provided in this application;
[0044] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a 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 a process, method, article, or apparatus. Without further limitation, 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 said element.
[0047] This application provides a customer rating calculation method. This method can be applied to a computing device, which can be a server or server cluster deployed in a trusted execution environment. The method flowchart is shown below. Figure 1 As shown, it specifically includes:
[0048] S101: In response to receiving the first homomorphic encrypted data sent by the data provider and the second homomorphic encrypted data sent by the production environment, read the computing task configuration corresponding to the customer to be rated in the trusted execution environment.
[0049] In this embodiment, the data provider is an enterprise or institution holding data used in customer rating calculations, such as a raw materials company, a power company, a transportation company, or a judicial authority. The rating source data is the data held by the data provider and used in customer rating calculations, such as tax data for raw materials companies, electricity consumption data for power companies, and transportation document data for transportation companies. The first homomorphically encrypted data is the ciphertext data obtained by the data provider homomorphically encrypting the rating source data.
[0050] In this embodiment, the customer to be rated is a customer whose rating calculation requires the use of rating source data, such as a corporate or individual customer applying for credit. Customer information data refers to data related to the customer to be rated, such as credit amount, guarantee status, and historical performance records. The second homomorphically encrypted data is ciphertext data obtained by homomorphically encrypting the customer information data in the production environment. The production environment is the environment in which the data recipient runs its own business system; customer information data is generated and stored in the production environment. The data recipient is an enterprise that needs to use rating source data to complete the customer rating calculation, such as banks, insurance companies, securities firms, and other financial institutions.
[0051] In this embodiment, the Trusted Execution Environment (TEE) is a secure computing area built by the data receiver based on hardware-level system isolation. Data loaded into the TEE is subject to memory encryption and instruction isolation, ensuring that the code and data within the TEE are not accessed by other systems or software. The computing task configuration is configuration information maintained by the data receiver, used for unified management of customer rating computing tasks and read within the TEE.
[0052] Optionally, the data provider performs homomorphic encryption on the rating source data according to the homomorphic encryption type and algorithm type recorded in the computing task configuration, obtaining the first homomorphically encrypted data, which is then sent to the data recipient via the Internet or a dedicated line. Sending can be done in batches or in real-time. The first homomorphically encrypted data remains ciphertext during transmission and upon arrival at the data recipient. The data provider does not need to provide the data recipient with a decryption key, nor does it need to adjust its existing hardware and software environment, nor does it need to build a secure operating environment for ciphertext computation on its own side.
[0053] Optionally, the trusted execution environment can also provide remote authentication. Before sending encrypted data, the data provider and production environment can verify the trustworthiness of the peer's computing environment through remote authentication, and only send the encrypted data after verification.
[0054] During implementation, the computation task configuration is maintained by the computation task configuration management module. This module configures and manages customer rating computation tasks through the computation task configuration table. When a configuration change occurs, the values of the configuration fields read in the trusted execution environment are updated accordingly.
[0055] Optionally, the method provided in this embodiment can be executed by a computing task scheduling and execution device deployed in a trusted execution environment. The computing task scheduling and execution device receives the first homomorphic encrypted data sent by the data provider and the second homomorphic encrypted data sent by the production environment, completes the ciphertext calculation according to the computing task configuration, and returns the ciphertext calculation result to the production environment.
[0056] S102: Based on the computing task configuration, determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data.
[0057] In this embodiment, the computation task configuration includes the customer type and the customer's industry, as well as the data source required for rating, homomorphic encryption type, algorithm type, ciphertext association field, and the weight allocated to the rating calculation. The customer type and the customer's industry are the primary key fields in the computation task configuration, which together identify a record; the data source required for rating, homomorphic encryption type, algorithm type, ciphertext association field, and the weight allocated to the rating calculation are configuration fields, and the values of each configuration field correspond one-to-one with the primary key fields.
[0058] In this embodiment, the customer type is used to distinguish whether the customer to be rated is a corporate customer or an individual customer. The customer's industry category represents the industry to which the customer to be rated belongs, such as agriculture, mining, or manufacturing. The data source required for rating indicates the industry of the rating source data participating in the customer rating calculation, such as raw materials, power, or transportation. The homomorphic encryption type indicates the homomorphic encryption method used for the first and second homomorphic encrypted data, such as semi-homomorphic encryption, finite-times fully homomorphic encryption, or fully homomorphic encryption. The algorithm type indicates the homomorphic encryption algorithm used for ciphertext calculation. The ciphertext association field is used for association matching between the first and second homomorphic encrypted data, such as personal identification number, enterprise organization code, or enterprise unified social credit code. The weight of the rating calculation represents the proportion of each type of rating source data in the customer rating calculation, for example, raw materials industry data accounts for 20%, and power industry data accounts for 10%.
[0059] Specifically, one record in the calculation task configuration could be: When the customer to be rated is a legal entity and belongs to the manufacturing industry, the data source for the rating is power industry data, the homomorphic encryption type is finite-times fully homomorphic encryption, the algorithm type is an algorithm based on the discrete logarithm difficulty for security, the encrypted association field is the enterprise's unified social credit code, and the weight of the rating calculation is 20%. This record indicates that when the customer to be rated is a legal entity and belongs to the manufacturing industry, the customer rating calculation uses power industry data, two sets of encrypted data are generated using finite-times fully homomorphic encryption and the above algorithm, the two sets of encrypted data use the enterprise's unified social credit code as the encrypted association field, and power industry data accounts for 20% of the customer rating calculation. The homomorphic encryption type and algorithm type in the same record determine the encryption method and encrypted operation method used in the customer rating calculation.
[0060] Optionally, the algorithm for semi-homomorphic encryption can be selected from algorithms based on the difficulty of integer factorization, algorithms based on the difficulty of discrete logarithms, algorithms based on the residue class determination problem, and algorithms based on the difficult problem of bilinear mapping; the algorithm for fully homomorphic encryption can be selected from various homomorphic encryption schemes based on the difficulty of lattice problems.
[0061] S103: According to the ciphertext association field, associate the first homomorphic encrypted data and the second homomorphic encrypted data to obtain the target homomorphic encrypted data.
[0062] In this embodiment, the target homomorphically encrypted data is the ciphertext data obtained after association according to the ciphertext association field, which is the ciphertext data that enters the ciphertext calculation. The association process is completed in the ciphertext state, and the trusted execution environment does not need to decrypt it.
[0063] In practice, the values of the ciphertext association field in the first homomorphic encrypted data are read first, and then the values of the ciphertext association field in the second homomorphic encrypted data are read. Ciphertext data with different values have no matching records and are not included in the customer rating calculation; these ciphertext data are discarded. Ciphertext data with the same values correspond to the same customer, and the ciphertext data corresponding to the same customer are associated. The associated ciphertext data is used as the target homomorphic encrypted data and enters the subsequent ciphertext calculation.
[0064] Optionally, the values of the encrypted association field are compared within a trusted execution environment. The encrypted association field itself does not participate in the customer rating calculation; it only serves as an index between two encrypted data sets. Therefore, the encrypted data of the encrypted association field can be decrypted and compared within the trusted execution environment. The encrypted association field used as an index is not output externally after decryption. The business fields involved in the rating in the rating source data and customer information data are never decrypted.
[0065] Optionally, during batch processing, the first homomorphic encrypted data and the second homomorphic encrypted data include ciphertext data of multiple customers to be rated. The association is grouped according to the value of the ciphertext association field, and the ciphertext data corresponding to the same customer is grouped into the same group.
[0066] S104: According to the algorithm type, perform ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment to obtain the ciphertext calculation result.
[0067] In this embodiment, ciphertext computation is a computation directly performed on ciphertext data by the trusted execution environment. The result of the computation, after decryption, is consistent with the result obtained by performing the same computation on plaintext. Ciphertext computation includes, for example, homomorphic addition and homomorphic multiplication operations, and may also include multiplication operations between ciphertext and plaintext data. During the ciphertext computation process, the trusted execution environment may not decrypt the ciphertext data; the rating source data and customer information data remain in ciphertext state at all times.
[0068] It should be noted that different homomorphic encryption types support different types of homomorphic operations and different numbers of operations. Semi-homomorphic encryption only supports homomorphic addition or only homomorphic multiplication; finite-time fully homomorphic encryption supports both homomorphic addition and multiplication, but limits the number of multiplication operations; fully homomorphic encryption supports any number of homomorphic addition and multiplication operations. The types and number of operations required for customer rating calculations are matched to the homomorphic encryption type.
[0069] Specifically, ciphertext computation requires weighting and summarizing the results of each intermediate ciphertext computation. Weighting is achieved through multiplication between the ciphertext data and the plaintext weights, and summarization is achieved through homomorphic addition. The final ciphertext computation result is still ciphertext data.
[0070] S105: The ciphertext calculation result is sent to the production environment so that the production environment can perform homomorphic decryption on the ciphertext calculation result to obtain the customer rating result of the customer to be rated.
[0071] In this embodiment, the customer rating result is obtained by homomorphically decrypting the encrypted calculation result, such as the rating level, rating score, or the range in which the rating falls. The key used for homomorphic decryption is held by the production environment, while the trusted execution environment does not hold the decryption key. Therefore, the trusted execution environment does not access the plaintext of the rating source data and customer information data during the customer rating calculation process, achieving usability without visibility of the rating source data and customer information data.
[0072] In practice, after receiving customer rating results, the production environment further transmits these results to its own business system for use in business processes such as determining credit limits or interest rate pricing for customers to be rated. The data provider does not participate in the decryption of customer rating results, nor does it request the plaintext of the rating source data from the data recipient; the data held by both parties remains within their own control.
[0073] Through the above steps, this application completes the association and ciphertext calculation of two encrypted data sets from different sources within a trusted execution environment. The rating source data and customer information data remain encrypted throughout the transmission, association, and calculation processes. The data provider and the production environment do not need to provide plaintext data or decryption keys to each other. The customer rating result is obtained by the production environment holding the decryption key, achieving data usability without visibility. Compared to multi-party secure computation, this embodiment does not require each data provider to possess equivalent computing power and hardware / software conditions, nor does it require multiple rounds of communication coordination among multiple participants. Only the data receiver needs to build a trusted execution environment to complete the customer rating calculation; the data provider only bears the overhead of homomorphic encryption. Applying the method provided in this embodiment can effectively improve the accuracy of customer ratings.
[0074] In one embodiment provided in this application, based on the above scheme, optionally, determining the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data according to the computing task configuration includes: determining the target configuration record corresponding to the customer to be rated from the computing task configuration according to the customer type and industry of the customer to be rated; and reading the ciphertext association field and the algorithm type from the target configuration record.
[0075] In this embodiment, the target configuration record is a record in the calculation task configuration corresponding to the customer to be rated. In practice, firstly, based on the customer type and industry of the customer to be rated, a record corresponding to the customer rating calculation is located in the calculation task configuration, and this located record is used as the target configuration record. For example, if the customer to be rated is a legal entity and belongs to the manufacturing industry, the record with the customer type being a legal entity and the industry being manufacturing is located. Subsequently, the ciphertext association field and algorithm type are read from the target configuration record. The read ciphertext association field and algorithm type are the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data. For customers to be rated with different customer types and industries, the data sources required for the rating and the weight of the rating calculation are also different; all configuration fields are based on the values in the target configuration record.
[0076] In one embodiment provided in this application, based on the above scheme, optionally, after reading the ciphertext association field and the algorithm type from the target configuration record, the method further includes: reading the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data from the target configuration record; if the homomorphic encryption type corresponding to the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data are different, the ciphertext calculation is not performed, and a re-encryption instruction is sent to the data provider and at least one in the production environment.
[0077] In this embodiment, the homomorphic encryption types used for the first and second homomorphic encrypted data are, for example, semi-homomorphic encryption, finite-times fully homomorphic encryption, or fully homomorphic encryption, respectively. In implementation, after reading the homomorphic encryption types from both sides in the target configuration record, it is determined whether they are the same. If they are different, the two ciphertext data cannot be used in the same ciphertext calculation. Therefore, the ciphertext calculation for customer rating is not performed, and a re-encryption instruction is sent to the data provider and at least one entity in the production environment. The party receiving the instruction re-encrypts the data according to the homomorphic encryption type and algorithm type in the target configuration record, and the re-encrypted ciphertext data is then sent to the trusted execution environment. Since the two ciphertext data used in the same batch of customer rating calculations are generated using the same homomorphic encryption type and the same algorithm type, they can be directly used in the same batch of ciphertext calculations.
[0078] In one embodiment provided in this application, based on the above scheme, optionally, the step of performing ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type to obtain the ciphertext calculation result includes: reading the data source required for rating and the weight of rating calculation from the calculation task configuration; performing ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type to obtain the intermediate ciphertext calculation result corresponding to the data source required for rating; and weighting each intermediate ciphertext calculation result corresponding to the data source required for rating according to the weight of rating calculation to obtain the ciphertext calculation result.
[0079] In this embodiment, the intermediate ciphertext calculation result is obtained by performing ciphertext calculation on the ciphertext data corresponding to the data source required for a single rating. The weight of the rating calculation is given by the target configuration record. In implementation, the target homomorphically encrypted data is first ciphertext calculated in a trusted execution environment according to the algorithm type. Each type of rating source data participating in the customer rating calculation obtains a calculation result, and these results serve as the intermediate ciphertext calculation results corresponding to the data source required for the rating. For example, when the target homomorphically encrypted data includes power industry data and transportation industry data, the intermediate ciphertext calculation results corresponding to the power industry data and the transportation industry data are obtained after ciphertext calculation.
[0080] Optionally, the intermediate ciphertext calculation results corresponding to the data sources required for rating are weighted according to their respective weights in the rating calculation, and the weighted result is used as the ciphertext calculation result. The weighting operation is also performed in ciphertext state. Each intermediate ciphertext calculation result is multiplied by its corresponding plaintext weight, and the products are then summed using a homomorphic addition operation. The ciphertext calculation result is still ciphertext data.
[0081] In one embodiment provided in this application, based on the above scheme, optionally, after reading the computing task configuration corresponding to the customer to be rated in the trusted execution environment, the method further includes: receiving multiple sets of candidate homomorphic encrypted data sent by the data provider, wherein the multiple sets of candidate homomorphic encrypted data are obtained by the data provider homomorphically encrypting the rating source data according to multiple homomorphic encryption types; performing ciphertext calculation on the multiple sets of candidate homomorphic encrypted data in the trusted execution environment to obtain the computing time corresponding to each set of candidate homomorphic encrypted data; and determining the set of candidate homomorphic encrypted data with the shortest computing time as the first homomorphic encrypted data.
[0082] In this embodiment, candidate homomorphic encrypted data refers to ciphertext data generated from the same rating source data under different homomorphic encryption types. The computation time is the duration of ciphertext computation for a single set of candidate homomorphic encrypted data. In practice, the data provider homomorphically encrypts the same rating source data using multiple homomorphic encryption types, resulting in multiple sets of candidate homomorphic encrypted data. Each set of candidate homomorphic encrypted data is sent to the trusted execution environment (TEE). The TEE performs a ciphertext computation on each set of candidate homomorphic encrypted data and uses the time spent on each computation as the computation time for that set. After comparing the computation times of each set of candidate homomorphic encrypted data, the set with the shortest computation time is selected as the first set of homomorphic encrypted data to participate in the customer rating calculation. A shorter computation time indicates higher computational efficiency of the combination of homomorphic encryption type and algorithm type used in the customer rating calculation.
[0083] Optionally, the second homomorphically encrypted data on the production environment side is generated using the same homomorphic encryption type and the same algorithm. The data provider only needs to encrypt the same data multiple times, without increasing the hardware and software burden on the data receiver; the data receiver can obtain a more computationally efficient combination of homomorphic encryption type and algorithm type through trial and error. Optionally, the above trial and error and selection can be performed by the computing task performance tuning module.
[0084] In one embodiment provided in this application, based on the above scheme, the method may optionally further include: when there are multiple customers to be rated, performing batch ciphertext calculation on the first homomorphic encrypted data and the second homomorphic encrypted data corresponding to the multiple customers to be rated, to obtain the ciphertext calculation result corresponding to each customer to be rated.
[0085] In practice, when there are multiple customers to be rated, the encrypted data corresponding to each customer can be centrally sent to the trusted execution environment for calculation at once. This customer rating calculation is essentially a batch encrypted calculation, yielding the encrypted calculation result for each customer to be rated. Batch encrypted calculation is suitable for centralized processing when there are a large number of customers to be rated. It can be executed according to a preset cycle, for example, by centrally performing encrypted calculations on newly added customer data at a fixed time each day. Optionally, when there is only one customer to be rated, encrypted calculations can be performed on both the first and second homomorphically encrypted data immediately upon receiving the second homomorphically encrypted data from the production environment to obtain the encrypted calculation result for the customer to be rated.
[0086] In one embodiment provided in this application, based on the above scheme, optionally, the step of associating the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data includes: in the trusted execution environment, associating the ciphertext data of the first homomorphic encrypted data and the second homomorphic encrypted data corresponding to the same customer according to the value of the ciphertext association field to obtain the target homomorphic encrypted data, wherein the first homomorphic encrypted data and the second homomorphic encrypted data remain in ciphertext state during the association process.
[0087] In implementation, the values of the encrypted association fields are compared within a trusted execution environment. This comparison can be performed by decrypting the encrypted association fields or by comparing them while they are in their encrypted state. Regardless of the method used, the encrypted association fields serve only as an index between the two encrypted data sets and do not participate in customer rating calculations. The decrypted values of the encrypted association fields are not output externally. The business fields involved in the rating in the rating source data and customer information data are never decrypted. Therefore, during the association process, the first and second homomorphically encrypted data remain in their encrypted state.
[0088] Optionally, for ciphertext data where the values of the ciphertext association fields in the first and second homomorphic encrypted data are different, these ciphertext data have no matching records, do not participate in customer rating calculations, and are removed during the association process. Optionally, the ciphertext association fields include the personal identification document number field, the enterprise organization code field, and the unified social credit code field. The personal identification document number field can be used for individual customers, while the enterprise organization code field and the unified social credit code field can be used for corporate customers.
[0089] To illustrate the specific implementation principles of the solution provided in this application, examples are given below. See [link to relevant documentation]. Figure 2 This is an example diagram illustrating a customer rating calculation provided in an embodiment of this application. In this example, the customer rating calculation involves data interaction among a data provider, a trusted execution environment, and a production environment. The data provider offers homomorphically encrypted rating source data; optionally, the data provider could be a raw materials industry company, a power industry company, or a transportation industry company. The trusted execution environment performs the association and ciphertext calculation of the internal and external encrypted data. The production environment provides homomorphically encrypted customer information data and performs homomorphic decryption and application of the returned ciphertext calculation results. The scheduling process for the customer rating calculation is as follows: Figure 3 As shown, the customer rating calculation process includes the following steps:
[0090] The first step is to begin the computation task scheduling process and access the external encrypted data.
[0091] In this embodiment, the initiation of computation task scheduling and the maintenance of computation task configuration are handled by the computation task configuration management module on the data receiver side. The computation task configuration management module maintains the configuration of customer rating computation tasks in advance through a computation task configuration table. The computation task configuration table uses customer type and customer industry as primary key fields, and uses the data source required for rating, homomorphic encryption type, algorithm type, ciphertext association field, and the weight of rating calculation as configuration fields.
[0092] Optionally, the data provider homomorphically encrypts its own rating source data according to the homomorphic encryption type and algorithm type recorded in the computing task configuration. The encrypted data is then sent to the data receiver's trusted execution environment via the internet or a dedicated line. Alternatively, before sending the encrypted data, the data provider can verify the trustworthiness of the receiving end's computing environment through remote authentication of the trusted execution environment.
[0093] The second step involves combining the assessment of the client to be rated with the internal and external encrypted data.
[0094] In this embodiment, when there are customers to be rated at the data receiver, the production environment homomorphically encrypts the customer information data of the customers to be rated using the same homomorphic encryption type and algorithm as the data provider, and sends the obtained ciphertext data to the trusted execution environment in batch or real-time mode; when there are no customers to be rated at the data receiver, the computation task scheduling ends, and the system waits for the access of customer information data of new customers to be rated.
[0095] Subsequently, the two encrypted data streams converge in the trusted execution environment, and the internal and external encrypted data are processed centrally within the same secure computing area. The data provider and the production environment do not need to provide plaintext data or decryption keys to each other. Optionally, before sending encrypted data, the production environment can verify the trustworthiness of the peer's computing environment through remote authentication by the trusted execution environment. In this embodiment, the convergence, association, and encrypted computation of the encrypted data are handled by the computing task scheduling and execution device within the trusted execution environment.
[0096] The third step is to locate the target configuration record and read its configuration fields.
[0097] In this embodiment, after the trusted execution environment reads the computation task configuration table, it locates a record corresponding to the customer rating calculation based on the customer type and industry of the customer to be rated, and uses the located record as the target configuration record. Subsequently, it reads the data source required for rating, homomorphic encryption type, algorithm type, ciphertext association field, and the weight of the rating calculation from the target configuration record.
[0098] Specifically, taking a corporate client in the manufacturing industry as an example, the target configuration record specifies that the data source for the rating is power industry data, the homomorphic encryption type is finite-time fully homomorphic encryption, the algorithm type is an algorithm based on the discrete logarithmic difficulty for security, the ciphertext association field is the enterprise's unified social credit code, and the weight of the ciphertext in the rating calculation is 20%. The trusted execution environment simultaneously determines whether the homomorphic encryption types used by the two ciphertext data are the same. If they are different, the ciphertext calculation is not performed, and a re-encryption instruction is sent to the data provider and at least one in the production environment. The party receiving the instruction re-encrypts the data according to the homomorphic encryption type and algorithm type in the target configuration record, and the re-encrypted ciphertext data is then sent to the trusted execution environment.
[0099] The fourth step is to link the internal and external encrypted data.
[0100] In this embodiment, the trusted execution environment associates ciphertext data corresponding to the same customer from two ciphertext data streams according to the value of the ciphertext association field. Ciphertext data with different values have no matching records and are discarded; ciphertext data with the same values are grouped together, and the associated ciphertext data is used as the target homomorphic encrypted data for subsequent ciphertext calculations. During the association process, the ciphertext association field only serves as an index, and the business fields involved in the rating remain in ciphertext state at all times.
[0101] Step 5: ciphertext calculation and weighted summation.
[0102] In this embodiment, the trusted execution environment directly performs ciphertext operations on the target homomorphically encrypted data according to the algorithm type recorded in the target configuration record, without decryption during the operation. Each type of rating source data participating in the customer rating calculation yields an intermediate ciphertext calculation result, such as the intermediate ciphertext calculation result corresponding to power industry data and the intermediate ciphertext calculation result corresponding to transportation industry data. Each intermediate ciphertext calculation result is then homomorphically multiplied with its corresponding plaintext weight, and the products are summed using homomorphic addition to obtain the ciphertext calculation result.
[0103] Optionally, when the data provider homomorphically encrypts the same rating source data using multiple homomorphic encryption types and sends them together, the trusted execution environment can perform a ciphertext calculation on each set of candidate homomorphically encrypted data, compare their calculation times, and determine the set with the shortest calculation time as the first homomorphically encrypted data to participate in the customer rating calculation. In this embodiment, the above trial calculation and selection are undertaken by the computing task performance tuning module.
[0104] Step 6: The customer rating calculation results are returned, decrypted, and the calculation task scheduling is completed.
[0105] In this embodiment, the trusted execution environment sends the encrypted computation result to the production environment. The production environment holds the key used for homomorphic decryption and performs homomorphic decryption on the encrypted computation result to obtain the customer rating result for the customer to be rated, such as the rating level, rating score, or the rating range. The production environment further sends the customer rating result into its own business system for business processes such as determining the credit limit or interest rate pricing for the customer to be rated; the data provider does not participate in the decryption of the customer rating result.
[0106] Optionally, when there are multiple customers to be rated, the encrypted data corresponding to each customer can be sent to the trusted execution environment for calculation at once. After the calculation is completed, the encrypted calculation result for each customer to be rated is obtained. The calculation task scheduling ends after the customer rating results for all customers to be rated are returned.
[0107] Through the above processing, the rating source data and customer information data remain encrypted throughout the encryption, transmission, association and calculation process. Decryption is only completed on the production environment side. The trusted execution environment does not hold the decryption key or access the plaintext of the two sets of data. The data provider only bears the overhead of homomorphic encryption. Customer rating calculation is completed under the premise that the data is available but not visible.
[0108] and Figure 1 Corresponding to the method described herein, embodiments of this application also provide a customer rating calculation device, which can be specifically used for... Figure 1 The specific implementation of the method is shown in the following structural diagram. Figure 4 As shown, it includes:
[0109] The receiving unit 401 is used to receive first homomorphic encrypted data sent by the data provider and second homomorphic encrypted data sent by the production environment. The first homomorphic encrypted data is obtained by the data provider homomorphically encrypting the rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting the customer information data of the customer to be rated.
[0110] Reading unit 402 is used to read the computing task configuration corresponding to the customer to be rated in a trusted execution environment;
[0111] The determining unit 403 is configured to determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data according to the computing task configuration;
[0112] The association unit 404 is used to associate the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data;
[0113] The calculation unit 405 is used to perform ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type, and obtain the ciphertext calculation result;
[0114] The sending unit 406 is used to send the ciphertext calculation result to the production environment so that the production environment can perform homomorphic decryption on the ciphertext calculation result to obtain the customer rating result of the customer to be rated.
[0115] The specific principles and execution processes of each unit and module in the customer rating calculation device disclosed in the above-described embodiments of this application are the same as those of the customer rating calculation method disclosed in the above-described embodiments of this application. Please refer to the corresponding parts of the customer rating calculation method provided in the above-described embodiments of this application, and they will not be repeated here.
[0116] This application embodiment also provides a storage medium, which includes stored instructions, wherein, when the instructions are executed, the device where the storage medium is located executes the above-described customer rating calculation method.
[0117] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 5 As shown, it specifically includes a memory 501 and one or more instructions 502, wherein one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the above-mentioned customer rating calculation method.
[0118] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0119] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application program, server, or storage medium executing the operation of this invention, based on the prompt message.
[0120] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0121] It is understood that the above notification and user authorization process is merely illustrative and does not constitute a limitation on the implementation of the present invention. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present invention.
[0122] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0123] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0124] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0125] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0126] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0127] The above provides a detailed description of a customer rating calculation method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A customer rating calculation method, characterized in that, include: In response to receiving first homomorphic encrypted data sent by the data provider and second homomorphic encrypted data sent by the production environment, the computing task configuration corresponding to the customer to be rated is read in the trusted execution environment. The first homomorphic encrypted data is obtained by the data provider homomorphically encrypting the rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting the customer information data of the customer to be rated. Based on the computing task configuration, determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data; According to the ciphertext association field, the first homomorphic encrypted data and the second homomorphic encrypted data are associated to obtain the target homomorphic encrypted data; According to the algorithm type, the target homomorphic encrypted data is ciphertext calculated in the trusted execution environment to obtain the ciphertext calculation result; The encrypted calculation result is sent to the production environment so that the production environment can perform homomorphic decryption on the encrypted calculation result to obtain the customer rating result of the customer to be rated.
2. The method according to claim 1, characterized in that, The step of determining the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data according to the computing task configuration includes: Based on the customer type and industry of the customer to be rated, determine the target configuration record corresponding to the customer to be rated from the calculation task configuration; Read the ciphertext association field and the algorithm type from the target configuration record.
3. The method according to claim 2, characterized in that, After reading the ciphertext association field and the algorithm type from the target configuration record, the method further includes: Read the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data from the target configuration record; If the homomorphic encryption type corresponding to the first homomorphic encrypted data and the homomorphic encryption type corresponding to the second homomorphic encrypted data are different, the ciphertext calculation is not performed, and a re-encryption instruction is sent to the data provider and at least one of the production environments.
4. The method according to claim 1, characterized in that, The step of performing ciphertext computation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type, to obtain the ciphertext computation result, includes: Read the data sources required for rating and the weights allocated to rating calculation from the aforementioned computing task configuration; According to the algorithm type, the target homomorphic encrypted data is ciphertext calculated in the trusted execution environment to obtain the intermediate ciphertext calculation result corresponding to the data source required for the rating. According to the weights assigned to the rating calculations, the intermediate ciphertext calculation results corresponding to the data sources required for the rating are weighted to obtain the ciphertext calculation results.
5. The method according to claim 1, characterized in that, After reading the computing task configuration corresponding to the customer to be rated in the trusted execution environment, the process also includes: The system receives multiple sets of candidate homomorphic encrypted data sent by the data provider, wherein the multiple sets of candidate homomorphic encrypted data are obtained by the data provider homomorphically encrypting the rating source data according to multiple homomorphic encryption types. In the trusted execution environment, ciphertext computation is performed on the multiple sets of candidate homomorphic encrypted data to obtain the computation time corresponding to each set of candidate homomorphic encrypted data; The set of candidate homomorphic encrypted data with the shortest computation time is determined as the first homomorphic encrypted data.
6. The method according to claim 1, characterized in that, Also includes: When there are multiple customers to be rated, batch ciphertext calculation is performed on the first homomorphic encrypted data and the second homomorphic encrypted data corresponding to the multiple customers to be rated to obtain the ciphertext calculation result corresponding to each customer to be rated.
7. The method according to claim 1, characterized in that, The step of associating the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data includes: In the trusted execution environment, according to the value of the ciphertext association field, the ciphertext data corresponding to the same customer in the first homomorphic encrypted data and the second homomorphic encrypted data are associated to obtain the target homomorphic encrypted data. During the association process, the first homomorphic encrypted data and the second homomorphic encrypted data remain in ciphertext state.
8. A customer rating calculation device, characterized in that, include: The receiving unit is used to receive first homomorphic encrypted data sent by the data provider and second homomorphic encrypted data sent by the production environment. The first homomorphic encrypted data is obtained by the data provider homomorphically encrypting the rating source data, and the second homomorphic encrypted data is obtained by the production environment homomorphically encrypting the customer information data of the customer to be rated. The reading unit is used to read the computing task configuration corresponding to the customer to be rated in a trusted execution environment. The determining unit is configured to determine the ciphertext association field and algorithm type between the first homomorphic encrypted data and the second homomorphic encrypted data based on the computing task configuration. The association unit is used to associate the first homomorphic encrypted data and the second homomorphic encrypted data according to the ciphertext association field to obtain the target homomorphic encrypted data; A computing unit is configured to perform ciphertext calculation on the target homomorphic encrypted data in the trusted execution environment according to the algorithm type, and obtain the ciphertext calculation result; The sending unit is used to send the ciphertext calculation result to the production environment, so that the production environment can perform homomorphic decryption on the ciphertext calculation result to obtain the customer rating result of the customer to be rated.
9. A storage medium, characterized in that, The storage medium includes stored instructions, wherein, when the instructions are executed, the device containing the storage medium is controlled to perform the customer rating calculation method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes a memory, and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described in any one of claims 1 to 7.
