Data desensitization method and device

By matching and processing data with preset desensitization rules, the problem of frequent code modifications in the existing technology is solved, real-time and flexible data desensitization is achieved, and efficiency and resource utilization are improved.

CN118568757APending Publication Date: 2024-08-30BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310213245.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, as business develops, new data desensitization requirements increase, requiring frequent modification of desensitization processing codes, occupying R&D resources, affecting data desensitization efficiency, and making it impossible to perform data desensitization processing flexibly in real time.

Method used

By matching the acquired data that needs to be desensitized with the preset desensitization rules, and performing desensitization processing according to the matching desensitization rules, real-time and flexible data desensitization can be achieved to avoid frequent code modifications.

Benefits of technology

It improves the efficiency of data desensitization processing, saves R&D resources, and realizes data desensitization processing that responds quickly to needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568757A
    Figure CN118568757A
Patent Text Reader

Abstract

The invention discloses a data desensitization method and device, and relates to the technical field of information security. A specific embodiment of the method comprises the following steps: in response to a service request, obtaining response result data corresponding to the service request; performing desensitization matching on the response result data and a preset desensitization rule; under the condition that desensitization matching is successful, desensitization processing is conducted on the response result data according to the matched desensitization rule. According to the embodiment, desensitization matching is carried out on the obtained data needing desensitization and the preset desensitization rule, when desensitization matching succeeds, real-time and flexible data desensitization processing is carried out according to the matched desensitization rule, the problem that desensitization processing codes are frequently modified in order to meet increasing desensitization requirements is solved, and the desensitization processing efficiency is improved. The desensitization processing efficiency is improved, and research and development resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a method and device for data desensitization. Background Art

[0002] With the development of big data technology, data, as a carrier of information, has gradually become an important production factor. Correspondingly, the security of data information has also received more and more attention. In order to ensure data security, it is necessary to de-privacy the data, that is, data desensitization, so that the data can be effectively used and the security of data use can be guaranteed. At present, the main method is to obtain the original data from the interface that needs to be desensitized, call the desensitization processing program, generate desensitized string data, replace the original field, and then return it to the client.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] With the development of business, there will be more and more new data desensitization needs. The existing desensitization processing methods require adaptive modification, testing and online release of the desensitization processing code, which not only takes up R&D resources, but also affects the efficiency of data desensitization. Data desensitization cannot be performed flexibly and in real time as needed. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for data desensitization, which performs desensitization matching on the acquired data to be desensitized with preset desensitization rules, so that when the match is successful, the data is desensitized according to the matched desensitization rules, thereby solving the problem of frequently modifying the desensitization processing code to meet the increasing desensitization needs, realizing real-time and flexible data desensitization, improving the desensitization processing efficiency, and saving R&D resources.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for data desensitization is provided, comprising:

[0007] In response to a business request, obtaining response result data corresponding to the business request;

[0008] Desensitizing and matching the response result data with the preset desensitization rules;

[0009] When the desensitization match is successful, the response result data is desensitized according to the matched desensitization rule.

[0010] Optionally, in response to a business request, obtaining response result data corresponding to the business request includes: intercepting original response data corresponding to the business request; converting the original response data into hypertext transfer protocol response data through a hypertext transfer protocol converter, wherein the response data is the response result data.

[0011] Optionally, before desensitizing and matching the response result data with a preset desensitizing rule, the method includes: obtaining a request identifier according to the business request; and determining whether the request identifier matches a first request path in a preset desensitizing rule.

[0012] Optionally, the response result data includes a field name and a field value, and the desensitizing rule includes a desensitized field and a data level where the desensitized field is located; the response result data is desensitized and matched with the preset desensitizing rule, including: a first match between the field name of the response result data and the desensitized field; when the first match is successful, a second match between the data level where the response result data is located and the data level where the desensitized field is located; when the second match is successful, it is determined whether the field value corresponding to the field name is a string type; when the field value is a string type, the desensitized match is successful.

[0013] Optionally, the response result data is desensitized according to the matching desensitization rule, including: according to the desensitization type in the matching desensitization rule, the field value corresponding to the field name is desensitized to obtain a desensitized string; and the field value is replaced using the desensitized string.

