Data processing method and apparatus, and electronic device
Patent Information
- Application Number
- CN202211556985.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-12-06
AI Technical Summary
[0002]在一些数据应用场景中,通常存在一些敏感数据,为了保证这些敏感数据的安全,需要对这些敏感数据进行加密,在加密过程中,由于数据量通常较大,会出现同时存在未加密数据和已加密数据的情况,比如,需要对某个业务对应的数据表中的手机号字段中的手机号进行加密,在手机号数量较大时,加密过程中会存在有的手机号已完成加密,有的手机号未完成加密的情况,当该业务需要使用该数据表中的手机号时,通常并不能区分出手机号是否已加密,如果处理方式错误会导致出现错误的处理结果,从而影响了业务的正常运行
[0007]在本申请实施例中,可以根据不同的操作类型,对第一数据进行相应的加密处理操作,进而得到相应的转换结果。
Smart Images

Figure CN115758428B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a data processing method, apparatus, and electronic device. Background Technology
[0002] In some data application scenarios, there is often sensitive data. To ensure the security of this sensitive data, it needs to be encrypted. During the encryption process, due to the large amount of data, there may be situations where unencrypted and encrypted data coexist. For example, if the phone numbers in the phone number field of a data table corresponding to a certain business need to be encrypted, when the number of phone numbers is large, some phone numbers may be encrypted while others are not. When the business needs to use the phone numbers in the data table, it is usually not possible to distinguish whether the phone numbers are encrypted or not. If the processing method is incorrect, it will lead to incorrect processing results, thereby affecting the normal operation of the business. Summary of the Invention
[0003] The purpose of this invention is to provide a data processing method, apparatus, and electronic device to ensure the normal operation of business.
[0004] One aspect provides a data processing method applied to a data conversion device running a data conversion service. The method includes: if a data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data are received from a client, a target conversion rule matching the data table name and field name is retrieved from a pre-stored set of conversion rules to convert the first data into corresponding second data; if the data table corresponding to the data table name is in a temporary state, a processing operation corresponding to the operation type is performed on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain a processing result; wherein, in the temporary state, at least a portion of the data corresponding to the field name has not been converted, if the first data does not belong to at least a portion of the data, its corresponding processing result is the second data; if the first data belongs to at least a portion of the data, its corresponding processing result is the first data.
[0005] In this embodiment of the application, when at least a portion of the data corresponding to the field name in the data table has not been converted, the corresponding processing result can be obtained by temporarily converting the data storage table, so as to realize the simultaneous use of the converted data and the unconverted data and ensure the normal operation of the business.
[0006] Furthermore, the target conversion rules include: a first encryption method, a second encryption method, and a third encryption method; the steps to convert the first data into the corresponding second data include: if the operation type is a save operation, encrypting the first data according to the first encryption method to obtain first irreversible encrypted data; encrypting the first data according to the second encryption method to obtain reversible encrypted data; saving the first irreversible encrypted data and the reversible encrypted data to a permanent conversion data storage table; wherein, if the permanent conversion data storage table pre-stores data identical to the first irreversible encrypted data and the reversible encrypted data, maintaining the current state of the permanent conversion data storage table; if the operation type is a query operation, encrypting the first data according to the third encryption method to obtain second irreversible encrypted data.
[0007] In this embodiment of the application, the first data can be encrypted according to different operation types to obtain the corresponding conversion results.
[0008] Furthermore, if the data table corresponding to the data table name is in a temporary state, the steps for performing the operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result include: if the operation type is a save operation and the data table corresponding to the data table name is in a temporary state, saving the first irreversible encrypted data and the reversible encrypted data to the temporary conversion data storage table corresponding to the data table name; returning the first irreversible encrypted data to the client so that the first data can be replaced with the first irreversible encrypted data through the data interceptor in the client.
[0009] In this embodiment of the application, if the client needs to perform a save operation on the first data, and the data table corresponding to the data table name is in a temporary state, in addition to saving the first irreversible encrypted data and the reversible encrypted data to the permanent conversion data storage table, it will also save them to the temporary conversion data storage table corresponding to the data table name to distinguish that the data table is in a temporary state, and only the first irreversible encrypted data will be returned to the client, thereby improving the security of the reversible encrypted data.
[0010] Furthermore, if the data table corresponding to the data table name is in a temporary state, the steps for performing the operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result include: if the operation type is a query operation and the data table corresponding to the data table name is in a non-temporary state, querying the second irreversible encrypted data from the permanent conversion data storage table; returning the queried second irreversible encrypted data to the client so that the second irreversible encrypted data can be saved to the field corresponding to the field name through the data interceptor in the client.
[0011] In this embodiment of the application, if the client needs to perform a query operation on the first data, and the data table corresponding to the data table name is in a non-temporary state, it means that all the data corresponding to the field name has been converted. At this time, the query can be performed directly from the permanent conversion data storage table to ensure the accuracy of the data query results.
[0012] Furthermore, the method also includes: if the operation type is a query operation and the data table corresponding to the data table name is in a temporary state, querying the temporary conversion data storage table to see if there is second irreversible encrypted data; if it exists, returning the queried second irreversible encrypted data to the client so that the first data can be replaced with the second irreversible encrypted data through the data interceptor in the client; if it does not exist, returning the first data to the client.
[0013] In this embodiment of the application, if the client needs to perform a query operation on the first data, and the data table corresponding to the data table name is in a non-temporary state, it means that all the data corresponding to the field name has not been completely converted. It is necessary to confirm whether the first data is encrypted data through a temporary converted data storage table in order to return the corresponding query results to the client, thus ensuring the accuracy of the data query results.
[0014] On the other hand, a data processing method is provided, applied to a client, in which a data interception service runs. The method includes: responding to a data operation request, determining whether the data operation request carries a specified keyword through the data interception service; wherein the specified keyword includes: a data table name and a field name; if the data operation request carries the specified keyword, sending the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data to a data conversion device through the data interception service, so that the data conversion device can obtain a target conversion rule matching the data table name and field name from a pre-stored set of conversion rules, so as to convert the first data into corresponding second data; if the data table corresponding to the data table name is in a temporary state, performing the processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name, and obtaining the processing result.
[0015] In this embodiment, by setting up a data interception service on the client, when it is determined that the data operation request carries a specified keyword, the data during the interaction between the client and the data storage can be intercepted and sent to the data conversion device. Then, when at least a part of the data corresponding to the field name in the data table has not been converted, the corresponding processing result can be obtained by temporarily converting the data storage table, so as to realize the simultaneous use of converted and unconverted data and ensure the normal operation of the business.
[0016] On the other hand, a data processing apparatus is provided, which is set in a data conversion device running a data conversion service. The apparatus includes: an acquisition module, configured to, if receiving a data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data from a client, acquire a target conversion rule matching the data table name and field name from a pre-stored set of conversion rules to convert the first data into corresponding second data; and a processing module, configured to, if the data table corresponding to the data table name is in a temporary state, perform a processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain a processing result; wherein, in the temporary state, at least a portion of the data corresponding to the field name has not been converted, if the first data does not belong to at least a portion of the data, its corresponding processing result is the second data, and if the first data belongs to at least a portion of the data, its corresponding processing result is the first data.
[0017] On the other hand, a data processing apparatus is provided, which is installed on a client and runs a data interception service. The apparatus includes: a judgment module, used to respond to a data operation request and determine whether the data operation request carries a specified keyword through the data interception service; wherein the specified keyword includes: a data table name and a field name; and a sending module, used to, if the data operation request carries the specified keyword, send the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data to a data conversion device through the data interception service, so that the data conversion device can obtain a target conversion rule matching the data table name and field name from a pre-stored set of conversion rules to convert the first data into corresponding second data; if the data table corresponding to the data table name is in a temporary state, perform the processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result.
[0018] On the other hand, an electronic device is provided, including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement any of the methods described above.
[0019] On the other hand, a computer-readable storage medium is provided, which stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement any of the methods described above. Attached Figure Description
[0020] Figure 1 A flowchart of a data processing method provided in an embodiment of the present invention;
[0021] Figure 2 A flowchart of another data processing method provided in an embodiment of the present invention;
[0022] Figure 3 A flowchart of another data processing method provided in an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] During the encryption of sensitive data, the data table containing the sensitive data may contain both unencrypted and encrypted data simultaneously. When business operations require the use of data from this table, it is usually impossible to distinguish whether the data is encrypted or not. The processing procedures for encrypted and plaintext data are typically different. Incorrect processing methods can lead to incorrect results. For example, if encrypted data is obtained but processed using the same methods as plaintext data, the processing result will be incorrect, thus affecting the normal operation of the business. Based on this, embodiments of the present invention provide a data processing method, apparatus, and electronic device. This technology can be applied to applications that require the use of sensitive data.
[0027] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0028] First, a data processing method disclosed in an embodiment of the present invention will be described in detail. The method is applied to a data conversion device running a data conversion service; such as Figure 1 As shown, the method includes the following steps:
[0029] Step S102: If the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data are received from the client, the target conversion rule matching the data table name and field name is obtained from the pre-stored conversion rule set to convert the first data into the corresponding second data.
[0030] The aforementioned table name can be understood as the name of the table operated on by the client, and the first data can be understood as the specific data operated on by the user, such as a mobile phone number; the aforementioned operation type can be a query operation or a save operation, etc.; the data conversion device usually has multiple conversion rules pre-stored, and different table names, or different fields in the same table name, usually have different conversion rules, which can be set according to actual needs; after obtaining the table name and field name, the target conversion rule corresponding to the table name and field name can be selected from the multiple pre-stored conversion rules to convert the first data according to the target conversion rule to obtain the converted second data.
[0031] Step S104: If the data table corresponding to the data table name is in a temporary state, based on the temporary conversion data storage table corresponding to the data table name, perform the processing operation corresponding to the operation type on the second data to obtain the processing result; wherein, in the temporary state, at least a part of the data corresponding to the field name has not been converted. If the first data does not belong to at least a part of the data, its corresponding processing result is the second data. If the first data belongs to at least a part of the data, its corresponding processing result is the first data.
[0032] If the data table corresponding to the specified table name is in a temporary state, it can be understood that within the data table corresponding to the specified field name, some data has been converted while others have not yet been converted. For example, some data corresponding to the specified field name may be encrypted while others are not, meaning both types of data coexist in the data table. The aforementioned temporary conversion storage table can be understood as a storage table temporarily constructed for the data table in a temporary state. When the data table corresponding to the specified table name is in a temporary state, processing operations corresponding to the operation type can be performed on the second data based on the temporary conversion data storage table corresponding to the specified table name to obtain the corresponding processing results. Specifically, if the first data belongs to the converted data among all the data corresponding to the specified field name, it means that the first data in the data table has actually been converted, and the second data is used as its corresponding processing result. If the first data belongs to the unconverted data among all the data corresponding to the specified field name, it means that the first data in the data table has not actually been converted, and the first data is used as its corresponding processing result. Once all the data corresponding to the specified field name has been converted, the temporary conversion data storage table can be automatically deleted.
[0033] The above data processing method, upon receiving a data table name, field name, first data, and operation type, obtains the target conversion rule to convert the first data into second data. If the data table corresponding to the data table name is in a temporary state, the second data is processed according to the operation type based on the temporary conversion data storage table to obtain the processing result. In the temporary state, at least some of the data corresponding to the field name has not been converted. If the first data does not belong to at least some of the data, its processing result is the second data; if the first data belongs to at least some of the data, its processing result is the first data. In this method, when at least some of the data corresponding to the field name in the data table has not been converted, the corresponding processing result can be obtained through the temporary conversion data storage table, enabling the simultaneous use of converted and unconverted data and ensuring the normal operation of the business.
[0034] Another data processing method is provided below, which is implemented based on the method in the above embodiments; in this method, the target transformation rules include: a first encryption method, a second encryption method, and a third encryption method; the method includes the following steps:
[0035] Step 1: If the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data are received from the client, retrieve the target transformation rule that matches the data table name and field name from the pre-stored set of transformation rules.
[0036] Step 2: If the operation type is a save operation, encrypt the first data according to the first encryption method to obtain the first irreversible encrypted data.
[0037] The first encryption method mentioned above can be hash encryption, etc. For example, taking a mobile phone number encryption scenario, when operating on mobile phone numbers in a business user data table, assuming the user data table is named t_user, the field name is f_phone, and the converted data type is phone, when the data interceptor in the client detects that the business logic needs to insert or modify f_phone in the t_user table, it sends the data table name t_user, the converted data type phone, and the data data1 corresponding to the f_phone to be inserted or modified to the data conversion device. The data conversion device first performs hash encryption on the data1 based on the converted data type phone to obtain irreversible encrypted data key1 (password).
[0038] Step 3: Encrypt the first data using the second encryption method to obtain reversible encrypted data.
[0039] The second encryption method mentioned above can be an asymmetric encryption method, etc. Continuing with the example above, the data data1 can be encrypted using an asymmetric encryption method to obtain the reversible data value1 (ciphertext).
[0040] Step four: Save the first irreversible encrypted data and the reversible encrypted data to the permanent conversion data storage table; wherein, if the permanent conversion data storage table has pre-stored the same data as the first irreversible encrypted data and the reversible encrypted data, maintain the current state of the permanent conversion data storage table.
[0041] The aforementioned permanent conversion data storage table typically contains all converted data. This permanent conversion data table usually does not distinguish between business operations and consists of only one table. That is, after the corresponding data in the data tables corresponding to different business operations is converted, it will be saved to this permanent conversion data table. Therefore, when saving the first irreversible encrypted data and reversible encrypted data to the permanent conversion data storage table, the same data after conversion by other business operations may already exist in the permanent conversion data storage table. In this case, it will usually not be stored repeatedly. For example, if the permanent conversion data storage table already contains irreversible encrypted data key1 (password) and reversible data value1 (ciphertext), then the irreversible encrypted data key1 (password) and reversible data value1 (ciphertext) will not be stored again.
[0042] Step 5: If the operation type is a save operation and the data table corresponding to the data table name is in a temporary state, save the first irreversible encrypted data and the reversible encrypted data to the temporary conversion data storage table corresponding to the data table name.
[0043] Temporary conversion data storage tables need to be differentiated according to different business operations. That is, each temporary conversion data storage table corresponds to a specific business operation, with different tables for different operations. For example, if the SMS table operation has phone numbers and the facial recognition table operation also has phone numbers, then the SMS table operation will have its corresponding temporary conversion data storage table, and so on. When determining whether a data table corresponding to a table name is in a temporary state, this can be confirmed through special identifiers in the data table or by checking keywords. For instance, the key length returned after encrypting a phone number is usually different from the phone number itself, and there may be special identifiers, such as the first few digits being fixed numbers. Continuing with the distance example from step four above, if the user data table name t_user is in a temporary state, then the irreversible encrypted data key1 (password) and the reversible data value1 (ciphertext) also need to be saved to the temporary conversion data storage table tmp_user corresponding to the data table name t_user.
[0044] Step six: Return the first irreversible encrypted data to the client so that the first data can be replaced with the first irreversible encrypted data by the data interceptor in the client.
[0045] After completing the above-mentioned saving operation, the data conversion device returns the first irreversible encrypted data to the client. For example, it returns the irreversible encrypted data key1 (password) to the data interceptor in the client. The data interceptor then stores the converted irreversible encrypted data key1 into the f_phone field of t_user. Specifically, this irreversible encrypted data key1 can replace the original first data. That is, the encrypted data value1 (ciphertext) is stored in the data conversion device, while only the password is stored in the business data storage, thus improving data security.
[0046] Step 7: If the operation type is a query operation, encrypt the first data using the third encryption method to obtain the second irreversible encrypted data.
[0047] The third encryption method mentioned above can be hash encryption, etc.; for example, taking mobile phone number query as an example, when the data interceptor in the client finds that the business logic needs to query data that includes the f_phone field in the t_user table, it sends the table name t_user, the converted data type phone, and the data data2 corresponding to the f_phone to be queried to the data conversion device. The data conversion device first performs hash encryption on data2 according to the converted data type phone to obtain irreversible encrypted data key2.
[0048] Step 8: If the operation type is a query operation and the data table corresponding to the data table name is not in a temporary state, query the second irreversible encrypted data from the permanent conversion data storage table. Step 9: Return the queried second irreversible encrypted data to the client so that the data interceptor in the client can save the second irreversible encrypted data to the field corresponding to the field name.
[0049] Continuing with the example from step seven above, if the `t_user` table is not in a temporary state, the system directly queries the permanent conversion data storage table `t_phone`. If `key2` exists in `t_phone`, it means that `data2` in the `t_user` table has been encrypted. The data conversion device returns `key2` to the data interceptor in the client, saving `key2` to the field corresponding to the field name. Specifically, the converted `key2` can replace the value of the `f_phone` field in `t_user`. If `key2` does not exist in `t_phone`, it means that `data2` has not been encrypted, which is an abnormal situation. In this case, the data conversion device will also return `data2` to the data interceptor.
[0050] Step 10: If the operation type is a query operation and the data table corresponding to the data table name is in a temporary state, query the temporary conversion data storage table to see if there is any second irreversible encrypted data.
[0051] Step 11: If it exists, return the retrieved second irreversible encrypted data to the client so that the first data can be replaced with the second irreversible encrypted data through the data interceptor in the client.
[0052] Step 12: If the data does not exist, return the first data to the client.
[0053] If the `t_user` table is in a temporary state, the temporary conversion data storage table `tmp_user` is queried. If `key2` exists in `tmp_user`, it means that `data2` in `t_user` has been encrypted, and the data conversion device returns `key2` to the data interceptor in the client. If `key2` does not exist in `tmp_user`, it means that `data2` in `t_user` has not been encrypted, and the data conversion device returns `data2` to the data interceptor in the client. The data interceptor replaces the value of the `f_phone` field in `t_user` with the converted `key2` or `data2`. For example, when the SMS service has phone numbers that haven't yet been encrypted into passwords and ciphertext, this table is configured as a temporary conversion data storage table. When all phone numbers in the SMS service are encrypted into passwords and ciphertext, this temporary conversion data storage table can be deleted, and the permanent conversion data storage table can be used directly.
[0054] The permanent conversion data storage table contains only one record and is not differentiated by business function. The temporary conversion data storage table, on the other hand, is differentiated by business function. If there is no temporary conversion data storage table, directly querying the permanent conversion data storage table may lead to misjudgments. For example, if business 1 and business 2 use the same mobile number, and all mobile number conversions for business 1 are complete, the encrypted mobile number will exist in the permanent conversion data storage table. However, for business 2, the mobile number has not yet been converted. If business 2 directly queries the permanent conversion data storage table, it will assume that the mobile number has been encrypted, but it has not actually been encrypted. If it processes the data using the encryption method, problems will occur.
[0055] In addition, the temporary conversion data storage table is for each specific piece of data. If some data has been converted and some has not, you can filter it using the temporary conversion data storage table. For example, if two phone numbers need to be encrypted, one of them is already encrypted and will exist in the temporary conversion data storage table, while the other is not yet encrypted and will not exist in the temporary conversion data storage table.
[0056] The aforementioned data processing method can encrypt or adjust data without affecting the client, such as encrypting sensitive data or adjusting field content. Furthermore, since different business units store the encrypted data in a permanent conversion data storage table, and only one record is retained in the permanent conversion data storage table, data is not duplicated. This reduces data storage space, and the data conversion device deduplicates identical data, avoiding the waste of storage resources caused by multiple storage operations across different business units. In addition, by setting up a temporary storage function, the problem of two types of data existing before and after conversion (before and after conversion) coexisting when converting existing data or deploying systems in batches is resolved, preventing data incompatibility due to different data types.
[0057] The following provides another data processing method, which is applied to a client-side application that runs a data interception service, such as... Figure 2 As shown, the method includes the following steps:
[0058] Step S202: In response to the data operation request, determine whether the data operation request carries a specified keyword through the data interception service; wherein, the specified keyword includes: data table name and field name.
[0059] In practice, data interception services are usually pre-configured with data interception rules. Different interception rules can be configured according to different combinations of data table names and field names. For example, when a user operates on field F1 in data table T1 through the client, rule R1 is triggered, and when the user operates on field F2 in data table T2 through the client, rule R2 is triggered, and so on.
[0060] It should be noted that the data interception rules pre-configured for the data interception service are not static and can be dynamically adjusted according to actual needs. For example, in one configuration method, when a user operates on field F1 in data table T1 through the client, rule R1 is triggered. In another configuration method, when a user operates on field F1 in data table T1 through the client, rule R3 is triggered, and so on.
[0061] In step S204, if the data operation request carries a specified keyword, the data table name, field name, the first data corresponding to the field name, and the operation type corresponding to the first data are sent to the data conversion device through the data interception service. The data conversion device then retrieves the target conversion rule matching the data table name and field name from the pre-stored conversion rule set to convert the first data into the corresponding second data. If the data table corresponding to the data table name is in a temporary state, the processing operation corresponding to the operation type is performed on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result.
[0062] For example, if an operation needs to be performed on the mobile phone number in the business user data table, the specified keywords carried in the data operation request include the data table name t_user, the field name f_phone, the first data corresponding to the field name data1, and the operation type phone corresponding to the first data, i.e., data1 specifically refers to the mobile phone number. The client sends the data table name, field name, the first data corresponding to the field name, and the operation type corresponding to the first data to the data conversion device through the data interception service, so as to obtain the corresponding processing result through the data conversion device and receive the processing result returned by the data conversion device.
[0063] For further understanding, see Figure 3 The flowchart illustrates another data processing method, where the client-side (corresponding to the aforementioned client) is the primary user of the data; the data conversion configuration device manages the data conversion rules; the data conversion device converts the data according to the data conversion rules; the business logic is the function implemented by the client-side; the data interceptor is a device that intercepts and preprocesses data operations when the client-side interacts with the data storage; the business data storage belongs to the business data storage in the client service; the permanent conversion data storage is used for all converted data storage; the temporary data storage is used for temporary data storage of the same type of data that has not been fully converted; the data interceptor saves or queries the data table name T1, field F1, data D1, and operation type and sends them to the data conversion device; the data conversion device matches the data conversion rules according to T1 and F1, such as encrypting it using a certain encryption method; and converts the received data D1 into D2 according to the matched data conversion rules; if it is a save operation, data D2 is saved to the permanent conversion data storage; if T1 in the data conversion configuration is a table that has not been completely converted, then D2 also needs to be saved to the temporary conversion data storage. After saving, the converted data is returned to the data interceptor on the client-side to continue business data operations. The data storage can be a single table or based on separate tables (T) and fields (F) to meet different needs. For query operations, the system first checks if T1 and F1 are in temporary storage mode according to data transformation rule R2. If they are not temporary, it directly queries the permanent transformation data storage. If the data exists, it returns the transformed data D2; otherwise, it returns D1. If the data is in temporary storage mode, it queries the temporary transformation data storage. If the data exists, it returns the transformed data D2; otherwise, it returns D1.
[0064] The above data processing method, by setting up a data interception service on the client side, can intercept the data during the interaction between the client and the data storage device when it is determined that the data operation request carries a specified keyword. Then, when at least a part of the data corresponding to the field name in the data table has not been converted, the corresponding processing result can be obtained by temporarily converting the data storage table. This enables the simultaneous use of converted and unconverted data, ensuring the normal operation of the business.
[0065] This invention provides a data processing apparatus, which is installed in a data conversion device that runs a data conversion service, such as... Figure 4 As shown, the device includes:
[0066] The acquisition module 40 is used to, if it receives the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data from the client, retrieve the target conversion rule that matches the data table name and field name from the pre-stored conversion rule set, so as to convert the first data into the corresponding second data;
[0067] Processing module 41 is used to perform the processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name if the data table corresponding to the data table name is in a temporary state, and obtain the processing result; wherein, in the temporary state, at least a part of the data corresponding to the field name has not been converted. If the first data does not belong to at least a part of the data, its corresponding processing result is the second data. If the first data belongs to at least a part of the data, its corresponding processing result is the first data.
[0068] The aforementioned data processing device, upon receiving a data table name, field name, first data, and operation type, obtains a target conversion rule to convert the first data into second data. If the data table corresponding to the data table name is in a temporary state, it performs the processing corresponding to the operation type on the second data based on the temporary conversion data storage table to obtain the processing result. In the temporary state, at least a portion of the data corresponding to the field name has not been converted. If the first data does not belong to at least a portion of the data, its processing result is the second data; if the first data belongs to at least a portion of the data, its processing result is the first data. In this device, when at least a portion of the data corresponding to the field name in the data table has not been converted, the corresponding processing result can be obtained through the temporary conversion data storage table, enabling the simultaneous use of converted and unconverted data and ensuring the normal operation of the business.
[0069] Furthermore, the target conversion rules include: a first encryption method, a second encryption method, and a third encryption method; the acquisition module 40 is also used to: if the operation type is a save operation, encrypt the first data according to the first encryption method to obtain the first irreversible encrypted data; encrypt the first data according to the second encryption method to obtain the reversible encrypted data; save the first irreversible encrypted data and the reversible encrypted data to the permanent conversion data storage table; wherein, if the permanent conversion data storage table pre-stores data identical to the first irreversible encrypted data and the reversible encrypted data, maintain the current state of the permanent conversion data storage table; if the operation type is a query operation, encrypt the first data according to the third encryption method to obtain the second irreversible encrypted data.
[0070] Furthermore, the processing module 41 is also used to: if the operation type is a save operation and the data table corresponding to the data table name is in a temporary state, save the first irreversible encrypted data and the reversible encrypted data to the temporary conversion data storage table corresponding to the data table name; return the first irreversible encrypted data to the client so that the first data can be replaced with the first irreversible encrypted data through the data interceptor in the client.
[0071] Furthermore, the processing module 41 is also used to: if the operation type is a query operation and the data table corresponding to the data table name is in a non-temporary state, query the second irreversible encrypted data from the permanent conversion data storage table; return the queried second irreversible encrypted data to the client so that the second irreversible encrypted data can be saved to the field corresponding to the field name through the data interceptor in the client.
[0072] Furthermore, the processing module 41 is also used to: if the operation type is a query operation and the data table corresponding to the data table name is in a temporary state, query whether there is second irreversible encrypted data in the temporary conversion data storage table; if it exists, return the queried second irreversible encrypted data to the client so that the first data can be replaced with the second irreversible encrypted data through the data interceptor in the client; if it does not exist, return the first data to the client.
[0073] The data processing apparatus provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned data processing method embodiment. For the sake of brevity, any parts not mentioned in the data processing apparatus embodiment can be referred to the corresponding content in the aforementioned data processing method embodiment.
[0074] This invention provides another data processing device, which is installed on a client side, and the client side runs a data interception service, such as... Figure 5 As shown, the device includes:
[0075] The judgment module 50 is used to respond to data operation requests and determine whether the data operation request carries a specified keyword through the data interception service; wherein, the specified keyword includes: data table name and field name;
[0076] The sending module 51 is used to send the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data to the data conversion device through the data interception service if the data operation request carries a specified keyword. The data conversion device then retrieves the target conversion rule that matches the data table name and field name from the pre-stored conversion rule set to convert the first data into the corresponding second data. If the data table corresponding to the data table name is in a temporary state, the module performs the processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result.
[0077] The aforementioned data processing device, by setting up a data interception service on the client side, can intercept data during client-data storage interaction when it determines that the data operation request carries a specified keyword, and then pass it to the data conversion device. Thus, when at least a portion of the data corresponding to all the data in the data table field name has not been converted, the corresponding processing result can be obtained by temporarily converting the data storage table, enabling the simultaneous use of converted and unconverted data and ensuring the normal operation of the business.
[0078] This invention also provides an electronic device, see [link to relevant documentation]. Figure 6 As shown, the electronic device includes a processor 130 and a memory 131. The memory 131 stores machine-executable instructions that can be executed by the processor 130. The processor 130 executes the machine-executable instructions to implement the above-described data processing method.
[0079] Furthermore, Figure 6 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0080] The memory 131 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0081] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0082] This invention also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are called and executed by a processor, they cause the processor to implement the aforementioned data processing method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0083] The computer program products of the data processing methods, apparatus, and electronic devices provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0084] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0085] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A data processing method, characterized in that, The method is applied to a data conversion device running a data conversion service, and the method includes: If a table name, field name, first data corresponding to the field name, and operation type corresponding to the first data are received from the client, a target conversion rule matching the table name and field name is retrieved from a pre-stored set of conversion rules to convert the first data into the corresponding second data. If the conversion is not completed, the table corresponding to the table name is determined to be in a temporary state, and the temporary table is stored in a temporary conversion data storage table. If the conversion is completed, all converted data is stored in a permanent conversion data storage table, and the temporary conversion data storage table is automatically deleted. If the data table corresponding to the data table name is in a temporary state, based on the temporary conversion data storage table corresponding to the data table name, the processing operation corresponding to the operation type is performed on the second data to obtain the processing result; wherein, in the temporary state, at least a part of the data corresponding to the field name has not been converted. If the first data does not belong to the at least a part of the data, its corresponding processing result is the second data; if the first data belongs to the at least a part of the data, its corresponding processing result is the first data. If the data table corresponding to the data table name is in a non-temporary state, then the corresponding processing result is the second data.
2. The method as described in claim 1, characterized in that, The target conversion rules include: a first encryption method, a second encryption method, and a third encryption method; the steps for converting the first data into the corresponding second data include: If the operation type is a save operation, the first data is encrypted according to the first encryption method to obtain the first irreversible encrypted data; The first data is encrypted using the second encryption method to obtain reversibly encrypted data. Save the first irreversible encrypted data and the reversible encrypted data to a permanent conversion data storage table; wherein, if the permanent conversion data storage table has pre-stored data identical to the first irreversible encrypted data and the reversible encrypted data, maintain the current state of the permanent conversion data storage table; If the operation type is a query operation, the first data is encrypted using the third encryption method to obtain the second irreversible encrypted data.
3. The method as described in claim 2, characterized in that, If the data table corresponding to the data table name is in a temporary state, the steps of performing the operation corresponding to the operation type on the second data based on the temporary converted data storage table corresponding to the data table name to obtain the processing result include: If the operation type is a save operation and the data table corresponding to the data table name is in a temporary state, the first irreversible encrypted data and the reversible encrypted data are saved to the temporary conversion data storage table corresponding to the data table name. The first irreversible encrypted data is returned to the client so that the first data can be replaced with the first irreversible encrypted data by the data interceptor in the client.
4. The method as described in claim 2, characterized in that, If the data table corresponding to the data table name is in a temporary state, the steps of performing the operation corresponding to the operation type on the second data based on the temporary converted data storage table corresponding to the data table name to obtain the processing result include: If the operation type is a query operation, and the data table corresponding to the data table name is in a non-temporary state, query the second irreversible encrypted data from the permanent conversion data storage table; The retrieved second irreversible encrypted data is returned to the client so that the data interceptor in the client can save the second irreversible encrypted data to the field corresponding to the field name.
5. The method as described in claim 4, characterized in that, The method further includes: If the operation type is a query operation, and the data table corresponding to the data table name is in a temporary state, query the temporary conversion data storage table to see if the second irreversible encrypted data exists; If it exists, the retrieved second irreversible encrypted data is returned to the client so that the first data can be replaced with the second irreversible encrypted data by the data interceptor in the client; If it does not exist, the first data is returned to the client.
6. A data processing method, characterized in that, The method is applied to a client, which runs a data interception service. The method includes: In response to a data operation request, the data interception service determines whether the data operation request carries a specified keyword; wherein, the specified keyword includes: data table name and field name; If the data operation request carries the specified keyword, the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data are sent to the data conversion device through the data interception service. The data conversion device then retrieves the target conversion rule matching the data table name and field name from a pre-stored set of conversion rules to convert the first data into the corresponding second data. If the data table corresponding to the data table name is in a temporary state, the processing operation corresponding to the operation type is performed on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain the processing result. If the data table corresponding to the data table name is not in a temporary state, the corresponding processing result is the second data. If the first data has not been converted, the data table corresponding to the data table name is determined to be in a temporary state, and the temporary data table is stored in the temporary conversion data storage table. If the first data has been converted, all converted data is stored in the permanent conversion data storage table, the temporary conversion data storage table is automatically deleted, and the processing operation corresponding to the operation type is performed on the second data based on the permanent conversion data storage table corresponding to the data table name to obtain the processing result.
7. A data processing apparatus, characterized in that, The device is installed in a data conversion device that runs data conversion services, and the device includes: The acquisition module is configured to, upon receiving a data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data from a client, retrieve a target conversion rule matching the data table name and the field name from a pre-stored set of conversion rules, so as to convert the first data into the corresponding second data; wherein, if the conversion is not completed, the data table corresponding to the data table name is determined to be in a temporary state, and the data table in the temporary state is stored in a temporary conversion data storage table; if the conversion is completed, all converted data is stored in a permanent conversion data storage table, and the temporary conversion data storage table is automatically deleted; The processing module is configured to, if the data table corresponding to the data table name is in a temporary state, perform the processing operation corresponding to the operation type on the second data based on the temporary conversion data storage table corresponding to the data table name, and obtain a processing result; wherein, in the temporary state, at least a portion of the data corresponding to the field name has not been converted, if the first data does not belong to the at least a portion of the data, its corresponding processing result is the second data, and if the first data belongs to the at least a portion of the data, its corresponding processing result is the first data; if the data table corresponding to the data table name is in a non-temporary state, the corresponding processing result is the second data.
8. A data processing apparatus, characterized in that, The device is installed on a client, and the client runs a data interception service. The device includes: The judgment module is used to respond to a data operation request and determine whether the data operation request carries a specified keyword through the data interception service; wherein, the specified keyword includes: data table name and field name; The sending module is configured to, if the data operation request carries the specified keyword, send the data table name, field name, first data corresponding to the field name, and operation type corresponding to the first data to the data conversion device via the data interception service. The data conversion device then retrieves a target conversion rule matching the data table name and field name from a pre-stored set of conversion rules to convert the first data into corresponding second data. If the data table corresponding to the data table name is in a temporary state, the processing operation corresponding to the operation type is performed on the second data based on the temporary conversion data storage table corresponding to the data table name to obtain a processing result. If the data table corresponding to the data table name is not in a temporary state, the corresponding processing result is the second data. Specifically, if the first data has not been completely converted, the data table corresponding to the data table name is determined to be in a temporary state, and the temporary data table is stored in the temporary conversion data storage table. If the first data conversion is complete, all converted data is stored in the permanent conversion data storage table, the temporary conversion data storage table is automatically deleted, and the processing operation corresponding to the operation type is performed on the second data based on the permanent conversion data storage table corresponding to the data table name to obtain a processing result.
9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for encrypting database and database server
CN106022154A
MongoDB-based security real-time trade association analysis method
CN106776837A