Financial data encryption method and device, equipment and storage medium
Through data discretization processing and homomorphic encryption algorithm, dynamic screening of encryption fields combined with credit score ratio, the problem of long-term use of existing financial data encryption solutions is solved, efficient and secure financial data encryption is achieved, and data is improved. Processing timeliness.
Patent Information
- Application Number
- CN202411403669.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-10
AI Technical Summary
The encryption process of existing financial data encryption solutions is long and has low processing efficiency, which affects the timeliness of data processing.
Data discretization processing and homomorphic encryption algorithm are used to encrypt the encrypted data fields, and dynamically filter the encrypted fields through credit score ratio to reduce the amount of encrypted data and improve encryption efficiency.
It shortens the encryption time, ensures the accuracy and security of encrypted data, and improves the timeliness of data processing.
Smart Images

Figure CN119293819A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data security technology, and specifically relates to a data encryption method, device, equipment and storage medium for financial data. Background Art
[0002] Financial data security refers to measures and practices to protect the important data of financial institutions and their customers from unauthorized access, damage, disclosure or abuse. In the digital age, financial institutions hold a large amount of sensitive data, including personal identity information, bank account information, transaction data, etc. The security of this data is crucial to the stable operation of financial institutions and the privacy protection of customers.
[0003] In the process of processing financial data, it is difficult to completely avoid data processing personnel obtaining customers' sensitive information, such as identity information, transaction details, etc., through convenient means such as direct viewing, screenshots, photos, or copying and pasting for work needs. This processing flow has the potential risk of sensitive information leakage, which not only tests the strictness of the internal management of financial institutions, but also puts higher requirements on the timely updating of technical protection measures.
[0004] At present, in order to ensure the security of financial data, encryption algorithms are usually used to encrypt data to prevent sensitive data leakage. However, the encryption process of existing data encryption schemes is time-consuming and has low processing efficiency, which seriously affects the timeliness of data processing. Summary of the invention
[0005] The purpose of the embodiments of the present application is to propose a data encryption method, device, computer equipment and storage medium for financial data, so as to solve the technical problems existing in the existing financial data encryption scheme that the encryption process is time-consuming, the processing efficiency is low, and the timeliness of data processing is seriously affected.
[0006] In order to solve the above technical problems, the embodiment of the present application provides a data encryption method for financial data, which adopts the following technical solution:
[0007] A data encryption method for financial data, comprising:
[0008] Obtaining data to be processed from a financial data center, and identifying data fields to be encrypted in the data to be processed;
[0009] Perform data discretization processing on the encrypted data field to obtain a discretized data field;
[0010] A homomorphic encryption algorithm is used to encrypt the discretized data field to obtain first encrypted data and a first data credit score;
[0011] Comparing the first data credit score with a preset credit score threshold;
[0012] When the credit score of the first data is less than or equal to the credit score threshold, the first encrypted data is used as the data encryption result of the data to be processed;
[0013] When the first data credit score is greater than the credit score threshold, the data field to be encrypted is screened to obtain the target data field to be encrypted;
[0014] Performing data discretization processing on the target data field to be encrypted to obtain a target discretized data field;
[0015] Using a homomorphic encryption algorithm to encrypt the target discretized data field, obtaining second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to a credit score threshold;
[0016] The second encrypted data is used as the data encryption result of the data to be processed.
[0017] Furthermore, the step of performing data discretization processing on the encrypted data field to obtain a discretized data field specifically includes:
[0018] Identify the field type of the data field to be encrypted, where the field type includes integer type, floating point type and string type;
[0019] Obtain a preset data discretization rule engine, wherein the data discretization rule engine includes data discretization rules corresponding to various field types;
[0020] Based on the field type of the data field to be encrypted, a data discretization rule engine is used to perform data discretization processing to obtain a discretized data field.
[0021] Furthermore, the step of using a homomorphic encryption algorithm to encrypt the discretized data field to obtain first encrypted data and a first data credit score specifically includes:
[0022] Encrypt each discretized data field in the data to be processed in sequence to obtain first encrypted data;
[0023] Obtain the data encryption field corresponding to each discretized data field, and calculate the field score of each data encryption field;
[0024] Configure the corresponding field score weight for each data encryption field;
[0025] The field scores of each data encryption field are weighted and summed based on the field score weight to obtain the first data credit score.
[0026] Furthermore, before the step of comparing the first data credit score with a preset credit score threshold, the method further includes:
[0027] A data template library is configured, wherein the data template library is configured with a number of historical encrypted data templates, and each historical encrypted data template includes a number of historical reference fields;
[0028] The steps of obtaining the data encryption field corresponding to each discretized data field and calculating the field score of each data encryption field specifically include:
[0029] Determining a target historical encrypted data template corresponding to the first encrypted data in a data template library;
[0030] identifying historical reference fields in the target historical encrypted data template that match the respective data encrypted fields;
[0031] Based on each data encryption field and a historical reference field matched by each data encryption field, a field score of each data encryption field is calculated.
[0032] Furthermore, each target historical encrypted data template is configured with a historical credit score, and the step of comparing the first data credit score with a preset credit score threshold specifically includes:
[0033] Obtain the historical credit score corresponding to the target historical encrypted data template to obtain the target historical credit score;
[0034] The target historical credit score is used as the credit score threshold;
[0035] The first data credit score is compared with the credit score threshold to determine the magnitude relationship between the first data credit score and the credit score threshold.
[0036] Furthermore, the step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes:
[0037] Determine a string-type to-be-encrypted data field as a target to-be-encrypted data field;
[0038] Alternatively, both the floating-point data field to be encrypted and the character string data field to be encrypted are determined as the target data field to be encrypted.
[0039] Furthermore, the step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes:
[0040] Input the data to be processed into the pre-trained field encryption prediction model to obtain the field encryption prediction result;
[0041] Based on the field encryption prediction results, the data fields to be encrypted are screened to obtain the target data fields to be encrypted;
[0042] Before the step of screening the data field to be encrypted to obtain the target data field to be encrypted, the following steps are also included:
[0043] Determine the original data template corresponding to each historical encrypted data template, and mark the historical encrypted data fields in each original data template;
[0044] Build a training data set for the model based on the labeled original data templates;
[0045] Using the training data set to train the preset initial prediction model to obtain an initial field prediction result, wherein the initial field prediction result includes predicting the data field to be encrypted;
[0046] The predicted data field to be encrypted is compared with the historical encrypted data field to obtain the prediction error, and the initial prediction model is iteratively updated based on the prediction error until the model is fitted to obtain the field encryption prediction model.
[0047] In order to solve the above technical problems, the embodiment of the present application also provides a data encryption device for financial data, which adopts the following technical solution:
[0048] A data encryption device for financial data, comprising:
[0049] A field identification module is used to obtain the data to be processed from the financial data center and identify the data fields to be encrypted in the data to be processed;
[0050] The first discretization module is used to perform data discretization processing on the encrypted data field to obtain a discretized data field;
[0051] A first encryption module, used to encrypt the discretized data field using a homomorphic encryption algorithm to obtain first encrypted data and a first data credit score;
[0052] A score comparison module, used to compare the first data credit score with a preset credit score threshold;
[0053] A first output module, configured to use the first encrypted data as a data encryption result of the data to be processed when the credit score of the first data is less than or equal to the credit score threshold;
[0054] A field screening module, used for screening the data field to be encrypted to obtain the target data field to be encrypted when the first data credit score is greater than the credit score threshold;
[0055] The second discretization module is used to perform data discretization processing on the target data field to be encrypted to obtain a target discretized data field;
[0056] A second encryption module, used to encrypt the target discretized data field using a homomorphic encryption algorithm to obtain second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to a credit score threshold;
[0057] The second output module is used to use the second encrypted data as the data encryption result of the data to be processed.
[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0059] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the data encryption method for financial data as described in any one of the above when executing the computer-readable instructions.
[0060] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0061] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the financial data encryption method as described in any one of the above.
[0062] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0063] The present application discloses a data encryption method, device, equipment and storage medium for financial data, and belongs to the field of data security technology. The present application obtains the data to be processed, identifies the data field to be encrypted, and performs data discretization processing on the data field to be encrypted; then encrypts the discretized data field to obtain encrypted data and data credit score; compares the data credit score with the credit score threshold; when the credit score is less than or equal to the threshold, the encrypted data is used as the data encryption result. When the credit score is greater than the threshold, the encrypted data field is field screened; the screened target data field to be encrypted is data discretized; the target discretized data field is data encrypted to obtain new encrypted data and new data credit score, wherein the new data credit score is less than or equal to the threshold; the new encrypted data is used as the data encryption result. The present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and through field credit score comparison, when the credit score is greater than the threshold, dynamically screens the encrypted field for data encryption, further reducing the amount of encrypted data, not only shortening the encryption time, but also ensuring the accuracy and security of the encrypted data. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;
[0066] Figure 2 A flow chart showing an embodiment of a method for encrypting financial data according to the present application;
[0067] Figure 3 Shows Figure 2 A flowchart of an embodiment of step S202;
[0068] Figure 4 A schematic diagram showing the structure of an embodiment of a data encryption device for financial data according to the present application;
[0069] Figure 5 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0071] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0073] like Figure 1As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0074] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0075] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0076] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0077] It should be noted that the data encryption method for financial data provided in the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the data encryption device for financial data is generally set in the server / terminal device.
[0078] It should be understood that Figure 1 The numbers of terminal devices, networks and servers in the embodiment are merely illustrative. The above system may have any number of terminal devices, networks and servers according to implementation requirements.
[0079] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for encrypting financial data according to the present application. The method for encrypting financial data comprises the following steps:
[0080] S201, obtaining data to be processed from a financial data center, and identifying data fields to be encrypted in the data to be processed.
[0081] Specifically, the system first extracts relevant data to be processed from the financial data center, which usually includes sensitive information such as user transaction records, credit information, account activities, etc. The data obtained by the system will undergo preliminary classification and screening to determine which data fields need to be encrypted. The identification of data fields to be encrypted is usually based on the sensitivity and compliance requirements of the data, such as important data fields such as personal identity information (PII), financial transaction amounts, and credit history.
[0082] By identifying the data fields to be encrypted, it ensures that only necessary fields are processed during the encryption process, thus avoiding unnecessary waste of computing resources while also ensuring the privacy and security of key data.
[0083] In a specific embodiment of the present application, when processing financial data, the data is encrypted and transmitted from the financial data center intranet to the data processing platform using the national secret algorithms SM2 and SM3; and in the platform, the national secret algorithm SM4 is used for encrypted storage. The national commercial encryption algorithm SM2 is used for key negotiation and data signing to ensure the integrity and non-repudiation of data transmission; at the same time, the SM3 hash algorithm is used to encrypt and transmit data to further improve the security of the transmission process and effectively resist middleman attacks and data tampering. After arriving at the data processing platform, the SM4 symmetric encryption algorithm is used to encrypt and store the data to ensure the confidentiality of the data. Even if the data is illegally obtained, it is difficult for unauthorized persons to interpret it. The application of this series of national secret algorithms not only meets the country's high standards for financial information security, but also reduces potential information security risks and improves the overall protection level of financial data processing because the algorithms are autonomous and controllable.
[0084] S202, performing data discretization processing on the data field to be encrypted to obtain a discretized data field.
[0085] Specifically, before encrypting the encrypted data field, data discretization simplifies the data representation by dividing the continuous data into finite discrete intervals. Data discretization is a data preprocessing technology that involves converting continuous numerical data into discrete, finite categories or intervals. The purpose of discretization is to reduce the complexity of the original data and make it more operable when encrypted. For example, the transaction amount is divided into several intervals, such as "0-100 yuan", "100-1000 yuan", etc. If the enterprise asset scale is greater than or equal to "1 million yuan", it is assigned a value of "1"; if it is less than "1 million yuan", it is assigned a value of "0"; for example, the enterprise's monthly expenditure amount is "15.3456 million yuan", which belongs to the 15-20 million interval, and is represented by the number "4" label.
[0086] This processing can effectively reduce the computational complexity of the encryption algorithm, improve encryption efficiency, and reduce the volume of encrypted data. At the same time, discretization processing can further enhance the privacy protection of data and reduce the risk of sensitive information exposure by hiding some detailed information.
[0087] S203: Use a homomorphic encryption algorithm to encrypt the discretized data field to obtain first encrypted data and a first data credit score.
[0088] Specifically, the system uses homomorphic encryption algorithms to encrypt discretized data fields. The advantage of homomorphic encryption is that it can perform calculations directly on encrypted data without decrypting the original data. This ensures that after the data is encrypted, the system can still perform analysis operations such as credit scoring on the encrypted data, ensuring the privacy and availability of the data. The scoring process is based on the encrypted data features and is calculated by a model or algorithm.
[0089] S204: Compare the first data credit score with a preset credit score threshold.
[0090] Specifically, the system compares the First Data credit score with a pre-set score threshold. This preset threshold is usually determined based on risk control requirements, business compliance, and industry standards, and represents the lowest acceptable range of scores. If the score is lower than or equal to the threshold, it means that the encryption and processing of the data meets the standards and can be regarded as a valid encryption result. If the score is higher than the threshold, it means that the encrypted data may have deviations, large errors, or insufficient discretization, and further optimization is required.
[0091] S205: When the first data credit score is less than or equal to the credit score threshold, the first encrypted data is used as the data encryption result of the data to be processed.
[0092] Specifically, if the comparison result shows that the credit score of the first data is less than or equal to the preset score threshold, it means that the encrypted data has reached the required standard and has sufficient reliability and security. In this case, the system will directly output the first encrypted data as the final encryption result and enter the next processing stage or storage link.
[0093] S206: When the first data credit score is greater than the credit score threshold, field screening is performed on the data field to be encrypted to obtain a target data field to be encrypted.
[0094] Specifically, if the first data credit score is higher than the preset threshold, it means that the current encrypted data quality is insufficient and may need further optimization. To this end, the system will re-screen the encrypted data fields to determine the target fields that have the greatest impact on the final score. These target fields are often data with high sensitivity or large amounts of information, which may lead to scoring deviations during the initial encryption due to insufficient discretization or insufficient complexity of the encryption algorithm. Through field screening, you can focus on more critical data fields so that you can perform more refined discretization and encryption processing in the next step, thereby improving the accuracy of the encryption results and the quality of the score.
[0095] S207, performing data discretization processing on the target data field to be encrypted to obtain a target discretized data field.
[0096] Specifically, after re-screening the target data fields to be encrypted, the system will discretize these target data fields to be encrypted again. The goal is to select key sensitive information fields or sensitive information fields that take up large computing resources during encryption for discretization through fine discretization. This can reduce unnecessary data redundancy and complexity, shorten encryption time, and at the same time ensure the accuracy and security of encrypted data.
[0097] S208, using a homomorphic encryption algorithm to encrypt the target discretized data field to obtain second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to a credit score threshold.
[0098] Specifically, the system uses the homomorphic encryption algorithm again to encrypt the target data fields that have been finely discretized. The encryption process is similar to the previous one, but because the target data fields have been screened and discretized more finely, the encryption time can be shortened, the encryption efficiency is improved, and the accuracy and security of the encrypted data can be guaranteed.
[0099] It should be noted that steps S206 to S208 are a cyclic execution process, during which the system will continuously perform field screening and generate new data encryption schemes. Then, after each new data encryption is generated, the data encryption step is executed until the data credit score is less than or equal to the credit score threshold, and the system will obtain and save the second encrypted data and the second data credit score. And for the encrypted data corresponding to the data credit score greater than the credit score threshold, the system will clear it in time to avoid occupying the system's storage space.
[0100] S209: Use the second encrypted data as the data encryption result of the data to be processed.
[0101] Specifically, when the credit score of the second data meets the preset score threshold, the system regards the second encrypted data as the final encryption result, which not only meets the credit score requirements, but also provides good data privacy protection and data processing efficiency. The final encrypted data can continue to be used for subsequent business analysis, risk assessment or storage to ensure data security and business continuity.
[0102] In the above embodiment, the present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and compares the field credit score. When the credit score is greater than the threshold, the encrypted field is dynamically screened for data encryption to further reduce the amount of encrypted data. This not only shortens the encryption time, but also ensures the accuracy and security of the encrypted data.
[0103] For further information, please refer to Figure 3 , the steps of performing data discretization processing on the encrypted data field to obtain the discretized data field specifically include:
[0104] S301, identifying the field type of the data field to be encrypted, wherein the field type includes integer type, floating point type and string type;
[0105] S302, obtaining a preset data discretization rule engine, wherein the data discretization rule engine includes data discretization rules corresponding to various field types;
[0106] S303: Based on the field type of the data field to be encrypted, a data discretization rule engine is used to perform data discretization processing to obtain a discretized data field.
[0107] In this embodiment, the system first identifies the data field to be encrypted to determine its field type, including integer, floating point and string types. Different data types correspond to different data features, so different discretization methods are required for processing. Then the system obtains the discretization rules that match the field type from the preset data discretization rule engine, which contains a series of data discretization rules for different field types. For example, for integer fields, interval division may be used for discretization; for floating point fields, more sophisticated interval division or rounding may be used; and for string fields, dictionary mapping or classification numbering may be used for discretization.
[0108] Through the above steps, the system automatically identifies different data field types and processes the data based on preset discretization rules, using the most appropriate discretization method for different data types in a targeted manner, thereby improving data processing efficiency, reducing the computational complexity of the encryption process, and retaining key data information.
[0109] Furthermore, the step of using a homomorphic encryption algorithm to encrypt the discretized data field to obtain first encrypted data and a first data credit score specifically includes:
[0110] Encrypt each discretized data field in the data to be processed in sequence to obtain first encrypted data;
[0111] Obtain the data encryption field corresponding to each discretized data field, and calculate the field score of each data encryption field;
[0112] Configure the corresponding field score weight for each data encryption field;
[0113] The field scores of each data encryption field are weighted and summed based on the field score weight to obtain the first data credit score.
[0114] In this embodiment, the system will encrypt each discretized data field in the processed data in turn to ensure the privacy and security of the data. Each discretized data field generates a corresponding data encryption field after encryption. These encrypted fields retain the main features of the data, but cannot be directly read or used after encryption. Next, the system will calculate a field score for each data encryption field. The calculation method of the field score is based on the nature of the data and the weight in the credit score, involving the importance of the field in the credit analysis. For example, fields such as personal income and loan history have a higher weight in the score. Then, each data encryption field is configured with a corresponding field score weight to reflect its contribution to the overall credit score. For example, more critical fields will be assigned higher weights, while less important fields will be assigned lower weights. Finally, the system performs a weighted summation of the scores of each field based on these weights to generate a first data credit score.
[0115] Through the above steps, reasonable encryption and weight distribution can ensure data security while accurately reflecting the user's credit status. By weighted summation of the scores of each encrypted field, the credit score can more accurately capture the user's credit characteristics and improve the credibility and effectiveness of the score.
[0116] Furthermore, before the step of comparing the first data credit score with a preset credit score threshold, the method further includes:
[0117] A data template library is configured, wherein a plurality of historical encrypted data templates are configured in the data template library, and each historical encrypted data template includes a plurality of historical reference fields.
[0118] In this embodiment, the system is configured with a data template library, which contains several historical encryption data templates. Each historical encryption data template consists of multiple historical reference fields, which record the processing methods and related characteristics of past encrypted data. These historical encryption data templates can provide reference for the current data encryption process, improve encryption efficiency, and ensure consistency and accuracy.
[0119] Furthermore, the steps of obtaining the data encryption field corresponding to each discretized data field and calculating the field score of each data encryption field specifically include:
[0120] Determining a target historical encrypted data template corresponding to the first encrypted data in a data template library;
[0121] identifying historical reference fields in the target historical encrypted data template that match the respective data encrypted fields;
[0122] Based on each data encryption field and a historical reference field matched by each data encryption field, a field score of each data encryption field is calculated.
[0123] In this embodiment, the system first searches for the target historical encrypted data template that best matches the first encrypted data in the data template library. The data template library contains multiple historical encrypted data templates, each of which records the field characteristics and processing methods related to the corresponding encrypted data. By comparing the characteristics of the first encrypted data, the system can determine a historical template that best matches it. After determining the target template, the system will identify historical reference fields that match each data encryption field in the template. These historical reference fields record the field scores and processing weights obtained by data fields similar or identical to the current encrypted field in previous encryption processes. In this way, the system can evaluate the field scores of the current data encryption field based on the information of the historical reference fields.
[0124] Specifically, the calculation formula for the field score of each data encryption field is as follows:
[0125]
[0126] Where Q is the field score, M1 is the data encryption field, and M0 is the historical reference field.
[0127] Through the above steps, the historical encrypted data template is used to accelerate the score calculation in the data encryption process and ensure the rationality and reliability of the score. By matching the historical reference fields, repeated calculations can be effectively reduced, data processing efficiency can be improved, and the accuracy of the score can be improved.
[0128] Furthermore, each target historical encrypted data template is configured with a historical credit score, and the step of comparing the first data credit score with a preset credit score threshold specifically includes:
[0129] Obtain the historical credit score corresponding to the target historical encrypted data template to obtain the target historical credit score;
[0130] The target historical credit score is used as the credit score threshold;
[0131] The first data credit score is compared with the credit score threshold to determine the magnitude relationship between the first data credit score and the credit score threshold.
[0132] In this embodiment, the system first extracts the corresponding historical credit score from the target historical encrypted data template to obtain the target historical credit score. The historical credit score is the data accumulated in the past encryption and scoring process, generated based on the characteristics and scoring methods of similar data, and reflects the credit performance of similar data sets in encryption processing. The system uses the target historical credit score as the credit score threshold of the current encrypted data, that is, the minimum credit standard required to be achieved during the current data encryption and processing process. Next, the system compares the first data credit score with this threshold to determine whether it meets the standard.
[0133] Through the above steps, using historical credit scores as thresholds, the current data encryption process has clear quality standards. By comparing with historical data, the system can quickly determine the reliability and accuracy of the current encrypted data, reducing unnecessary calculation steps and improving data processing efficiency.
[0134] Furthermore, the step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes:
[0135] Determine a string-type to-be-encrypted data field as a target to-be-encrypted data field;
[0136] Alternatively, both the floating-point data field to be encrypted and the character string data field to be encrypted are determined as the target data field to be encrypted.
[0137] In this embodiment, the system first determines the string-type data field to be encrypted as the target data field to be encrypted according to the type of the data field to be encrypted. This is because string-type data usually contains more complex text information, such as user name, address, account number, etc., and string-type data fields occupy a large amount of computing resources when encrypted. Therefore, string-type fields are processed first during the encryption process to ensure that sensitive information is protected in a timely manner, while reducing the amount of encrypted data and shortening the encryption time.
[0138] In some cases, the system will also identify both floating-point data fields and string data fields as target data fields to be encrypted. Floating-point data is usually related to financial transactions, contains key information such as amount and interest rate, and also has higher privacy protection requirements. Compared with integer data, it takes up more computing resources when encrypted. Therefore, when the system recognizes floating-point data, it will also be encrypted as a target data field.
[0139] Through the above steps, string and floating-point data fields with higher sensitivity can be quickly identified and prioritized, which not only improves the timeliness of encryption, but also ensures the security of important data and avoids the risk of information leakage.
[0140] Furthermore, the step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes:
[0141] Input the data to be processed into the pre-trained field encryption prediction model to obtain the field encryption prediction result;
[0142] Based on the field encryption prediction results, the data fields to be encrypted are screened to obtain the target data fields to be encrypted.
[0143] In another embodiment, the system first inputs the data to be processed into a pre-trained field encryption prediction model. This prediction model is based on previous data encryption cases and domain knowledge. After training, it can predict which data fields need to be encrypted. The prediction results of the model reflect the relative importance of each data field in terms of privacy protection and security. Based on the field encryption prediction results, the system will screen the data fields to be encrypted and determine which fields should be encrypted first, that is, the target data fields to be encrypted.
[0144] Through the above steps, the pre-trained encryption prediction model is used to automatically screen out the fields that need to be encrypted, thereby improving the accuracy and efficiency of data encryption.
[0145] Furthermore, before the step of screening the data field to be encrypted to obtain the target data field to be encrypted, the method further includes:
[0146] Determine the original data template corresponding to each historical encrypted data template, and mark the historical encrypted data fields in each original data template;
[0147] Build a training data set for the model based on the labeled original data templates;
[0148] Using the training data set to train the preset initial prediction model to obtain an initial field prediction result, wherein the initial field prediction result includes predicting the data field to be encrypted;
[0149] The predicted data field to be encrypted is compared with the historical encrypted data field to obtain the prediction error, and the initial prediction model is iteratively updated based on the prediction error until the model is fitted to obtain the field encryption prediction model.
[0150] In this embodiment, the system can use the historical encrypted data templates configured in the data template library to train the field encryption prediction model. First, the system determines the original data template corresponding to each historical encrypted data template, and annotates the historical encrypted data fields in these original data templates. These annotation information records which fields in the original data template are encrypted during the encryption process and their specific processing methods. Then, the system uses the annotated original data template to build a training data set for the model, which includes the feature information and encryption status of the field. Using these training data sets, the system trains the preset initial prediction model to generate initial field prediction results, including predicting the data field to be encrypted. Then, the system compares the predicted data field to be encrypted with the historical encrypted data field to calculate the prediction error. By analyzing the prediction error, the system iteratively updates the initial prediction model to optimize the accuracy and reliability of the model. This iterative process continues until the model fits well and can accurately predict the data field to be encrypted, and finally obtains an efficient field encryption prediction model.
[0151] Through the above steps, an efficient field encryption prediction model was generated through annotation and iterative updating, which significantly improved the automation and accuracy of data encryption. The model can accurately predict the data fields that need to be encrypted through continuous optimization and training.
[0152] In the above embodiment, the present application discloses a data encryption method for financial data, which belongs to the field of data security technology. The present application obtains the data to be processed, identifies the data field to be encrypted, and performs data discretization processing on the data field to be encrypted; then encrypts the discretized data field to obtain encrypted data and data credit score; compares the data credit score with the credit score threshold; when the credit score is less than or equal to the threshold, the encrypted data is used as the data encryption result. When the credit score is greater than the threshold, the encrypted data field is field screened; the screened target data field to be encrypted is data discretized; the target discretized data field is data encrypted to obtain new encrypted data and new data credit score, wherein the new data credit score is less than or equal to the threshold; the new encrypted data is used as the data encryption result. The present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and through the field credit score comparison, when the credit score is greater than the threshold, the encrypted field is dynamically screened for data encryption, further reducing the amount of encrypted data, not only shortening the encryption time, but also ensuring the accuracy and security of the encrypted data.
[0153] In this embodiment, the data encryption method for financial data is executed on an electronic device (eg Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0154] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0155] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0156] Further references Figure 4 , as a response to the above Figure 2 The present application provides an embodiment of a data encryption device for financial data, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0157] like Figure 4 As shown, the financial data encryption device 400 described in this embodiment includes:
[0158] The field identification module 401 is used to obtain the data to be processed from the financial data center and identify the data field to be encrypted in the data to be processed;
[0159] A first discretization module 402 is used to perform data discretization processing on the encrypted data field to obtain a discretized data field;
[0160] The first encryption module 403 is used to encrypt the discretized data field using a homomorphic encryption algorithm to obtain first encrypted data and a first data credit score;
[0161] The score comparison module 404 is used to compare the first data credit score with a preset credit score threshold;
[0162] The first output module 405 is used to use the first encrypted data as the data encryption result of the data to be processed when the first data credit score is less than or equal to the credit score threshold;
[0163] A field screening module 406 is used to screen the data field to be encrypted to obtain the target data field to be encrypted when the first data credit score is greater than the credit score threshold;
[0164] The second discretization module 407 is used to perform data discretization processing on the target data field to be encrypted to obtain a target discretized data field;
[0165] A second encryption module 408 is used to encrypt the target discretized data field using a homomorphic encryption algorithm to obtain second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to the credit score threshold;
[0166] The second output module 409 is used to use the second encrypted data as the data encryption result of the data to be processed.
[0167] Furthermore, the first discretization module 402 is specifically used for:
[0168] Identify the field type of the data field to be encrypted, where the field types include integer, floating point and string types; obtain a preset data discretization rule engine, where the data discretization rule engine includes data discretization rules corresponding to various field types; based on the field type of the data field to be encrypted, use the data discretization rule engine to perform data discretization processing to obtain a discretized data field.
[0169] Furthermore, the first encryption module 403 is specifically used for:
[0170] Encrypt each discretized data field in the processed data in turn to obtain first encrypted data; obtain the data encryption field corresponding to each discretized data field, and calculate the field score of each data encryption field; configure the corresponding field score weight for each data encryption field; perform weighted summation of the field scores of each data encryption field based on the field score weight to obtain a first data credit score.
[0171] Furthermore, the financial data encryption device 400 further includes a template library configuration module, which is specifically used to:
[0172] A data template library is configured, wherein a plurality of historical encrypted data templates are configured in the data template library, and each historical encrypted data template includes a plurality of historical reference fields.
[0173] Furthermore, the first encryption module 403 is further used for:
[0174] Determine a target historical encrypted data template corresponding to the first encrypted data in a data template library; identify historical reference fields matching each data encryption field in the target historical encrypted data template; and calculate field scores for each data encryption field based on each data encryption field and the historical reference fields matching each data encryption field.
[0175] Furthermore, each target historical encrypted data template is configured with a corresponding historical credit score, and the score comparison module 404 is specifically used to:
[0176] Obtain the historical credit score corresponding to the target historical encrypted data template to obtain the target historical credit score; use the target historical credit score as the credit score threshold; compare the first data credit score with the credit score threshold to determine the size relationship between the first data credit score and the credit score threshold.
[0177] Furthermore, the field screening module 406 is specifically used for:
[0178] Determine a string-type to-be-encrypted data field as a target to-be-encrypted data field;
[0179] Alternatively, both the floating-point data field to be encrypted and the character string data field to be encrypted are determined as the target data field to be encrypted.
[0180] Furthermore, the field screening module 406 is also used for:
[0181] Input the data to be processed into the pre-trained field encryption prediction model to obtain the field encryption prediction result;
[0182] Based on the field encryption prediction results, the data fields to be encrypted are screened to obtain the target data fields to be encrypted;
[0183] Before the step of screening the data field to be encrypted to obtain the target data field to be encrypted, the following steps are also included:
[0184] Determine the original data template corresponding to each historical encrypted data template, and mark the historical encrypted data fields in each original data template;
[0185] Build a training data set for the model based on the labeled original data templates;
[0186] Using the training data set to train the preset initial prediction model to obtain an initial field prediction result, wherein the initial field prediction result includes predicting the data field to be encrypted;
[0187] The predicted data field to be encrypted is compared with the historical encrypted data field to obtain the prediction error, and the initial prediction model is iteratively updated based on the prediction error until the model is fitted to obtain the field encryption prediction model.
[0188] In the above embodiment, the present application discloses a data encryption device for financial data, which belongs to the field of data security technology. The present application obtains the data to be processed, identifies the data field to be encrypted, and performs data discretization processing on the data field to be encrypted; then encrypts the discretized data field to obtain encrypted data and data credit score; compares the data credit score with the credit score threshold; when the credit score is less than or equal to the threshold, the encrypted data is used as the data encryption result. When the credit score is greater than the threshold, the encrypted data field is field screened; the screened target data field to be encrypted is data discretized; the target discretized data field is data encrypted to obtain new encrypted data and new data credit score, wherein the new data credit score is less than or equal to the threshold; the new encrypted data is used as the data encryption result. The present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and through field credit score comparison, when the credit score is greater than the threshold, dynamically screens the encrypted field for data encryption, further reducing the amount of encrypted data, not only shortening the encryption time, but also ensuring the accuracy and security of the encrypted data.
[0189] To solve the above technical problems, the present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.
[0190] The computer device 5 includes a memory 51, a processor 52, and a network interface 53 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 5 with a memory 51, a processor 52, and a network interface 53, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0191] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0192] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, the memory 51 can also be an external storage device of the computer device 5, such as a plug-in hard disk equipped on the computer device 5, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 51 can also include both the internal storage unit of the computer device 5 and its external storage device. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the computer device 5, such as computer-readable instructions of a data encryption method for financial data, etc. In addition, the memory 51 can also be used to temporarily store various types of data that have been output or are to be output.
[0193] The processor 52 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 52 is generally used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is used to run the computer-readable instructions stored in the memory 51 or process data, such as computer-readable instructions for running the data encryption method of the financial data.
[0194] The network interface 53 may include a wireless network interface or a wired network interface. The network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.
[0195] In the above embodiment, the present application discloses a computer device, which belongs to the field of data security technology. The present application obtains the data to be processed, identifies the data field to be encrypted, and performs data discretization processing on the data field to be encrypted; then encrypts the discretized data field to obtain encrypted data and data credit score; compares the data credit score with the credit score threshold; when the credit score is less than or equal to the threshold, the encrypted data is used as the data encryption result. When the credit score is greater than the threshold, the encrypted data field is field screened; the screened target data field to be encrypted is data discretized; the target discretized data field is data encrypted to obtain new encrypted data and new data credit score, wherein the new data credit score is less than or equal to the threshold; the new encrypted data is used as the data encryption result. The present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and through the field credit score comparison, when the credit score is greater than the threshold, the encrypted field is dynamically screened for data encryption, further reducing the amount of encrypted data, not only shortening the encryption time, but also ensuring the accuracy and security of the encrypted data.
[0196] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the data encryption method for financial data as described above.
[0197] In the above embodiment, the present application discloses a computer-readable storage medium, which belongs to the field of data security technology. The present application obtains the data to be processed, identifies the data field to be encrypted, and performs data discretization processing on the encrypted data field; then encrypts the discretized data field to obtain encrypted data and data credit score; compares the data credit score with the credit score threshold; when the credit score is less than or equal to the threshold, the encrypted data is used as the data encryption result. When the credit score is greater than the threshold, the encrypted data field is field screened; the screened target data field to be encrypted is data discretized; the target discretized data field is data encrypted to obtain new encrypted data and new data credit score, wherein the new data credit score is less than or equal to the threshold; the new encrypted data is used as the data encryption result. The present application first discretizes the data field to be encrypted, and then encrypts the data to reduce the amount of encrypted data, and through the field credit score comparison, when the credit score is greater than the threshold, the encrypted field is dynamically screened for data encryption, further reducing the amount of encrypted data, not only shortening the encryption time, but also ensuring the accuracy and security of the encrypted data.
[0198] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0199] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A data encryption method for financial data, characterized in that: include: Acquire the data to be processed from the financial data center, and identify the data field to be encrypted in the data to be processed; Performing data discretization processing on the data field to be encrypted to obtain a discretized data field; Using a homomorphic encryption algorithm to encrypt the discretized data field to obtain first encrypted data and a first data credit score; Comparing the first data credit score with a preset credit score threshold; When the first data credit score is less than or equal to the credit score threshold, using the first encrypted data as the data encryption result of the data to be processed; When the first data credit score is greater than the credit score threshold, field screening is performed on the data field to be encrypted to obtain a target data field to be encrypted; Performing data discretization processing on the target data field to be encrypted to obtain a target discretized data field; Using a homomorphic encryption algorithm to encrypt the target discretized data field to obtain second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to the credit score threshold; The second encrypted data is used as the data encryption result of the data to be processed.
2. The method for encrypting financial data according to claim 1, characterized in that: The step of performing data discretization processing on the data field to be encrypted to obtain a discretized data field specifically includes: Identify the field type of the data field to be encrypted, wherein the field type includes integer type, floating point type and string type; Obtain a preset data discretization rule engine, wherein the data discretization rule engine includes data discretization rules corresponding to various field types; Based on the field type of the data field to be encrypted, the data discretization rule engine is used to perform data discretization processing to obtain the discretized data field.
3. The method for encrypting financial data according to claim 1, characterized in that: The step of using a homomorphic encryption algorithm to encrypt the discretized data field to obtain first encrypted data and a first data credit score specifically includes: Encrypting each discretized data field in the data to be processed in sequence to obtain the first encrypted data; Obtaining the data encryption field corresponding to each of the discretized data fields, and calculating the field score of each of the data encryption fields; Configuring a corresponding field score weight for each of the data encryption fields; The field scores of the data encryption fields are weighted and summed based on the field score weights to obtain the first data credit score.
4. The method for encrypting financial data according to claim 3, characterized in that: Before the step of comparing the first data credit score with a preset credit score threshold, the method further includes: A configuration data template library is configured, wherein the data template library is configured with a plurality of historical encrypted data templates, and each of the historical encrypted data templates includes a plurality of historical reference fields; The step of obtaining the data encryption field corresponding to each of the discretized data fields and calculating the field score of each of the data encryption fields specifically includes: Determining a target historical encrypted data template corresponding to the first encrypted data in the data template library; identifying, in the target historical encrypted data template, historical reference fields that match each of the data encryption fields; Based on each of the data encryption fields and a historical reference field that matches each of the data encryption fields, a field score of each of the data encryption fields is calculated.
5. The method for encrypting financial data according to claim 4, characterized in that: Each of the target historical encrypted data templates is configured with a historical credit score, and the step of comparing the first data credit score with a preset credit score threshold specifically includes: Obtain the historical credit score corresponding to the target historical encrypted data template to obtain the target historical credit score; Using the target historical credit score as the credit score threshold; The first data credit score is compared with the credit score threshold to determine the magnitude relationship between the first data credit score and the credit score threshold.
6. The method for encrypting financial data according to claim 2, characterized in that: The step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes: Determine the string-type to-be-encrypted data field as the target to-be-encrypted data field; Or both the floating-point data field to be encrypted and the character string data field to be encrypted are determined as the target data field to be encrypted.
7. The method for encrypting financial data according to claim 5, characterized in that: The step of performing field screening on the data field to be encrypted to obtain the target data field to be encrypted specifically includes: Inputting the data to be processed into a pre-trained field encryption prediction model to obtain a field encryption prediction result; Performing field screening on the data field to be encrypted based on the field encryption prediction result to obtain the target data field to be encrypted; Before the step of screening the data field to be encrypted to obtain the target data field to be encrypted, the method further includes: Determine the original data template corresponding to each of the historical encrypted data templates, and mark the historical encrypted data fields in each of the original data templates; A training data set for constructing a model based on each of the labeled original data templates; Using the training data set to train a preset initial prediction model to obtain an initial field prediction result, wherein the initial field prediction result includes predicting a data field to be encrypted; The predicted data field to be encrypted is compared with the historical encrypted data field to obtain a prediction error, and the initial prediction model is iteratively updated based on the prediction error until the model is fitted to obtain the field encryption prediction model.
8. A data encryption device for financial data, characterized in that: include: A field identification module, used to obtain the data to be processed from the financial data center and identify the data field to be encrypted in the data to be processed; A first discretization module is used to perform data discretization processing on the data field to be encrypted to obtain a discretized data field; A first encryption module, used to encrypt the discretized data field using a homomorphic encryption algorithm to obtain first encrypted data and a first data credit score; A score comparison module, used to compare the first data credit score with a preset credit score threshold; A first output module, configured to use the first encrypted data as a data encryption result of the data to be processed when the first data credit score is less than or equal to the credit score threshold; A field screening module, configured to screen the data field to be encrypted to obtain a target data field to be encrypted when the credit score of the first data is greater than the credit score threshold; A second discretization module is used to perform data discretization processing on the target data field to be encrypted to obtain a target discretized data field; A second encryption module, configured to encrypt the target discretized data field using a homomorphic encryption algorithm to obtain second encrypted data and a second data credit score, wherein the second data credit score is less than or equal to the credit score threshold; The second output module is used to use the second encrypted data as the data encryption result of the data to be processed.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the data encryption method for financial data as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the data encryption method for financial data according to any one of claims 1 to 7.