[0014] Optionally, the method also includes: after performing desensitizing matching, recording response result data of successful desensitizing matching; after obtaining the response result data corresponding to the business request, obtaining a request identifier according to the business request; determining that the request identifier matches the second request path in a preset detection rule; and detecting the response result data according to the preset detection rule to determine whether to issue a warning message based on the response result data of successful desensitizing matching if the detection rule is met.

[0015] Optionally, the detection rules include field name detection rules; the response result data is detected according to preset detection rules, including: determining a first sampling ratio according to a first detection level in the field name detection rules; sampling the response result data according to the first sampling ratio to obtain first sampling data; and performing name detection on the first sampling data through a regular expression according to the field name in the field name detection rules.

[0016] Optionally, the detection rules include field content detection rules; the response result data is detected according to preset detection rules, including: determining a second sampling ratio according to a second detection level in the field content detection rules; sampling the response result data according to the second sampling ratio to obtain second sampling data; and performing content comparison detection on the second sampling data according to the field content in the field content detection rules.

[0017] Optionally, judging whether to issue a warning message is based on the response result data of the successful desensitizing match, including: comparing the response result data that meets the detection rules with the response result data of the successful desensitizing match; and issuing a warning message if the response result data that meets the detection rules and the response result data of the successful desensitizing match are inconsistent.

[0018] Optionally, before the desensitization matching and the detection, the response result data is serialized.

[0019] According to a second aspect of an embodiment of the present invention, a data desensitization device is provided, including:

[0020] A data acquisition module, used to respond to a business request and acquire response result data corresponding to the business request;

[0021] A desensitization matching module, used for performing desensitization matching on the response result data and a preset desensitization rule;

[0022] The desensitization processing module is used to perform desensitization processing on the response result data according to the matched desensitization rules when the desensitization match is successful.

[0023] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for data desensitization, including:

[0024] one or more processors;

[0025] a storage device for storing one or more programs,

[0026] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0027] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0028] An embodiment of the invention has the following advantages or beneficial effects: by responding to a business request, response result data corresponding to the business request is obtained; the response result data is desensitized and matched with a preset desensitizing rule; when the desensitizing match is successful, the response result data is desensitized according to the matched desensitizing rule. The technical scheme realizes desensitizing matching of the acquired data to be desensitized with the preset desensitizing rule, so that when the match is successful, the data is desensitized in real time and flexibly according to the matched desensitizing rule, which solves the problem of frequently modifying the desensitizing processing code to meet the increasing desensitization needs, improves the desensitizing processing efficiency, and saves R&D resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0030] Figure 1 is a schematic diagram of the main process of the data desensitization method according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of a method for obtaining response result data according to an embodiment of the present invention;

[0032] Figure 3 It is a schematic diagram of the overall process of the data desensitization and detection method according to an embodiment of the present invention;

[0033] Figure 4 Schematic diagram of the principle of data desensitization in an embodiment of the present invention;

[0034] Figure 5 is a schematic diagram of main modules of a data desensitization device according to an embodiment of the present invention;

[0035] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0036] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0037] It should be noted that in the technical solution of the present invention, the collection / collection, update, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.

[0038] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0039] In data desensitization processing, with the development of business, there will be more and more new data desensitization needs. The existing desensitization processing methods require adaptive modification, testing and online release of the desensitization processing code, which not only occupies R&D resources, but also affects the efficiency of data desensitization. Data desensitization cannot be performed flexibly and in real time as needed.

[0040] In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a method for data desensitization, which performs desensitization matching on the acquired data to be desensitized with preset desensitization rules, so that when the match is successful, the data is desensitized according to the matched desensitization rules. This solves the problem of frequently modifying the desensitization processing code to meet the increasing desensitization needs, realizes real-time and flexible data desensitization, improves the desensitization processing efficiency, and saves R&D resources.

[0041] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:

[0042] Spring: is an open source J2EE application framework initiated by Rod Johnson. It is a lightweight container for managing the life cycle of beans. Spring solves many common problems encountered by developers in J2EE development and provides powerful IOC, AOP and Web MVC functions.

