Data processing method and device, equipment, medium and program product
By determining the fields to be encrypted based on the data table and encryption configuration information when the data is stored, some data in the database is encrypted, and the problem of large amount of encrypted data and low processing efficiency in the prior art is solved, and efficient data encryption and decryption processing is realized.
Patent Information
- Application Number
- CN202411793142.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
When encrypting data in a database, all data in the specified columns in the data table are usually encrypted, resulting in large amounts of encrypted data and low processing efficiency. Especially when adding new fields to the data table, the entire JSON format column needs to be encrypted, and some data cannot be encrypted.
When executing the data storage request, the fields to be encrypted and the corresponding encryption algorithm are determined based on the data table, target column and preset encryption configuration information, and the data corresponding to the specified fields in the service data are encrypted, and the data corresponding to the specified fields are encrypted only if the data format is in the preset format.
It effectively reduces the amount of encrypted data, improves data processing efficiency, and improves the convenience of using non-sensitive data while improving the security of sensitive data.
Smart Images

Figure CN119720244A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a data processing method, device, equipment, medium and program product. Background Art
[0002] In the course of business operations, the customer's name, ID number, mobile phone number, address and other data are usually stored in the database. These data may be stored in different columns of the data table, or they may be stored in the same column of the data table. In order to improve security, sensitive data (such as the customer's ID number, mobile phone number, etc.) will be encrypted and stored, and then decrypted when used. In the related art, when encrypting data in the database, the method usually adopted is to encrypt all data stored in the specified column of the data table. Summary of the invention
[0003] The present application provides a data processing method, apparatus, device, medium and program product. The embodiments of the present application can, when executing a data storage request, encrypt part of the data in the business data when the data format of the column to which the business data belongs is a preset format, thereby effectively reducing the amount of encrypted data and improving data processing efficiency.
[0004] In a first aspect, the present application provides a data processing method, which includes: determining a first data table storing the first business data and a first target column in the first data table according to first business data in a data storage request; when the data format of the first target column is a preset format, determining a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information; encrypting the data corresponding to the first field in the first business data according to the encryption algorithm to obtain second business data; and storing the second business data in the first target column in the first data table.
[0005] In a second aspect, the present application provides a data processing device, which includes: a first determination module, used to determine a first data table storing the first business data and a first target column in the first data table according to the first business data in a data storage request; a second determination module, used to determine a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information when the data format of the first target column is a preset format; an encryption module, used to encrypt the data corresponding to the first field in the first business data according to the encryption algorithm to obtain second business data; and a first storage module, used to store the second business data in the first target column in the first data table.
[0006] In a third aspect, the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can perform the above-mentioned data processing method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned data processing method when executed by a processor.
[0008] In a fifth aspect, the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned data processing method.
[0009] The embodiment provided by the present application can determine the first data table storing the first business data and the first target column in the first data table according to the first business data in the data storage request, and when the data format of the first target column is a preset format, determine the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field according to the first data table, the first target column and the preset encryption configuration information; then, according to the encryption algorithm, encrypt the data corresponding to the first field in the first business data to obtain the second business data, and store the second business data in the first target column in the first data table, so that when executing the data storage request, when the data format of the column to which the business data belongs is the preset format, only part of the data in the business data (such as sensitive data) is encrypted without encrypting the business data as a whole, thereby effectively reducing the amount of encrypted data and improving data processing efficiency.
[0010] In addition, when the data format of the column to which the business data belongs is a preset format, encryption of sensitive data in the business data and non-sensitive data non-encryption are achieved in this way, thereby improving the security of sensitive data in the business data while also improving the ease of use of non-sensitive data in the business data.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:
[0013] Figure 1 An application scenario diagram of a data processing method and device provided in an embodiment of the present application;
[0014] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0015] Figure 3 A flowchart of a data processing method provided in an embodiment of the present application;
[0016] Figure 4 A block diagram of a data processing device provided in an embodiment of the present application;
[0017] Figure 5 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solution of the present application, the exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0019] In the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.
[0020] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0021] The terms used herein are only used to describe specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined herein.
[0023] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity reference is eliminated to avoid precise positioning of specific individuals.
[0024] Figure 1 The application scenario diagram of the data processing method and device provided in the embodiments of the present application is schematically shown.
[0025] like Figure 1 As shown, the application scenario of the embodiment of the present application may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0026] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0027] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0028] The server 102 may be a server that provides various services, such as a background management server that provides support for websites browsed by users using the terminal device 101 (for example only). The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device. For another example, the server 102 is a server that provides database services for applications on the terminal device 101.
[0029] It should be noted that the data processing method and apparatus provided in the embodiment of the present application can be executed by the server 102. Accordingly, the data processing method and apparatus provided in the embodiment of the present application can be set in the server 102. The data processing method and apparatus provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102. Accordingly, the data processing method and apparatus provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102.
[0030] The data processing method and apparatus provided in the embodiment of the present application may also be executed by the terminal device 101. Accordingly, a database is deployed on the server 102 so that the application program on the terminal device 101 can access it.
[0031] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0032] In the course of business operations, the customer's name, ID number, mobile phone number, address and other data are usually stored in the database. In order to improve security, sensitive data (such as the customer's ID number, mobile phone number, etc.) is usually encrypted and stored, and then decrypted when used.
[0033] In the related art, when encrypting data in a database, the method usually adopted is to encrypt the data in the specified columns of the data table. For example, assuming that the data table TableA in the database includes 5 columns, namely C1, C2, C3, C4, and C5, among which the C2 column stores sensitive data, then the data in the C2 column can be specified to be encrypted. When storing data Data in the C2 column of the data table TableA, the data Data will be encrypted according to the encryption algorithm corresponding to the C2 column of the data table TableA, and then the encrypted data Data will be stored in the C2 column of TableA.
[0034] As the business of an enterprise develops, it is usually necessary to add new fields to the data table to meet the storage needs of business data. In order to improve the stability of the system, for any data table that needs to add fields, a column with a data format of JSON (JavaScript Object Notation, JS object notation, is a data exchange format that uses a text format independent of the programming language to store and represent data) is usually added to the data table. The data in the column are all represented and stored in JSON format; then the newly added fields and their corresponding data are added to the column. Therefore, when the data format of the column is JSON format, the data of the column includes multiple fields represented in JSON format and the data corresponding to each field.
[0035] When using the above-mentioned designated column encryption method to encrypt data in a column whose data format is JSON format, the data in the column is encrypted as a whole. Since the data represented in JSON format includes multiple fields and the data corresponding to each field, when it is encrypted as a whole, the amount of data that needs to be encrypted is large, the processing efficiency is low, and the performance is poor. Moreover, in most application scenarios, usually only a small number of fields (for example, one or two fields) in the data represented in JSON format correspond to sensitive data and need to be encrypted. The data corresponding to the remaining fields are non-sensitive business data and are often read, so there is no need to encrypt them. However, the above-mentioned designated column encryption method cannot encrypt part of the data represented in JSON format.
[0036] In view of this, the present application provides a data processing method, which includes: determining a first data table storing the first business data and a first target column in the first data table according to the first business data in a data storage request; when the data format of the first target column is a preset format, determining a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information; encrypting the data corresponding to the first field in the first business data according to the encryption algorithm to obtain second business data; and storing the second business data in the first target column in the first data table.
[0037] According to the data processing method of the embodiment of the present application, it is possible to determine the first data table storing the first business data and the first target column in the first data table according to the first business data in the data storage request, and when the data format of the first target column is a preset format, determine the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field according to the first data table, the first target column and the preset encryption configuration information; then, according to the encryption algorithm, encrypt the data corresponding to the first field in the first business data to obtain the second business data, and store the second business data in the first target column in the first data table, so that when executing the data storage request, when the data format of the column to which the business data belongs is a preset format, part of the data in the business data (for example, sensitive data) can be encrypted without encrypting the business data as a whole, thereby effectively reducing the amount of encrypted data and improving data processing efficiency.
[0038] In addition, when the data format of the column to which the business data belongs is a preset format, encryption of sensitive data in the business data and non-sensitive data non-encryption are achieved in this way, thereby improving the security of sensitive data in the business data while also improving the ease of use of non-sensitive data in the business data.
[0039] The data processing method according to the embodiment of the present application can be executed by a terminal device or a server. Among them, the server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The data processing method can be implemented by a processor calling a computer-readable program instruction stored in a memory. Alternatively, the method can be executed by a server.
[0040] The data processing method of the embodiment of the present application can be applied to data encryption scenarios. For example, when the business data in the data storage request is data represented in JSON format, part of the business data can be encrypted by the data processing method of the embodiment of the present application.
[0041] In some possible implementations, the data processing method of the embodiment of the present application can be implemented by SDK (Software Development Kit). It should be noted that the data processing method of the embodiment of the present application can also be implemented by other means such as components and plug-ins, and the present application does not limit this.
[0042] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application. Figure 2 , the method comprising:
[0043] Step S21: determining, according to the first business data in the data storage request, a first data table storing the first business data and a first target column in the first data table.
[0044] The data storage request is used to store the first business data in the database, which may also be referred to as a write data request, a write request, a write operation, etc. In the process of processing the data storage request, some data (eg, sensitive data) in the first business data may be encrypted.
[0045] The data storage request includes at least one first business data. The first business data may be, for example, one or more of the customer's name, gender, ID number, telephone number, address, contact list, consumption record, etc. This application does not limit the specific content of the first business data.
[0046] For any first business data, the first data table storing the first business data and the first target column corresponding to the first business data in the first data table can be determined from the data storage request. For example, assuming that the data storage request indicates that the first business data is stored in the second row and third column of the data table TableB, then the data table TableB can be determined as the first data table storing the first business data, and the third column of TableB can be determined as the first target column corresponding to the first business data in the first data table TableB.
[0047] Step S22, when the data format of the first target column is a preset format, determine the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information.
[0048] It can be determined whether the data format of the first target column is a preset format, where the preset format refers to representing multiple fields and data corresponding to the multiple fields in a preset text format. The preset format includes the JSON format. In one example, a column whose data format is a preset format can be written into a format configuration file in the form of "table name + column name"; then, by matching the table name of the first data table and the column name of the first target column with the format configuration file, it is determined whether the data format of the first target column is the preset format.
[0049] When the data format of the first target column is a preset format, the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field can be determined according to the first data table, the first target column and the preset encryption configuration information. The preset encryption configuration information can be used to indicate the fields to be encrypted and the encryption algorithm corresponding to each field. In the preset encryption configuration information, the fields to be encrypted are represented by the table name of the data table to which the field belongs, the column name of the column to which it belongs, the field name and the encryption algorithm. In other words, the preset encryption configuration information is configured in the form of "data table name + column name + field name + encryption algorithm".
[0050] Optionally, there are multiple preset encryption configuration information, and different data columns in different data tables may have different configurations for the fields to be encrypted or the encryption algorithms. For example, the preset encryption configuration information includes: the table name is TableA, the column name is JSON-A, the field is telephone, and the encryption algorithm is SHA-1; the table name is TableB, the column name is JSON-B, the field is idCard, and the encryption algorithm is MD5.
[0051] Optionally, a configuration information can be determined from preset encryption configuration information according to the first data table and the first target column, and the first field to be encrypted in the first target column and its corresponding encryption algorithm can be determined according to the field name and encryption algorithm in the determined configuration information.
[0052] For example, assuming that the data format of the third column in the data table TableB is in JSON format, the column name is JSON-B, and the fields included in the column are expressed in JSON format, as shown below:
[0053] {"name",
[0054] "idCard",
[0055] "contacts":[
[0056] {"c-name",
[0057] "c-idCard",
[0058] "c-telephone"}]}
[0059] The JSON format represents the three fields of name (indicating the customer's name), idCard (indicating the customer's ID number), and contacts (indicating the customer's contact list), and the contacts field includes the three fields of c-name (indicating the contact's name in the contact list), c-idCard (indicating the contact's ID number in the contact list), and c-telephone (indicating the contact's mobile phone number in the contact list). Therefore, the column in the above JSON format includes six fields, which can be represented as: name, idCard, contacts, contacts[*].c-name, contacts[*].c-idCard, contacts[*].c-telephone.
[0060] Among them, contacts[*].c-name represents the c-name field in the contact list field contacts, contacts[*].c-idCard represents the c-idCard field in the contact list field contacts, and contacts[*].c-telephone represents the c-telephone in the contact list field contacts.
[0061] Assuming that the idCard field in the above JSON format column and the c-idCard field in contacts are sensitive fields and need to be encrypted, the preset encryption configuration information can be exemplified as follows:
[0062] The table name is TableB, the column name is JSON-B, the field is idCard, and the encryption algorithm is SHA-1;
[0063] The table name is TableB, the column name is JSON-B, the field is contacts[*].c-idCard, and the encryption algorithm is MD5.
[0064] The encryption algorithm may be a symmetric encryption algorithm, such as a DES (Data Encryption Standard) algorithm, an AES (Advanced Encryption Standard) algorithm, etc. The encryption algorithm may also be an asymmetric encryption algorithm, such as a DSA (Digital Signature Algorithm) algorithm, an ECC (Elliptic curve cryptography) algorithm, etc. The encryption algorithm may also be a hash algorithm, such as SHA-1 (Secure Hash Algorithm 1), MD5 (Message-Digest Algorithm 5), etc.
[0065] It should be noted that the encryption algorithm in the preset encryption configuration information can be set by those skilled in the art according to actual conditions, and this application does not limit it. The preset encryption configuration information can be implemented through configuration files, etc., and this application does not limit it.
[0066] According to the first data table and the first target column, by matching the table name and column name with the preset encryption configuration information, the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field can be determined from the preset encryption configuration information. For example, assuming that the first data table of the first business data in the data storage request is TableB, the first target column is the third column in TableB (a column in JSON format), and the column name is JSON-B, then, according to the table name TableB and the column name JSON-B of the third column, the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field are determined from the above preset encryption configuration information: the first field is idCard, and the corresponding encryption algorithm is SHA-1; the first field is contacts[*].c-idCard, and the corresponding encryption algorithm is MD5.
[0067] It should be noted that when the encryption algorithm requires an encryption key, an encryption key corresponding to the encryption algorithm can be added to the preset encryption configuration file, and when the data format of the first target column is the preset format, the first field to be encrypted in the first target column, the encryption algorithm corresponding to the first field and the encryption key corresponding to the encryption algorithm can be determined according to the first data table, the first target column and the preset encryption configuration information.
[0068] Step S23: encrypt the data corresponding to the first field in the first business data according to the encryption algorithm to obtain second business data.
[0069] The encryption algorithm may be used to encrypt the data corresponding to the first field in the first business data to obtain the second business data. When the encryption algorithm requires an encryption key, the encryption key and the encryption algorithm may be used to encrypt the data corresponding to the first field in the first business data to obtain the second business data.
[0070] The second business data corresponds to the first business data. The first business data is plain text. In the second business data, the data corresponding to the first field is encrypted and is cipher text, and the other data is not encrypted and is plain text.
[0071] For example, the first data table storing the first business data is TableB, the first target column is the third column in TableB, and the column name is JSON-B. According to the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field determined in the above example, the encryption algorithm SHA-1 can be used to encrypt the data corresponding to the field idCard in the first business data, and the encryption algorithm MD5 can be used to encrypt the data corresponding to the field contacts[*].c-idCard in the first business data, thereby obtaining the second business data corresponding to the first business data.
[0072] Step S24: store the second business data in the first target column in the first data table.
[0073] After obtaining the second business data, the second business data can be stored in the first target column of the first data table to complete the data storage. For example, in the above example, the second business data can be stored in the position of the 2nd row and the 3rd column in the data table TableB.
[0074] In some possible implementations, in an embodiment of the present application, when there are at least two first business data corresponding to a data storage request, steps S21 to S24 may be performed for each first business data, or steps S21 to S23 may be performed for each first business data, and after obtaining the second business data corresponding to each first business data, step S24 is performed uniformly. It should be noted that those skilled in the art may determine the specific execution method of the above steps according to the actual request, and the present application does not limit this.
[0075] The data processing method according to the embodiment of the present application is described below.
[0076] As mentioned above, in step S23, the data corresponding to the first field in the first business data may be encrypted according to the encryption algorithm to obtain second business data.
[0077] In some possible implementations, step S23 may include: determining first data corresponding to the first field from the first business data; encrypting the first data according to the encryption algorithm to obtain second data; replacing the first data in the first business data with the second data to obtain the second business data.
[0078] When encrypting the data corresponding to the first field in the first business data, the first data corresponding to the first field can be first determined from the first business data, that is, the data to be encrypted can be first determined from the first business data, and the data to be encrypted can be determined as the first data. Then, the first data can be encrypted using an encryption algorithm to obtain the second data, or the first data can be encrypted using an encryption key and an encryption algorithm to obtain the second data, wherein the second data corresponds to the first data, the first data is plain text, and the second data is cipher text. Then, the first data in the first business data is replaced with the second data to obtain the second business data.
[0079] For example, assuming that the first business data in the data storage request is data in JSON format, the specific examples are as follows:
[0080] {"name":"XXXXXX",
[0081] "idCard":"1111####11####1111",
[0082] "contacts":[{"c-name":"YYYYYY",
[0083] "c-idCard":"1111####22####2222",
[0084] "c-telephone":"191####0000"}
[0085] {"c-name":"ZZZZZZ",
[0086] "c-idCard":"1111####33####3333",
[0087] "c-telephone":"192####0000"}]}
[0088] The encryption process can be, for example:
[0089] According to the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field (the first field is idCard, and the corresponding encryption algorithm is SHA-1; the first field is contacts[*].c-idCard, and the corresponding encryption algorithm is MD5), when encrypting the data corresponding to the first field in the first business data, first determine the first data corresponding to the first field idCard and contacts[*].c-idCard from the first business data: "1111####11####1111" (corresponding to the first field idCard), "1111####22####2222" (corresponding to the first field contacts[*].c-idCard), and "1111####33####3333" (corresponding to the first field contacts[*].c-idCard).
[0090] Then, the encryption algorithm is used to encrypt the first data to obtain the second data. For the first data "1111####11####1111", the encryption algorithm SHA-1 is used to encrypt the first data to obtain the second data "1****************1". For the first data "1111####22####2222", the encryption algorithm MD5 is used to encrypt the first data to obtain the second data "1****************2". For the first data "1111####33####3333", the encryption algorithm MD5 is used to encrypt the first data to obtain the second data "1****************3".
[0091] Then, the first data (plain text) corresponding to the first field "idCard" and contacts[*].c-idCard in the first business data is replaced with the encrypted second data (ciphertext) to obtain the second business data, which can be specifically exemplified as follows:
[0092] {"name":"XXXXXX",
[0093] "idCard":"1******************1",
[0094] "contacts":[
[0095] {"c-name":"YYYYYY",
[0096] "c-idCard":"1****************2",
[0097] "c-telephone":"191####0000"}
[0098] {"c-name":"ZZZZZZ",
[0099] "c-idCard":"1****************3",
[0100] "c-telephone":"192####0000"}]}
[0101] In an embodiment of the present application, the first data corresponding to the first field can be determined from the first business data, and the first data can be encrypted according to an encryption algorithm to obtain second data, and then the first data in the first business data is replaced with the second data to obtain the second business data, so that the data to be encrypted can be extracted from the first business data, and the second business data can be obtained after encryption and replacement, thereby improving the accuracy of the encryption process and thereby improving the accuracy of the second business data.
[0102] In some possible implementations, determining the first data corresponding to the first field from the first business data includes: traversing each field of the first business data to determine the first data corresponding to the first field.
[0103] When determining the first data corresponding to the first field, the first business data may be traversed according to the first field, and the first data corresponding to the first field may be determined from the first business data. The first business data may have one field or multiple fields, and each field in the first business data is traversed to determine the first data corresponding to the first field.
[0104] The first data may be one or more. For example, when the data type of the first field is a list, array, or other type, there are multiple first data corresponding to the first field; when the data type of the first field is an integer, floating point, string, or other type, there is one first data corresponding to the first field.
[0105] In the embodiment of the present application, by traversing each field of the first business data to determine the first data corresponding to the first field, the first data can be accurately determined from the first business data, thereby improving the extraction accuracy of the first data.
[0106] In some possible implementations, after obtaining the first data, an encryption algorithm may be used to encrypt the first data to obtain the second data. In the case of multiple first data, an encryption algorithm may be used to encrypt each first data to obtain the second data.
[0107] In some application scenarios, data storage requests are implemented based on database middleware (such as Sharding-JDBC). In this case, the process of encrypting the business data in the data storage request is as follows: first determine the encryption algorithm based on the table name and column name to which the business data is stored, and then encrypt the business data using the encryptor corresponding to the encryption algorithm. In this process, the encryptor can only obtain the business data to be encrypted, but cannot obtain the table name and column name of the business data.
[0108] The data processing method of the embodiment of the present application can be implemented through SDK, which includes a preset encryptor (i.e., an encryptor corresponding to a preset format, which can also be called a custom encryptor). If the above encryption processing flow is used, the preset encryptor can only obtain the first business data to be encrypted, but cannot obtain the table name of the first data table storing the first business data and the column name of the first target column. In this way, it is impossible to determine the first field to be encrypted and the encryption algorithm based on the table name of the first data table and the column name of the first target column, and it is also impossible to encrypt part of the data in the first business data.
[0109] Based on this, the data processing method of the embodiment of the present application may also include: when the data format of the first target column is a preset format, determining a first storage space of a preset size; storing the table name of the first data table and the column name of the first target column in the first storage space.
[0110] When the data format of the first target column is a preset format, a first storage space of a preset size can be applied for, and the first storage space can be accessed by a preset encryptor. The specific size and location of the first storage space here can be set by a person skilled in the art according to actual conditions, and this application does not limit this. After applying for the first storage space of a preset size, the table name of the first data table and the column name of the first target column can be stored in the first storage space. For example, the table name TableB of the above-mentioned first data table and the column name JSON-B of the first target column are stored in the first storage space.
[0111] In an embodiment of the present application, during the encryption process, when the data format of the first target column is a preset format, a first storage space of a preset size is determined, and the table name of the first data table and the column name of the first target column are stored in the first storage space, so that the table name of the first data table and the column name of the first target column can be stored for use in the data encryption process.
[0112] In some possible implementations, the above step S22 may include: obtaining the table name and the column name from the first storage space; determining the first configuration information corresponding to the table name and the column name from the preset encryption configuration information; determining the field in the first configuration information as the first field to be encrypted; and determining the encryption algorithm corresponding to the first field from the first configuration information.
[0113] When determining the first target field to be encrypted and the encryption algorithm in the first target column, the table name (e.g., TalbeB) of the first data table and the column name (e.g., JSON-B) of the first target column can be obtained from the first storage space, and the first configuration information corresponding to the table name and column name can be determined from the preset encryption configuration information by matching the obtained table name (TalbeB) and column name (JSON-B) with the preset encryption configuration information. Then, the fields (idCard and contacts[*].c-idCard) in the first configuration information are determined as the first target field to be encrypted, and the encryption algorithm corresponding to the first target field is determined from the first configuration information.
[0114] In an embodiment of the present application, the table name and column name can be obtained from the first storage space, and based on the obtained table name and column name, the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field can be determined from the preset encryption configuration information. Therefore, when determining the first field to be encrypted in the first target column and the encryption algorithm corresponding to the first field, the table name and column name stored in the first storage space can be used, which improves the convenience of program execution and further improves processing efficiency.
[0115] In some possible implementations, the method further includes: after obtaining the second business data, deleting the table name of the first data table and the column name of the first target column in the first storage space; and releasing the first storage space.
[0116] After obtaining the second business data, it can be considered that the encryption processing of the first business data has been completed, and the table name of the first data table and the column name of the first target column stored in the first storage space can be deleted, and then the first storage space is released.
[0117] In an embodiment of the present application, after obtaining the second business data, the table name of the first data table and the column name of the first target column in the first storage space are deleted, and the first storage space is released, so that the first storage space can be released in time after use, thereby improving the utilization rate of the storage space.
[0118] The above embodiment exemplarily illustrates the data encryption process, and the following embodiment exemplarily illustrates the data decryption process.
[0119] Figure 3A flowchart of a data processing method provided in an embodiment of the present application. Figure 3 , the method further comprises:
[0120] Step S31: acquiring the second business data from a database according to a data query request for the second business data.
[0121] After the second business data is stored in the first data table of the database, the second business data can be read from the database through a data query request. The data query request for the second business data is used to read the second business data from the database. The location of the second business data in the database (table name, column name, etc. of the data table) can be obtained from the data query request for the second business data, and then the data is read from the database according to the location, and the read data is determined as the second business data. The second business data can be one or more. The second business data can be, for example, one or more of the customer's name, gender, ID number, telephone number, address, contact list, consumption record and other data. This application does not limit the specific content of the second business data.
[0122] The second service data includes both plaintext data and ciphertext data. In the process of processing the data query request, the ciphertext data in the second service data may be decrypted.
[0123] Step S32, when the data format of the first target column to which the second business data belongs is the preset format, determine the first field to be decrypted in the first target column and the decryption algorithm corresponding to the second field according to the first data table to which the second business data belongs, the first target column and the preset decryption configuration information.
[0124] The first data table and the first target column to which the second business data belongs can be determined from the data query request for the second business data. For example, assuming that the data query request for the second business data indicates to read the second business data from the third column of the data table TableB, then TableB can be determined as the first data table to which the second business data belongs, and the third column in TableB can be determined as the first target column to which the second business data belongs.
[0125] Then it can be determined whether the data format of the first target column is a preset format. In the case where the data format of the first target column is a preset format, the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field are determined according to the first data table to which the second business data belongs, the first target column and the preset decryption configuration information. Among them, the preset decryption configuration information can be used to indicate the fields to be decrypted and the decryption algorithm corresponding to each field. In the preset decryption configuration information, the fields to be decrypted are represented by the table name of the data table to which the field belongs, the column name of the column to which it belongs, the field name and the decryption algorithm. In other words, the preset decryption configuration information is configured in the form of "data table name + column name + field name + decryption algorithm".
[0126] For example, assuming that the data format of the third column in the data table TableB is in JSON format, and the column name is JSON-B, the fields included in the column are expressed in JSON format, as shown below:
[0127] {"name",
[0128] "idCard",
[0129] "contacts":[{
[0130] "c-name",
[0131] "c-idCard",
[0132] "c-telephone"}]}
[0133] Assume that the idCard field in the above JSON format column and the c-idCard field in contacts are sensitive fields, the data is encrypted and stored, and needs to be decrypted when reading. Then, the preset decryption configuration information can be exemplified as follows:
[0134] The table name is TableB, the column name is JSON-B, the field is idCard, and the decryption algorithm is SHA-1;
[0135] The table name is TableB, the column name is JSON-B, the field is contacts[*].c-idCard, and the decryption algorithm is MD5.
[0136] It should be noted that, in general, the decryption algorithm is the same as the encryption algorithm. In order to distinguish the encryption process from the decryption process, the encryption algorithm and the decryption algorithm are used to describe them separately in this application. Those skilled in the art set the decryption algorithm in the preset decryption configuration information according to actual conditions, and this application does not limit it. The preset decryption configuration information can be implemented by means of a configuration file, etc., and this application does not limit it.
[0137] According to the first data table and the first target column, by matching the table name and column name with the preset decryption configuration information, the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field can be determined from the preset decryption configuration information. For example, assuming that the first data table of the second business data is TableB, the first target column is the third column in TableB (a column in the data format JSON format), and the column name is JSON-B, then, according to the table name TableB and the column name JSON-B of the third column, the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field are determined from the above preset decryption configuration information: the first field is idCard, and the corresponding decryption algorithm is SHA-1; the first field is contacts[*].c-idCard, and the corresponding decryption algorithm is MD5.
[0138] It should be noted that when the decryption algorithm requires a decryption key, a decryption key corresponding to the decryption algorithm can be added to the preset decryption configuration file, and when the data format of the first target column is the preset format, the first field to be decrypted in the first target column, the decryption algorithm corresponding to the first field and the decryption key corresponding to the decryption algorithm can be determined according to the first data table, the first target column and the preset decryption configuration information.
[0139] Step S33: Decrypt the data corresponding to the first field in the second business data according to the decryption algorithm to obtain the first business data.
[0140] The decryption algorithm may be used to decrypt the data corresponding to the first field in the second business data to obtain the first business data. If the decryption algorithm requires a decryption key, the decryption key and the decryption algorithm may be used to decrypt the data corresponding to the first field in the second business data to obtain the first business data.
[0141] The first business data corresponds to the second business data. In the second business data, the data corresponding to the second field is encrypted and is ciphertext, and the other data is not encrypted and is plaintext. After decryption, the first business data is plaintext.
[0142] For example, the first data table to which the second business data belongs is TableB, the first target column is the third column in TableB, and the column name is JSON-B. According to the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field determined in the above example, the decryption algorithm SHA-1 can be used to decrypt the data corresponding to the field idCard in the second business data, and the decryption algorithm MD5 can be used to decrypt the data corresponding to the field contacts[*].c-idCard in the second business data, thereby obtaining the first business data corresponding to the second business data.
[0143] Step S34: sending the first business data to the sender of the data query request.
[0144] After obtaining the first service data, the first service data may be sent to a sender of the data query request (eg, an application program, etc.) to complete the data query.
[0145] According to the data processing method of the embodiment of the present application, the second business data can be obtained from the database according to the data query request for the second business data, and when the data format of the first target column to which the second business data belongs is a preset format, the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field are determined according to the first data table, the first target column and the preset decryption configuration information to which the second business data belongs; then, according to the decryption algorithm, the data corresponding to the first field in the second business data is decrypted to obtain the first business data, and the first business data is sent to the sender of the data query request, so that when the data query is performed, when the data format of the column to which the read business data (including both plaintext data and ciphertext data) belongs is a preset format, the ciphertext data in the business data can be decrypted. Since the ciphertext data only accounts for a part of the business data, compared with decrypting the business data as a whole, this method effectively reduces the amount of decrypted data, thereby improving data processing efficiency.
[0146] In some possible implementations, step S33 may include: determining second data corresponding to the first field from the second business data; decrypting the second data according to the decryption algorithm to obtain first data; replacing the second data in the second business data with the first data to obtain the first business data.
[0147] When decrypting the data corresponding to the first field in the second business data, the second data corresponding to the first field can be first determined from the second business data, that is, the data to be decrypted can be first determined from the second business data, and the data to be decrypted can be determined as the second data. Then, the second data can be decrypted using the decryption algorithm to obtain the first data, or the second data can be decrypted using the decryption key and the decryption algorithm to obtain the first data, wherein the first data corresponds to the second data, the second data is ciphertext, and the first data is plaintext. Then, the second data in the second business data is replaced with the first data to obtain the first business data.
[0148] For example, assuming that the second business data is in JSON format, the specific examples are as follows:
[0149] {"name":"XXXXXX",
[0150] "idCard":"1******************1",
[0151] "contacts":[
[0152] {"c-name":"YYYYYY",
[0153] "c-idCard":"1****************2",
[0154] "c-telephone":"191####0000"}
[0155] {"c-name":"ZZZZZZ",
[0156] "c-idCard":"1****************3",
[0157] "c-telephone":"192####0000"}]}
[0158] The decryption process can be, for example:
[0159] According to the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field (the first field is idCard, and the corresponding decryption algorithm is SHA-1; the first field is contacts[*].c-idCard, and the corresponding decryption algorithm is MD5), when decrypting the data corresponding to the first field in the second business data, first determine from the second business data the second data corresponding to the first field idCard and contacts[*].c-idCard: "1****************1" (corresponding to the first field idCard), "1****************2" (corresponding to the first field contacts[*].c-idCard), and "1****************3" (corresponding to the first field contacts[*].c-idCard).
[0160] Then, the decryption algorithm is used to decrypt the second data to obtain the first data. For the second data "1****************1", the decryption algorithm SHA-1 is used to decrypt the second data to obtain the first data "1111####11####1111". For the second data "1****************2", the decryption algorithm MD5 is used to decrypt the second data to obtain the first data "1111####22####2222". For the second data "1****************3", the decryption algorithm MD5 is used to decrypt the second data to obtain the first data "1111####33####3333".
[0161] Then, the second data (ciphertext) corresponding to the first field "idCard" and contacts[*].c-idCard in the second business data is replaced with the decrypted first data (plaintext) to obtain the first business data, which can be specifically illustrated as follows:
[0162] {"name":"XXXXXX",
[0163] "idCard":"1111####11####1111",
[0164] "contacts":[{"c-name":"YYYYYY",
[0165] "c-idCard":"1111####22####2222",
[0166] "c-telephone":"191####0000"}
[0167] {"c-name":"ZZZZZZ",
[0168] "c-idCard":"1111####33####3333",
[0169] "c-telephone":"192####0000"}]}
[0170] In an embodiment of the present application, the second data corresponding to the first field can be determined from the second business data, and the second data can be decrypted according to the decryption algorithm to obtain the first data, and then the second data in the second business data is replaced with the first data to obtain the first business data, so that the data to be decrypted can be extracted from the second business data, and the first business data can be obtained after decryption and replacement, thereby improving the accuracy of the decryption process and thereby improving the accuracy of the first business data.
[0171] In some possible implementations, determining the second data corresponding to the first field from the second business data includes: traversing each field of the second business data to determine the second data corresponding to the first field.
[0172] When determining the second data corresponding to the first field, the second business data can be traversed according to the first field, and the second data corresponding to the first field can be determined from the second business data. The second data can be one or more. For example, when the data type of the first field is a list, array, etc., there are multiple second data corresponding to the first field; when the data type of the first field is an integer, floating point, string, etc., there is one second data corresponding to the first field.
[0173] In the embodiment of the present application, the second data corresponding to the first field is determined by traversing each field of the second business data, so that the second data can be accurately determined from the second business data, thereby improving the accuracy of extracting the second data.
[0174] In some possible implementations, after obtaining the second data, a decryption algorithm may be used to decrypt the second data to obtain the first data. In the case of multiple second data, a decryption algorithm may be used to decrypt each second data to obtain the first data.
[0175] In some application scenarios, data query requests are implemented based on database middleware (such as Sharding-JDBC). In this case, the process of decrypting the business data in the data query request is as follows: first determine the decryption algorithm based on the table name and column name to which the business data belongs, and then decrypt the business data using the decryptor corresponding to the decryption algorithm. In this process, the decryptor can only obtain the business data to be decrypted, but cannot obtain the table name and column name to which the business data belongs.
[0176] The data processing method of the embodiment of the present application can be implemented through SDK, which includes a preset decryptor (i.e., a decryptor corresponding to a preset format, which can also be called a custom decryptor). If the above decryption processing flow is used, the preset decryptor can only obtain the second business data to be decrypted, but cannot obtain the table name of the first data table to which the second business data belongs and the column name of the first target column. In this way, it is impossible to determine the first field to be decrypted and the decryption algorithm based on the table name of the first data table and the column name of the first target column, and it is also impossible to decrypt the ciphertext data in the second business data.
[0177] Based on this, the data processing method of the embodiment of the present application may also include: when the data format of the first target column is a preset format, determining a second storage space of a preset size; storing the table name of the first data table and the column name of the first target column in the second storage space.
[0178] When the data format of the first target column is a preset format, a second storage space of a preset size can be applied for, and the second storage space can be accessed by a preset decryptor. The specific size and location of the second storage space here can be set by a person skilled in the art according to actual conditions, and this application does not limit this. After applying for a second storage space of a preset size, the table name of the first data table and the column name of the first target column can be stored in the second storage space. For example, the table name TableB of the first data table and the column name JSON-B of the first target column are stored in the second storage space.
[0179] In an embodiment of the present application, during the decryption process, when the data format of the first target column is a preset format, a second storage space of a preset size is determined, and the table name of the first data table and the column name of the first target column are stored in the second storage space, so that the table name of the first data table and the column name of the first target column can be stored for use in the data decryption process.
[0180] In some possible implementations, the above-mentioned step S32 may include: obtaining the table name of the first data table and the column name of the first target column from the second storage space; determining the second configuration information corresponding to the table name of the first data table and the column name of the first target column from the preset decryption configuration information; determining the field in the second configuration information as the first field to be decrypted; and determining the decryption algorithm corresponding to the first field from the second configuration information.
[0181] When determining the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field, the table name (TalbeB) of the first data table and the column name (JSON-B) of the first target column can be obtained from the second storage space, and the second configuration information corresponding to the table name and the column name can be determined from the preset decryption configuration information by matching the obtained table name (TalbeB) and column name (JSON-B) with the preset decryption configuration information. Then, the fields (idCard and contacts[*].c-idCard) in the second configuration information are determined as the first field to be decrypted, and the decryption algorithm corresponding to the first field is determined from the second configuration information.
[0182] In an embodiment of the present application, the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field can be determined from the preset decryption configuration information based on the table name and column name obtained from the second storage space, and based on the obtained table name and column name. Therefore, when determining the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field, the table name and column name stored in the second storage space can be used, thereby improving the convenience of program execution and further improving processing efficiency.
[0183] In some possible implementations, the method further includes: after obtaining the first business data, deleting the table name of the first data table and the column name of the first target column in the second storage space; and releasing the second storage space.
[0184] After obtaining the first business data, it can be considered that the decryption processing of the second business data has been completed, and the table name of the first data table and the column name of the first target column stored in the second storage space can be deleted, and then the second storage space can be released.
[0185] In an embodiment of the present application, after obtaining the first business data, the table name of the first data table and the column name of the first target column in the second storage space are deleted, and the second storage space is released, so that the second storage space can be released in time after use, thereby improving the utilization rate of the storage space.
[0186] It can be understood that the above-mentioned various method embodiments mentioned in this application can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, this application will not go into details. Those skilled in the art can understand that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined by its function and possible internal logic.
[0187] In addition, the present application also provides a data processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any data processing method provided by the present application. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0188] Figure 4 A block diagram of a data processing device provided in an embodiment of the present application.
[0189] Reference Figure 4 , an embodiment of the present application provides a data processing device, the data processing device comprising:
[0190] A first determination module 41 is used to determine a first data table storing the first business data and a first target column in the first data table according to the first business data in the data storage request;
[0191] A second determination module 42 is used to determine a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information when the data format of the first target column is a preset format;
[0192] An encryption module 43, configured to encrypt data corresponding to the first field in the first service data according to the encryption algorithm to obtain second service data;
[0193] The first storage module 44 is used to store the second business data in the first target column in the first data table.
[0194] In some possible implementations, the encryption module 43 includes: a first determination submodule, used to determine the first data corresponding to the first field from the first business data; an encryption submodule, used to encrypt the first data according to the encryption algorithm to obtain second data; and a replacement submodule, used to replace the first data in the first business data with the second data to obtain the second business data.
[0195] In some possible implementations, the first determination submodule is used to: traverse each field of the first business data to determine the first data corresponding to the first field.
[0196] In some possible implementations, the device also includes: a third determination module, used to determine a first storage space of a preset size when the data format of the first target column is a preset format; and a second storage module, storing the table name of the first data table and the column name of the first target column in the first storage space.
[0197] In some possible implementations, the second determination module 42 includes: an acquisition submodule, used to obtain the table name and the column name from the first storage space; a second determination submodule, used to determine the first configuration information corresponding to the table name and the column name from the preset encryption configuration information; a third determination submodule, used to determine the field in the first configuration information as the first field to be encrypted; and a fourth determination submodule, used to determine the encryption algorithm corresponding to the first field from the first configuration information.
[0198] In some possible implementations, the device also includes: an acquisition module, used to acquire the second business data from a database according to a data query request for the second business data; a fourth determination module, used to determine the first field to be decrypted in the first target column and the decryption algorithm corresponding to the first field according to the first data table to which the second business data belongs, the first target column and preset decryption configuration information, when the data format of the first target column to which the second business data belongs is the preset format; a decryption module, used to decrypt the data corresponding to the first field in the second business data according to the decryption algorithm to obtain the first business data; and a sending module, used to send the first business data to the sender of the data query request.
[0199] In some possible implementations, the preset format refers to representing multiple fields and data corresponding to the multiple fields by using a preset text format.
[0200] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0201] Figure 5 A block diagram of an electronic device provided in an embodiment of the present application.
[0202] Reference Figure 5 An embodiment of the present application provides an electronic device, which includes: at least one processor 701; at least one memory 702, and one or more I / O interfaces 703, connected between the processor 701 and the memory 702; wherein the memory 702 stores one or more computer programs that can be executed by at least one processor 701, and the one or more computer programs are executed by at least one processor 701 so that the at least one processor 701 can execute the above-mentioned data processing method.
[0203] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0204] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned data processing method when executed by a processor. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0205] An embodiment of the present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned data processing method.
[0206] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0207] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0208] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0209] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.
[0210] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0211] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0212] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0213] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0214] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.
[0215] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.
Claims
1. A data processing method, characterized in that: include: Determine, according to the first business data in the data storage request, a first data table storing the first business data and a first target column in the first data table; In a case where the data format of the first target column is a preset format, determining a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field according to the first data table, the first target column and preset encryption configuration information; According to the encryption algorithm, encrypt the data corresponding to the first field in the first service data to obtain second service data; The second business data is stored in the first target column in the first data table.
2. The method according to claim 1, characterized in that The step of encrypting the data corresponding to the first field in the first service data according to the encryption algorithm to obtain the second service data includes: Determining first data corresponding to the first field from the first service data; According to the encryption algorithm, encrypt the first data to obtain second data; The first data in the first service data is replaced by the second data to obtain the second service data.
3. The method according to claim 2, characterized in that The determining, from the first service data, first data corresponding to the first field includes: Each field of the first business data is traversed to determine the first data corresponding to the first field.
4. The method according to claim 1, characterized in that: The method further comprises: When the data format of the first target column is a preset format, determining a first storage space of a preset size; The table name of the first data table and the column name of the first target column are stored in the first storage space.
5. The method according to claim 4, characterized in that The step of determining, according to the first data table, the first target column and the preset encryption configuration information, a first field to be encrypted in the first target column and an encryption algorithm corresponding to the first field includes: Obtain the table name and the column name from the first storage space; Determine, from the preset encryption configuration information, first configuration information corresponding to the table name and the column name; Determine a field in the first configuration information as a first field to be encrypted; An encryption algorithm corresponding to the first field is determined from the first configuration information.
6. The method according to claim 1, characterized in that The method further comprises: acquiring the second business data from a database according to a data query request for the second business data; When the data format of the first target column to which the second business data belongs is the preset format, determining a first field to be decrypted in the first target column and a decryption algorithm corresponding to the first field according to the first data table to which the second business data belongs, the first target column and preset decryption configuration information; Decrypting the data corresponding to the first field in the second service data according to the decryption algorithm to obtain the first service data; The first business data is sent to the sender of the data query request.
7. The method according to claim 1, characterized in that The preset format refers to representing multiple fields and data corresponding to the multiple fields through a preset text format.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the data processing method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the data processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method and device, server, and storage medium
CN109189367A
Database-based data processing method and device, equipment and storage medium
CN115333821A
Data processing method and device, equipment and storage medium
CN117633835A