[0043] AOP: Aspect Oriented Programming, a technology that achieves unified maintenance of program functions through pre-compilation and dynamic proxy during runtime. AOP can be used to isolate various parts of business logic, thereby reducing the coupling between the various parts of business logic, improving the reusability of the program, and improving development efficiency;

[0044] Spring MVC: The Spring framework provides a full-featured MVC module for building web applications. Using Spring's pluggable MVC architecture, you can choose to use Spring's Spring MVC framework or integrate other MVC development frameworks when using Spring for web development;

[0045] ThreadLocal: It is a local variable of Thread, which is used to compile multi-threaded programs and has a certain enlightenment effect on solving the concurrency problems of multi-threaded programs;

[0046] JSON: is a lightweight data exchange format.

[0047] Figure 1 is a schematic diagram of the main process of the data desensitization method according to an embodiment of the present invention, such as Figure 1 As shown, the data desensitization method of the embodiment of the present invention includes the following steps S101 to S103.

[0048] Step S101: In response to a service request, obtain response result data corresponding to the service request.

[0049] Specifically, after receiving a business request, the business interface executes the corresponding business logic according to the business request and generates response result data. For example, on the consultation order confirmation page of the Internet medical business system, the system sends a business request to the database to obtain the patient's mobile phone number. The server queries the patient's mobile phone number from the database based on the received business request and returns the patient's mobile phone number as the response result data to the system.

[0050] According to one embodiment of the present invention, in response to a business request, obtaining response result data corresponding to the business request includes: intercepting original response data corresponding to the business request; converting the original response data into hypertext transfer protocol response data through a hypertext transfer protocol converter, and the response data is the response result data.

[0051] Specifically, usually the business request sent by the client and the response result data received are both in http format. Before encapsulating the response result data in http format, a section of code with the function of intercepting the original response data can be added to the code. Preferably, the AOP aspect method of the original response data can be intercepted through Spring's ResponseBodyAdvice, the interception result can be stored, and the request identifier of this request interface can be temporarily stored in the thread local cache ThreadLocal. Through the aspect method, the impact on the main business logic can be minimized to the greatest extent when non-main business logic is added, and the coupling degree of each business logic can be reduced. In addition, in the embodiment of the present invention, the request path of Spring MVC can be used to determine the request identifier of the interface, and the request identifier has a corresponding relationship with the original response data; the http converter is called to obtain the original response data through the request identifier in ThreadLocal, and the original response data is converted into response data in http format, which is the response result data for subsequent desensitization processing.

[0052] Figure 2 This is a schematic diagram of a response result data acquisition method of an embodiment of the present invention. This figure mainly uses response result data acquisition as the main explanation object. After receiving a business request and completing the business processing, the business interface generates a response result data Java object; the original response data is intercepted and stored through the aspect method, and the request identifier of this request interface is temporarily stored in ThreadLocal, and the request identifier has a corresponding relationship with the original response data; the http converter converts the original response data obtained by obtaining the request identifier temporarily stored in ThreadLocal into response data in http format; and then performs subsequent desensitization processing and detection; then the result after desensitization processing is serialized and written into the response stream, so that the response result data after desensitization processing can be seen in the request page; finally, the request identifier temporarily stored in ThreadLocal is cleared.

[0053] Step S102: desensitize and match the response result data with preset desensitization rules.

[0054] According to one embodiment of the present invention, before desensitizing and matching the response result data with the preset desensitizing rule, it includes: obtaining a request identifier according to the business request; and determining that the request identifier matches the first request path in the preset desensitizing rule.

[0055] Specifically, the embodiments of the present invention have a certain knowledge basis for the data information of each interface, and can basically clarify which interfaces need to be desensitized. In order to perform data desensitization in real time and flexibly, according to business needs, in the embodiments of the present invention, desensitization rules based on each interface are pre-configured in the configuration center, and the first request path is set to distinguish whether the request interface needs to be desensitized. Only when the request identifier of the request interface matches the first request path of the desensitization rule, the business request needs to be desensitized.

[0056] According to another embodiment of the present invention, before the desensitizing matching, the response result data is serialized.

[0057] Generally, the response result data is a Java object. Before desensitizing matching, the Java object needs to be serialized into a JSON string. In order to facilitate the subsequent extraction of each field in the response result data for desensitizing matching, the JSON string can be converted into a JSON tree structure for efficient recursive traversal matching.

[0058] According to another embodiment of the present invention, the response result data includes a field name and a field value, and the desensitizing rule includes a desensitized field and a data level where the desensitized field is located; the response result data is desensitized and matched with the preset desensitizing rule, including: a first matching of the field name of the response result data with the desensitized field; when the first match is successful, a second matching of the data level where the response result data is located with the data level where the desensitized field is located; when the second match is successful, determining whether the field value corresponding to the field name is a string type; when the field value is a string type, the desensitizing match is successful.

[0059] Specifically, the preset desensitization rules include the desensitization field, that is, the field name where the information to be desensitized is located, and the level of the data structure where the desensitization field is located. For example, in a certain data structure, the desensitization rule configures the level where the field name userName is located as the third level. Then, when traversing and desensitizing all the data in the data structure of the response result data, the data in the first and second levels do not need to be matched and can be skipped directly, thereby improving the efficiency of desensitization matching. Usually, the field values ​​in the response result data may be JSON objects or JSON arrays, and recursive desensitization matching is required. Based on the tree structure constructed above, the data of each level included in the response result data is stored. According to the tree structure, recursively traverse layer by layer to extract each data for data desensitization matching. The data in each response result data includes field names and field values. The field names of the data are matched with the desensitized fields in the desensitization rules; if the field name matches successfully, the data level of the data is matched with the data level of the successfully matched desensitized field; if the data level match is also successful, it is determined whether the field value type corresponding to the field name is a string type. If it is a string type, the desensitization match is successful. In addition, for the case where each data in the response result data is stored as a key-value pair, similar to the above-mentioned desensitization matching, the response result data is extracted according to the key-value pair, and recursively traversed layer by layer according to the field name and field value corresponding to each key-value pair.

[0060] According to another embodiment of the present invention, the method further includes: after performing the desensitization matching, recording response result data of successful desensitization matching.

[0061] Step S103: When the desensitization match is successful, the response result data is desensitized according to the matched desensitization rule.

[0062] According to one embodiment of the present invention, the response result data is desensitized according to the matching desensitization rule, including: according to the desensitization type in the matching desensitization rule, the field value corresponding to the field name is desensitized to obtain a desensitized string; and the field value is replaced using the desensitized string.

[0063] Specifically, the preset desensitization rules also include desensitization types, such as name desensitization, mobile phone number desensitization, ID card number desensitization, address desensitization and other types. Different desensitization processes can be performed according to different desensitization types, and part or all of the data can be replaced with *. For example, the middle digits of the mobile phone number are generally desensitized and hidden. The desensitized string after desensitization is replaced with the original field value to achieve the purpose of desensitizing the field value that meets the desensitization rules. In addition, after the desensitization process of the response result data of this request is completed, it is also necessary to perform serialization processing, and the result of the serialization process is written into the response stream, so that the response result data after desensitization processing can be seen in the client's request page. Preferably, the request identifier temporarily stored in ThreadLocal can be cleared at last to avoid occupying cache resources.

[0064] Through the above desensitization processing, when new desensitization requirements are added, the newly added desensitization field rules can be quickly and flexibly configured through the configuration center to take effect in real time. After testing in actual business scenarios, it only takes 2 minutes to add new desensitization rules, avoiding unnecessary code modifications, improving the efficiency of desensitization processing, and saving R&D resources.

[0065] According to another embodiment of the present invention, the method further includes: after obtaining the response result data corresponding to the business request, obtaining a request identifier according to the business request; determining that the request identifier matches the second request path in a preset detection rule; and detecting the response result data according to the preset detection rule to determine whether to issue a warning message based on the response result data that successfully matches the desensitizing match if the detection rule is met.

[0066] Specifically, although the embodiments of the present invention are based on a certain knowledge of the data information of each interface, in order to further improve the reliability of data desensitization processing and avoid the risk of data leakage without desensitization processing, for example, a new developer or a developer who has taken over has added some field data, but because he does not understand or misses the desensitization requirements, he fails to report the new desensitization requirements in time, resulting in data leakage without desensitization processing without knowing it. After obtaining the response result data corresponding to the business request, the embodiments of the present invention can also detect the response result data in a multi-threaded manner.

[0067] Furthermore, in order to conduct real-time and flexible detection, in the embodiment of the present invention, detection rules based on each interface are pre-configured in the configuration center according to business needs, and the second request path is set to distinguish whether the request interface needs to be desensitized. Only when the request identifier of the request interface matches the second request path of the desensitization rule, the business request needs to be detected. When it is determined that detection is required, the response result data is detected according to the preset detection rules. When the response result data that meets the detection rules is detected, and it can be determined whether data leakage has occurred based on the above-mentioned response result data with successful desensitization matching, a warning message is issued in the event of data leakage, prompting relevant personnel to check the desensitization process and desensitize the leaked data in time.

[0068] In addition, based on the preset detection rules, detection can also be performed in advance before desensitizing matching. When response result data that meets the detection rules is detected, the response result data is sent to the desensitizing processing unit for desensitizing matching and desensitizing processing; the response result data can also be detected during desensitizing matching and desensitizing processing. Only when the detected response result data is consistent with the response result data of a successful desensitizing match, is it allowed to write the desensitized response result data into the response stream, and the desensitized response result data can be seen in the request page to prevent data leakage.

[0069] According to another embodiment of the present invention, before the detection, the response result data is serialized. Similar to the above-mentioned desensitization matching, before the detection, the response result data Java object needs to be JSON serialized to obtain a JSON string, and then the JSON string is converted into a JSON tree structure for efficient recursive traversal detection.

[0070] According to another embodiment of the present invention, the detection rules include field name detection rules; the response result data is detected according to the preset detection rules, including: determining a first sampling ratio according to a first detection level in the field name detection rules; sampling the response result data according to the first sampling ratio to obtain first sampling data; and performing name detection on the first sampling data through a regular expression according to the field name in the field name detection rules.

[0071] Specifically, for flexible detection, the corresponding detection level can be set in the monitoring rules. The preset field name detection rules in the embodiment of the present invention include the first detection level. The first detection level can be divided into 0-5 levels, and the numbers increase the sampling ratio from small to large. For example, if there are 10 data in a certain interface, level 0 will directly turn off the hierarchical detection function, that is, the number of sampled fields is 0, the sampling ratio of level 1 is 20%, that is, the number of sampled fields is 2, and so on. The sampling ratio of level 5 is 100%, that is, all data will be fully detected. According to the first detection level in the field name detection rule, the sampling ratio of the data can be determined, and the first sampling data that meets the sampling ratio will be obtained accordingly; for field name detection, the amount of data is usually not too large, and regular expressions can be used for online detection.

[0072] According to another embodiment of the present invention, the detection rules include field content detection rules; the response result data is detected according to the preset detection rules, including: determining a second sampling ratio according to a second detection level in the field content detection rules; sampling the response result data according to the second sampling ratio to obtain second sampling data; and performing content comparison detection on the second sampling data according to the field content in the field content detection rules.

[0073] Specifically, in the field content detection rules, the corresponding sampling ratio can be determined according to the second detection level. The embodiment of the present invention is similar to the meaning of the above-mentioned first detection level. According to the determined second sampling ratio, the second sampling data of the corresponding result data is obtained; considering that the field content generally has a large amount of data, in order to avoid excessive occupation of system resources and affecting other business logic processing, it is preferred to asynchronously report the second sampling data to the system security center for offline content comparison detection.

[0074] In addition, for the above-mentioned field name detection rules and field content detection rules, one can be selected for detection according to business needs. For example, in the Internet medical business system, the patientName field name in the response result data is likely to be the patient name, and the patientString field may also be the patient name. At this time, it is best to use the field content detection rule for content detection; you can also use the field name detection rule and the field content detection rule together for more reliable detection results.

[0075] According to another embodiment of the present invention, whether to issue a warning message is determined based on the response result data of the successful desensitizing match, including: comparing the response result data that meets the detection rules with the response result data of the successful desensitizing match; if the response result data that meets the detection rules and the response result data of the successful desensitizing match are inconsistent, issuing a warning message.

[0076] Specifically, through the above-mentioned detection, when response result data that meets the detection rules is detected, it is necessary to determine whether the response result data has been desensitized, and compare the response result data that meets the detection rules with the desensitized response result data recorded after the above-mentioned desensitization match is successful. If it is found that the response result data that meets the detection rules is not in the record of successful desensitization match, it means that the data may have been leaked, and a warning message is sent to the platform to prompt relevant personnel to find the problem as soon as possible, check the desensitization rules, and improve and update the desensitization rules as soon as possible.

[0077] Through the above detection method, detection is not limited to offline detection, but can also support online detection of field names, which improves detection efficiency and ensures the reliability of desensitization processing. Moreover, through the setting of monitoring levels, hierarchical detection can be flexibly performed to meet the needs of business scenarios to the greatest extent.

[0078] Figure 3It is a schematic diagram of the overall process of the data desensitization and detection method of the embodiment of the present invention. The acquired response result data is first serialized to obtain a JSON string; then the JSON string is converted into a JSON tree structure to facilitate subsequent data desensitization and detection; considering that the field value in the response result data may be a JSON object or a JSON array, this situation requires recursive traversal, and the field name of each data is recursively traversed layer by layer based on the JSON tree. For each data, it is determined whether the field name is a string. If it is a string, it indicates that subsequent data desensitization and detection can be performed; if it is not a string, data desensitization and detection are not required, and other branches and levels in the JSON tree are continued to be traversed; for situations where subsequent data desensitization and detection can be performed, the preset desensitization rules and According to the preset detection rules, multi-threaded desensitization and detection are performed respectively; for desensitization, desensitization matching is performed according to the request identifier of the temporarily stored interface, the field name, the data level where the field name is located, and the field value corresponding to the field name. If the match fails, the Json tree is recursively traversed to extract data from other branches or levels; if the match is successful, desensitization processing is required, and desensitization processing is performed according to the desensitization type in the matched desensitization rule; the desensitized string is then used to replace the original field value; when the recursive traversal is not completed, that is, when there is unprocessed data in the JSON tree, the JSON tree is continued to be recursively traversed to execute the above-mentioned desensitization matching and desensitization processing and other related processes until the recursive traversal is completed; finally, serialization processing is performed and the request page is returned to the client. Correspondingly, for detection, whether to perform hierarchical detection is determined based on the request identifier of the temporarily stored interface and the first detection level and / or the second detection level in the detection rules configured by the configuration center. If hierarchical detection is not required, the JSON tree is continued to be recursively traversed to extract data from other branches or levels; if hierarchical detection is required, field name detection and / or field content detection is performed according to the configured detection rules; for field name detection, name detection can be performed directly online through regular expressions, and for field content detection, it can usually be reported to the security center for content comparison and offline detection; when the recursive traversal is not completed, the JSON tree is continued to be recursively traversed to execute the above-mentioned related detection processes until the recursive traversal is completed; for each request, whether to issue an alarm message is determined by comparing the consistency between the data that meets the detection rules and the data that has been successfully desensitized and matched.

[0079] Figure 4It is a schematic diagram of the principle of data desensitization of an embodiment of the present invention. In the figure, each client sends a business request through an interface. After the business processing is completed, the built-in interceptor inside the business system uniformly intercepts the original response data of each interface, converts the original response data to obtain the response result data of each interface; serializes the response result data to obtain serialized result data; pulls the preset desensitization rules from the configuration center, and performs desensitization matching on the serialized result data according to the desensitization rules; desensitizes the successfully matched serialized result data, replaces it with a desensitized string, and returns it to the client after serialization to display the response result data after desensitization.

[0080] Figure 5 Schematic diagram of the main modules of the data desensitization device according to an embodiment of the present invention. Figure 5 As shown, the data desensitization device 500 mainly includes a data acquisition module 501, a desensitization matching module 502 and a desensitization processing module 503.

[0081] The data acquisition module 501 is used to respond to a business request and acquire response result data corresponding to the business request;

[0082] A desensitization matching module 502 is used to perform desensitization matching on the response result data and a preset desensitization rule;

[0083] The desensitization processing module 503 is used to perform desensitization processing on the response result data according to the matched desensitization rules when the desensitization matching is successful.

[0084] According to one embodiment of the present invention, the data acquisition module 501 is also used to: intercept original response data corresponding to the business request; convert the original response data into hypertext transfer protocol response data through a hypertext transfer protocol converter, and the response data is the response result data.

[0085] According to another embodiment of the present invention, the data desensitizing device 500 also includes an identification matching module (not shown in the figure), which is used to: before desensitizing and matching the response result data with the preset desensitizing rule, obtain a request identification according to the business request; and determine whether the request identification matches the first request path in the preset desensitizing rule.

[0086] According to another embodiment of the present invention, the response result data includes a field name and a field value, and the desensitizing rule includes a desensitized field and a data level where the desensitized field is located; the desensitizing matching module 502 is used to: perform a first match between the field name of the response result data and the desensitized field; if the first match is successful, perform a second match between the data level where the response result data is located and the data level where the desensitized field is located; if the second match is successful, determine whether the field value corresponding to the field name is a string type; if the field value is a string type, the desensitizing match is successful.

[0087] According to another embodiment of the present invention, the desensitization processing module 503 is also used to: desensitize the field value corresponding to the field name according to the desensitization type in the matching desensitization rule to obtain a desensitized string; and use the desensitized string to replace the field value.

[0088] According to one embodiment of the present invention, the data desensitizing device 500 also includes a recording module (not shown in the figure), which is used to: after performing desensitizing matching, record the response result data of successful desensitizing matching; the data desensitizing device 500 also includes a detection module (not shown in the figure), which is used to: after obtaining the response result data corresponding to the business request, obtain the request identifier according to the business request; determine that the request identifier matches the second request path in the preset detection rule; and detect the response result data according to the preset detection rule to determine whether to issue a warning message based on the response result data of successful desensitizing matching when the detection rule is met.

[0089] According to another embodiment of the present invention, the detection rules include field name detection rules; the detection module (not shown in the figure) is also used to: determine a first sampling ratio according to a first detection level in the field name detection rule; perform sampling on the response result data according to the first sampling ratio to obtain first sampling data; perform name detection on the first sampling data through a regular expression according to the field name in the field name detection rule.

[0090] According to another embodiment of the present invention, the detection rules include field content detection rules; the detection module (not shown in the figure) is also used to: determine a second sampling ratio according to a second detection level in the field content detection rules; perform sampling on the response result data according to the second sampling ratio to obtain second sampling data; and perform content comparison detection on the second sampling data according to the field content in the field content detection rules.

[0091] According to another embodiment of the present invention, the detection module (not shown in the figure) is also used to: compare the response result data that meets the detection rules with the response result data of the successful desensitization match; and issue a warning message if the response result data that meets the detection rules and the response result data of the successful desensitization match are inconsistent.

[0092] According to another embodiment of the present invention, the data desensitization device 500 further includes a serialization module (not shown in the figure), which is used to: serialize the response result data before the desensitization matching and the detection.

[0093] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.

[0094] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0095] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as data desensitization applications (only as an example).

[0096] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0097] The server 605 may be a server that provides various services, such as a background management server (only an example) that provides support for data desensitization performed by users using terminal devices 601, 602, and 603. The background management server may respond to a service request and obtain response result data corresponding to the service request; perform desensitization matching on the response result data and preset desensitization rules; if the desensitization matching is successful, perform desensitization processing on the response result data according to the matched desensitization rules, and feed back the processing result (such as desensitized data, etc. - only an example) to the terminal device.

[0098] It should be noted that the data desensitization method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the data desensitization device is generally set in the server 605 .

[0099] It should be understood that Figure 6 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.

[0100] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0101] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0102] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0103] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0104] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, may be described as: a processor including: a data acquisition module, a desensitization matching module and a desensitization processing module.

[0107] The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, a data acquisition module may also be described as “a module for responding to a business request and acquiring response result data corresponding to the business request.”

[0108] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or it may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by a device, the device includes: in response to a business request, obtaining response result data corresponding to the business request; performing desensitization matching on the response result data with a preset desensitization rule; and in the case of a successful desensitization match, performing desensitization processing on the response result data according to the matched desensitization rule.

[0109] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by responding to the business request, the response result data corresponding to the business request is obtained; the response result data is desensitized and matched with the preset desensitization rules; when the desensitization match is successful, the response result data is desensitized according to the matched desensitization rules. The technical solution realizes the desensitization matching of the acquired data to be desensitized with the preset desensitization rules, so that when the match is successful, the data is desensitized in real time and flexibly according to the matched desensitization rules, which solves the problem of frequently modifying the desensitization processing code to meet the increasing desensitization needs, improves the desensitization processing efficiency, and saves research and development resources.

[0110] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A method for data desensitization, characterized in that: include: In response to a business request, obtaining response result data corresponding to the business request; Desensitizing and matching the response result data with the preset desensitization rules; When the desensitization match is successful, the response result data is desensitized according to the matched desensitization rule.

2. The method according to claim 1, characterized in that In response to a service request, obtaining response result data corresponding to the service request includes: Intercepting original response data corresponding to the business request; The original response data is converted into hypertext transfer protocol response data through a hypertext transfer protocol converter, and the response data is the response result data.

3. The method according to claim 1, characterized in that Before desensitizing and matching the response result data with the preset desensitization rules, it includes: According to the business request, obtaining a request identifier; Determine whether the request identifier matches the first request path in the preset desensitization rule.

4. The method according to claim 1, characterized in that: The response result data includes a field name and a field value, and the desensitization rule includes a desensitized field and a data level where the desensitized field is located; Desensitizing and matching the response result data with the preset desensitization rules, including: Perform a first match between the field name of the response result data and the desensitized field; If the first match is successful, a second match is performed between the data level where the response result data is located and the data level where the desensitized field is located; If the second match is successful, determine whether the field value corresponding to the field name is a string type; When the field value is of string type, the desensitization match is successful.

5. The method according to claim 4, characterized in that The response result data is desensitized according to the matched desensitization rule, including: According to the desensitization type in the matched desensitization rule, the field value corresponding to the field name is desensitized to obtain a desensitized string; The field value is replaced using the desensitized string.

6. The method according to claim 1, characterized in that The method further comprises: After performing desensitization matching, record the response result data of successful desensitization matching; After obtaining the response result data corresponding to the business request, obtaining a request identifier according to the business request; Determining that the request identifier matches a second request path in a preset detection rule; The response result data is detected according to preset detection rules, so as to determine whether to issue a warning message based on the response result data of the successful desensitization match if the detection rules are met.

7. The method according to claim 6, characterized in that The detection rules include field name detection rules; The response result data is tested according to a preset test rule, including: Determining a first sampling ratio according to a first detection level in the field name detection rule; Performing sampling inspection on the response result data according to the first sampling inspection ratio to obtain first sampling inspection data; According to the field names in the field name detection rule, name detection is performed on the first sampling data using a regular expression.

8. The method according to claim 6, characterized in that The detection rules include field content detection rules; The response result data is tested according to a preset test rule, including: Determining a second sampling ratio according to a second detection level in the field content detection rule; Performing sampling inspection on the response result data according to the second sampling inspection ratio to obtain second sampling inspection data; According to the field content in the field content detection rule, a content comparison detection is performed on the second sampling data.

9. The method according to claim 6, characterized in that Determining whether to issue a warning message according to the response result data of the successful desensitization match includes: Compare the response result data that meets the detection rule with the response result data that successfully matches the desensitization; When the response result data that complies with the detection rule is inconsistent with the response result data of the successful desensitization match, a warning message is issued.

10. The method according to claim 3 or 6, characterized in that: Before the desensitization matching and the detection, the response result data is serialized.

11. A data desensitization device, characterized in that: include: A data acquisition module, used to respond to a business request and acquire response result data corresponding to the business request; A desensitization matching module, used for performing desensitization matching on the response result data and a preset desensitization rule; The desensitization processing module is used to perform desensitization processing on the response result data according to the matched desensitization rules when the desensitization match is successful.

12. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 10.

13. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Cited By

  • Data desensitization processing method and device, data desensitization access method and device, equipment and medium

    CN119416258A