Information masking method and device, electronic equipment and storage medium
By dynamically configuring information and customizing serialization filters at the gateway level, and using serialization tools to perform sensitive information masking, the problems of low masking timeliness and efficiency in existing technologies are solved, and efficient sensitive information masking operations are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies have poor timeliness and low efficiency in handling sensitive information masking, requiring modifications to application code and affecting system availability and development iteration pace.
At the gateway level, dynamic configuration information and custom serialization filters are used to mask the fields to be processed using serialization tools, avoiding masking operations in the application. The mask configuration is dynamically controlled by the Apollo configuration center.
This improves the timeliness and efficiency of sensitive information masking operations, avoids modifications to application code, and reduces development costs and impact.
Smart Images

Figure CN115544966B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data security, in particular to an information masking method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the rapid development of the Internet, the disclosure of sensitive information by Internet products is also increasingly serious, therefore, users have increasingly strict requirements for the protection of sensitive information. In the prior art, when sensitive information is masked, the masking operation is implemented in specific business applications by modifying the code. In order to ensure the usability of the system, a certain modification period is usually set, and the system cannot be used during the modification process, resulting in poor timeliness and low efficiency of the masking operation. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide an information masking method and device, an electronic device and a storage medium, which perform masking operations at the gateway level, dynamically configure information, select appropriate serialization tools according to a custom "serialization filter", process fields that need to be masked, avoid masking in applications, realize dynamic masking configuration, and improve the timeliness and efficiency of the masking operation.
[0004] In a first aspect, the embodiments of the present application provide an information masking method, comprising: being applied to a gateway; comprising: obtaining a response message, the response message comprising field information; determining a to-be-processed field from the field information; according to the to-be-processed field, acquiring a masking serialization tool corresponding to the to-be-processed field; and performing masking processing on the to-be-processed field by using the masking serialization tool.
[0005] In the implementation process described above, the to-be-processed field is determined from the field information of the response message at the gateway level, the corresponding masking serialization tool is selected according to the to-be-processed field, and the to-be-processed field is masked by using the serialization tool, so that the masking operation can be realized without modifying the application code, the convenience of the masking operation is improved, and the masking efficiency is improved.
[0006] Optionally, in the embodiments of the present application, the response message comprises an interface path; the to-be-processed field is determined from the field information, comprising: obtaining masking configuration information, the masking configuration information comprising a serialization interface path and preset field information corresponding to the serialization interface path; wherein the serialization interface path is an interface path that needs to be serialized; the preset field information is field information that needs to be serialized; judging whether the interface path matches the serialization interface path; if yes, determining the to-be-processed field from the field information according to the preset field information corresponding to the serialization interface path.
[0007] In the implementation process, the response message includes an interface path, the mask configuration information includes a serialized interface path, the interface path in the response message is matched with the serialized interface path in the mask configuration information, if the matching is successful, the to-be-processed field is determined from the preset field information. Only the serialized interface path and the preset field information that need to be processed by the mask are configured in the mask configuration information, the to-be-processed field can be determined, and the granularity of the mask operation can be realized at the interface level, and the granularity of the mask operation is refined.
[0008] Optionally, in the embodiment of the application, according to the to-be-processed field, the mask serialization tool corresponding to the to-be-processed field is obtained, including: obtaining a serialized filter; the serialized filter includes a mask field and a mask serialization tool corresponding to the mask field; the mask field is field information that needs to be processed by the mask; it is judged whether the to-be-processed field matches the mask field; if yes, the mask serialization tool corresponding to the to-be-processed field is obtained according to the serialized filter.
[0009] In the implementation process, the pre-defined serialized filter is obtained, the mask field is included in the serialized filter, if the to-be-processed field and the mask field match successfully, the mask serialization tool corresponding to the to-be-processed field information is selected according to the mask field, the corresponding mask serialization tool is called, and the to-be-processed field is processed by the mask.
[0010] Optionally, in the embodiment of the application, before the serialized filter is obtained, the method further includes: establishing the serialized filter by rewriting the serializeAsField method; wherein the serializeAsField method inherits the SimpleBeanPropertyFilter class.
[0011] In the implementation process, the serializeAsField method inherits the SimpleBeanPropertyFilter class, the serialized filter is defined by rewriting the serializeAsField method, the serialized filter sets the mask field and the mask serialization tool corresponding to the mask field, and the dynamic mask is realized by using the interceptor customized by the serialization tool.
[0012] Optionally, in the embodiment of the application, the method further includes: if the to-be-processed field does not match the mask field, the to-be-processed field is processed by a normal serialization tool.
[0013] In the implementation process, if the to-be-processed field does not match the mask field, the to-be-processed field can be processed by a preset normal serialization tool, each to-be-processed field in the interface has a corresponding processing mode, so that a more fine-grained mask processing mode is realized.
[0014] Optionally, in the embodiment of the present application, the mask configuration information further includes a mask mode corresponding to the preset field information; and the mask processing on the to-be-processed field is performed by the mask serialization tool and the mask mode, including: if the interface path matches the serialization interface path, then the mask processing on the to-be-processed field is performed by the mask serialization tool and the mask mode.
[0015] In the implementation process described above, the mask configuration information further includes a mask mode corresponding to the preset field information, and the mask mode corresponding to the preset field information is set in the mask configuration information; when the to-be-processed field matches the preset field information, the to-be-processed field is processed by the mask serialization tool and the corresponding mask mode. Without configuring the mask parameter by using the application code, the mask operation on the to-be-processed field in the corresponding mask mode can be performed by setting the mask mode in the mask configuration information.
[0016] Optionally, in the embodiment of the present application, the mask configuration information is obtained from the Apollo configuration center.
[0017] In the implementation process described above, the mask configuration information is obtained from the Apollo configuration center, and the serialization interface path, the preset field information corresponding to the serialization interface path, and the mask mode are set in the Apollo configuration center, that is, the specific interface and the field in the interface that needs to be masked and the mask mode are dynamically controlled, and the configured data is synchronized to the mask configuration hit in the gateway, so that the dynamic mask is implemented.
[0018] In a second aspect, the embodiment of the present application further provides an information mask device, including: an obtaining module, configured to obtain a response message, the response message including field information; a determining field module, configured to determine a to-be-processed field from the field information; a determining tool module, configured to acquire a mask serialization tool corresponding to the to-be-processed field according to the to-be-processed field; and a processing module, configured to perform mask processing on the to-be-processed field by using the mask serialization tool.
[0019] In a third aspect, the embodiment of the present application further provides an electronic device, including a processor and a memory, the memory storing machine readable instructions executable by the processor, and the machine readable instructions are executed by the processor to perform the method described above.
[0020] In a fourth aspect, the embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium storing a computer program, and the computer program is executed by the processor to perform the method described above.
[0021] The information masking method, device, electronic equipment and storage medium provided in the application perform the masking operation at the gateway level, set a serialization interface path, preset field information corresponding to the serialization interface path and a masking mode in the Apollo configuration center. By dynamically configuring information, a suitable serialization tool is selected according to a self-defined “serialization filter”, a field that needs to be masked is processed, masking in the application is avoided, the application development rhythm is not disturbed, dynamic masking configuration is realized, and the timeliness and efficiency of the masking operation are improved. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments of the application. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0023] Figure 1 A dynamic masking flowchart in a gateway provided by the embodiments of the application is shown in the figure.
[0024] Figure 2 A flowchart of an information masking method provided by the first embodiment of the application is shown in the figure.
[0025] Figure 3 A flowchart of an information masking method provided by the second embodiment of the application is shown in the figure.
[0026] Figure 4 A structure diagram of an information masking device provided by the embodiments of the application is shown in the figure.
[0027] Figure 5 A structure diagram of an electronic equipment provided by the embodiments of the application is shown in the figure. DETAILED DESCRIPTION
[0028] The embodiments of the technical solutions of the application will be described in detail below with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the application, and therefore only serve as examples, and cannot limit the protection scope of the application.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the application.
[0030] In the description of the embodiments of the present application, the technical terms "first", "second" and the like are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly specified.
[0031] When the prior art masks sensitive information, whether it is a new application about to go online or an application that has already gone online, the code needs to be updated to implement the masking of sensitive information at the code level. In order to ensure the usability of the application system and avoid frequent changes to the code, which causes the system to be unusable, the code flow modification will have a certain period, which causes the timeliness of information masking to be poor and the code cannot be changed in real time to implement masking of the field. Moreover, the processing method of the prior art will cause the code to be missed or added during masking, which needs to be changed repeatedly, and in severe cases, it will affect the normal development and iteration rhythm of the application. Therefore, the embodiments of the present application provide an information masking method, which realizes dynamic masking through dynamic configuration of the Apollo configuration center and a custom serialization filter at the gateway level.
[0032] Masking is a bitwise AND operation of a string of binary codes on a target field to mask the current input bits. Serialization is the process of converting the state information of an object into a form that can be stored or transmitted. During serialization, the object writes its current state to a temporary or persistent storage area. Later, the object can be recreated by reading or deserializing the state of the object from the storage area. The process of restoring the byte sequence to an object is called deserialization of the object.
[0033] Before describing the information masking method, device, electronic equipment and storage medium provided by the present application, the dynamic masking workflow in the gateway is briefly described. Please refer to Figure 1 The dynamic masking process in the gateway provided by the embodiments of the present application is shown in the figure.
[0034] Gateway (Gateway) is also called network connector or protocol converter. Gateway realizes network interconnection at the network layer and above, is a complex network interconnection device, and is only used for network interconnection of two different high-layer protocols. Gateway is a computer system or device that acts as a conversion hub. Gateway includes Zuul gateway, and Zuul is a microservice gateway in spring cloud.
[0035] The masking operation is migrated to the gateway level, for example: Zuul gateway receives a request sent by a terminal, then forwards the request to the corresponding business system, the business system responds to the request and generates a response message, and the Zuul gateway forwards the response message.
[0036] The Zuul gateway is provided with a mask response filter, and the mask response filter is configured with parameters, and fields in a response message that need to be processed by the mask response filter are processed by the mask response filter. Therefore, when the Zuul gateway forwards the response message to the terminal, the mask response filter performs the mask processing when filtering the response message. Finally, the response message after the mask processing is forwarded to the corresponding terminal.
[0037] Please refer to Figure 2 A flowchart of an information masking method provided by the first embodiment of the application is shown.
[0038] Step S110: Obtain a response message, and the response message includes field information.
[0039] The implementation of the above step S110 includes: obtaining, by the mask configuration hitter, a response message to be forwarded by the gateway, the response message being a response message generated by a business system after receiving a terminal request, the response message including field information, for example, a response message returned by a user detail information interface of the business system, including a name field and a mobile phone number field. It should be noted that the response message can also include other parameters, for example, interface information, which is not limited in the embodiments of the application.
[0040] Step S120: Determine a to-be-processed field from the field information.
[0041] The implementation of the above step S120 includes: the mask configuration hitter is configured with preset field information, and the preset field information is a field to be processed by the mask. After obtaining the field information, the mask configuration hitter determines whether the field information matches the preset field information, and if the field in the field information matches the preset field information, the field information that matches is determined as the to-be-processed field. The to-be-processed field is a field to be processed by the mask. It can be understood that for some response messages, the to-be-processed field does not exist in the field information, and for such response messages, the mask processing is not performed, and the response message can be directly forwarded to the corresponding terminal.
[0042] Step S130: Obtain a mask serialization tool corresponding to the to-be-processed field according to the to-be-processed field.
[0043] The implementation of the step S130 includes: obtaining, by the serialization filter, the mask serialization tool corresponding to the to-be-processed field according to the to-be-processed field. For example, the mask serialization tool corresponding to the field information in the serialization filter is customized by rewriting method, for example: the mask serialization tool corresponding to the user identifier field userId in the response message field is a normal serialization tool, the mask serialization tool corresponding to the telephone number field mobile is a mobile phone number mask serialization, and the mask serialization tool corresponding to the name field name is a name mask serialization. Therefore, the customized "serialization filter" selects the serialization tool for each to-be-processed field in the response message.
[0044] The step S140 includes: performing mask processing on the to-be-processed field by the mask serialization tool.
[0045] The implementation of the step S140 includes: after the serialization filter determines the mask serialization tool corresponding to the to-be-processed field, the corresponding mask serialization tool is called to perform mask processing on the to-be-processed field. It should be noted that if the mask serialization tool corresponding to the to-be-processed field is not configured in the serialization filter, the to-be-processed field is processed by using a preset serialization mode.
[0046] In the implementation process, the to-be-processed field is determined from the field information in the response message at the gateway level, the corresponding mask serialization tool is selected by using the serialization tool selection, and the to-be-processed field is processed by calling the mask serialization tool. The mask operation can be implemented without modifying the application code, the effect of real-time mask is achieved, and the mask operation convenience and mask efficiency are improved.
[0047] Optionally, in the embodiment of the application, the response message includes an interface path; the to-be-processed field is determined from the field information, including: obtaining mask configuration information, the mask configuration information including a serialization interface path and preset field information corresponding to the serialization interface path; wherein the serialization interface path is an interface path that needs to be serialized; the preset field information is field information that needs to be serialized; determining whether the interface path matches the serialization interface path; if yes, determining the to-be-processed field from the field information according to the preset field information corresponding to the serialization interface path.
[0048] The implementation of the above step is, for example: the response message includes an interface path, and the gateway forwards the response message, so that the gateway can obtain the interface path in the response message. Obtain the mask configuration information, the mask configuration information includes the serialized interface path and the preset field information corresponding to the serialized interface path; wherein the serialized interface path is the interface path that needs to be serialized; the preset field information is the field information that needs to be serialized. The serialized interface path and the preset field information corresponding to the serialized interface path are configured in the mask configuration information according to actual needs.
[0049] Determine whether the interface path in the response message matches the serialized interface path in the mask configuration information, if yes, determine whether the field information corresponding to the interface path matches the preset field information corresponding to the serialized interface path, if yes, the field information hits the preset field information, and the hit field information is determined as the field to be processed; if the field information does not match the preset field information, the field information that does not match does not need to be processed by the mask, and these fields can be directly returned to the consumer, and the consumer is the terminal that initiates the request. And if the interface path in the response message does not match the serialized interface path in the mask configuration information, the field information in the interface path also does not need to be processed by the mask.
[0050] For example, the response message is information returned by a user detail information interface, the interface path of the response message is userInfo / get, and the field information in the interface path is the user identifier field userId, the phone number field mobile, and the name field name.
[0051] The serialized interface path in the mask configuration information is userInfo / get, and the preset field information in the serialized interface path userInfo / get that needs to be processed by the mask is the phone number field mobile and the name field name.
[0052] Determine whether the interface path matches the serialized interface path, the interface path userInfo / get matches the serialized interface path userInfo / get; according to the preset field information being the phone number field mobile and the name field name, determine that the phone number field mobile and the name field name are the fields to be processed.
[0053] In the implementation process described above, the response message includes an interface path, the mask configuration information includes a serialized interface path, the interface path in the response message is matched with the serialized interface path in the mask configuration information, and if the matching is successful, the to-be-processed field is determined from the preset field information. The prior art is very cumbersome for the mask operation of the micro-service system architecture, because the micro-service itself not only provides service calls externally, but also provides service calls internally. When the external service needs to be subjected to mask processing, the interface fields between services are also easily changed into masks, which will cause other problems and thus affect the actual business. Therefore, when the micro-service is subjected to mask processing, it is necessary to consider which places can call the service interface and which places cannot call the service interface, which greatly increases the development cost of the project. In the embodiment of the application, only the serialized interface path and the preset field information that need to be subjected to mask processing are configured in the mask configuration information, so that the to-be-processed field can be determined, and the mask operation can be performed at the interface level, and the granularity of the mask operation is refined.
[0054] Optionally, in the embodiment of the application, according to the to-be-processed field, the mask serialization tool corresponding to the to-be-processed field is obtained, including: obtaining a serialization filter; the serialization filter includes a mask field and a mask serialization tool corresponding to the mask field; the mask field is field information that needs to be subjected to mask processing; determining whether the to-be-processed field matches the mask field; if yes, obtaining the mask serialization tool corresponding to the to-be-processed field according to the serialization filter.
[0055] The implementation of the above step is, for example: obtaining a serialization filter, the serialization filter is established by rewriting a serializeAsField method, and when the serialization filter is established, the mask field in the serialization filter and the mask serialization tool corresponding to the mask field are defined, and the mask field is field information that needs to be subjected to mask processing.
[0056] Determining whether the to-be-processed field matches the mask field, and if yes, obtaining the mask serialization tool corresponding to the to-be-processed field according to the mask serialization tool corresponding to the mask field in the serialization filter.
[0057] For example, the serialization filter includes a mask field and a mask serialization tool corresponding to the mask field; wherein the mask field is a telephone number field mobile and a name field name, the mask serialization tool corresponding to the telephone number field mobile is a mobile phone number mask serialization, and the mask serialization tool corresponding to the name field name is a name mask serialization.
[0058] In the implementation process, a predefined serialization filter is obtained, the serialization filter includes a mask field, if the to-be-processed field and the mask field match successfully, a mask serialization tool corresponding to the to-be-processed field information is selected according to the mask field, and the mask serialization tool is called to perform mask processing on the to-be-processed field.
[0059] Optionally, in the embodiment of the application, before the serialization filter is obtained, the method further includes: establishing the serialization filter by rewriting a serializeAsField method; and the serializeAsField method inherits a SimpleBeanPropertyFilter class.
[0060] For example, in the implementation of the above step, a corresponding mask serialization tool is selected for the to-be-processed field matching the mask field by customizing the serialization filter. The serialization filter needs to inherit the SimpleBeanPropertyFilter class and rewrite the serializeAsField method. In the serializeAsField method, the to-be-processed field that needs to be serialized is judged. If the mask field in the configuration is hit, the corresponding mask serialization tool is called to perform mask processing on the to-be-processed field. The serialization filter includes a custom serialization filter of JACKSON. JACKSON is a set of data processing tools of Java, including a first-class JSON (JavaScript Object Notation, JS object notation) parsing library and a generation library, a matching data binding library (used for conversion between a class and a JSON string), and other data format modules to process encoded data.
[0061] In the implementation process, the serializeAsField method inherits the SimpleBeanPropertyFilter class, the serialization filter is defined by rewriting the serializeAsField method, the serialization filter sets the mask field and the mask serialization tool corresponding to the mask field, and the dynamic mask is implemented by using the interceptor customized by the serialization tool.
[0062] Optionally, in the embodiment of the application, the method further includes: if the to-be-processed field does not match the mask field, processing the to-be-processed field by using a normal serialization tool.
[0063] For example, in the implementation of the above step, if the to-be-processed field does not match the mask field, the to-be-processed field does not need to be processed by mask processing, and the to-be-processed field is processed by calling the normal serialization tool.
[0064] For example, the mask field is included in the serialization filter, and the mask field corresponds to the mask serialization tool; the mask field can be the mobile field, the name field, and the like. The to-be-processed field includes the user identifier field, the mobile field, and the name field. The user identifier field in the to-be-processed field does not match the mask field, and the user identifier field is processed by using the normal serialization tool. It can be understood that the normal serialization tool can be a preset form of serialization tool, and the embodiment of the application does not limit the normal serialization tool.
[0065] In the implementation process, if the to-be-processed field does not match the mask field, the to-be-processed field can be processed by using the preset normal serialization tool. Each to-be-processed field in the interface has a corresponding processing manner, so that a more fine-grained mask processing manner is implemented.
[0066] Optionally, in the embodiment of the application, the mask configuration information further includes a mask manner corresponding to the preset field information; and the mask processing of the to-be-processed field by using the mask serialization tool includes: if the interface path matches the serialization interface path, the mask processing of the to-be-processed field is performed by using the mask serialization tool and the mask manner.
[0067] For example, the mask configuration information further includes a mask manner corresponding to the preset field information, and the user configures the mask manner corresponding to each preset field information in the mask configuration information. The configuration information is synchronized in the mask configuration hit device. If the interface path matches the serialization interface path, the mask processing of the to-be-processed field is performed by using the mask serialization tool and the mask manner.
[0068] In the implementation process, the mask configuration information further includes a mask manner corresponding to the preset field information. When the to-be-processed field matches the preset field information, the to-be-processed field is processed by using the mask serialization tool and the corresponding mask manner. The mask parameter does not need to be configured by using the application code, but the mask manner is set in the mask configuration information. The mask operation of the to-be-processed field is performed by using the corresponding mask manner.
[0069] Optionally, in the embodiment of the application, the mask configuration information is obtained from the Apollo configuration center.
[0070] The implementation of the above steps is, for example: the mask configuration information is obtained from an Apollo configuration center. Apollo is a configuration management platform that can centrally manage the configurations of different environments and different clusters of an application. After the configuration is modified, it can be pushed to the application end in real time, and it has standardized permission, process management, and other characteristics. After the user modifies the mask configuration information in Apollo and publishes it, the mask configuration hitter can receive the latest configuration in real time and synchronize the mask configuration information to the mask configuration hitter to determine whether the interface path in the response message matches the serialized interface path in the mask configuration information.
[0071] In the above implementation process, the mask configuration information is obtained from the Apollo configuration center. In the Apollo configuration center, the serialized interface path, the preset field information corresponding to the serialized interface path, and the mask mode are set, that is, the specific interface and the field in the interface that need to be masked and the mask mode are dynamically controlled. The configured data is synchronized to the "mask configuration hitter" in the gateway to realize dynamic masking.
[0072] See Figure 3 A flowchart of an information masking method according to a second embodiment of the application is shown.
[0073] In a preferred embodiment, a user sets mask configuration information through an Apollo configuration center. The mask configuration information includes a serialized interface path and preset field information corresponding to the serialized interface path. The serialized interface path is an interface path that needs to be serialized. The preset field information is field information that needs to be serialized. The mask configuration information is synchronized to a mask configuration hitter in real time. The mask configuration hitter determines whether the interface path in a response message matches the serialized interface path. If so, the field to be processed is determined from the field information according to the preset field information corresponding to the serialized interface path. If not, it means that the interface path is a hit serialized interface path, and these fields can be directly returned to a consumer, which is a terminal that initiates a request.
[0074] A corresponding mask serialization tool is selected for the field to be processed that matches the mask field by defining a serialization filter. The serialization filter determines whether the field to be processed matches the mask field. If it matches the mask field, that is, it hits the mask field in the configuration, the corresponding mask serialization tool is called to perform mask processing on the field to be processed. If the field to be processed does not match the mask field, the field to be processed does not need to be masked, and then normal serialization is performed. Finally, the fields that have been masked and normally serialized are returned to the terminal.
[0075] See Figure 4A structural schematic diagram of an information masking device provided by an embodiment of the application is shown; an embodiment of the application provides an information masking device 200, comprising:
[0076] An obtaining module 210 is configured to obtain a response message, wherein the response message comprises field information;
[0077] A determining field module 220 is configured to determine a to-be-processed field from the field information;
[0078] A determining tool module 230 is configured to obtain a mask serialization tool corresponding to the to-be-processed field according to the to-be-processed field;
[0079] A processing module 240 is configured to perform mask processing on the to-be-processed field by using the mask serialization tool.
[0080] Optionally, in an embodiment of the application, the information masking device, the response message comprises an interface path; the determining field module 220 is specifically configured to obtain mask configuration information, the mask configuration information comprises a serialization interface path and preset field information corresponding to the serialization interface path; the serialization interface path is an interface path that needs to be serialized; the preset field information is field information that needs to be serialized; it is determined whether the interface path matches the serialization interface path; if yes, the to-be-processed field is determined from the field information according to the preset field information corresponding to the serialization interface path.
[0081] Optionally, in an embodiment of the application, the information masking device, the determining tool module 230 is specifically configured to obtain a serialization filter; the serialization filter comprises a mask field and a mask serialization tool corresponding to the mask field; the mask field is field information that needs to be masked; it is determined whether the to-be-processed field matches the mask field; if yes, the mask serialization tool corresponding to the to-be-processed field information is obtained according to the serialization filter.
[0082] Optionally, in an embodiment of the application, the information masking device further comprises a custom serialization filter module configured to establish a serialization filter by rewriting a serializeAsField method; the serializeAsField method inherits a SimpleBeanPropertyFilter class.
[0083] Optionally, in an embodiment of the application, the information masking device further comprises a normal serialization processing module configured to perform processing on the to-be-processed field by using a normal serialization tool if the to-be-processed field does not match the mask field.
[0084] Optionally, in the embodiment of the present application, the information masking device, the mask configuration information further comprises a mask mode corresponding to the preset field information, and further comprises a mask mode processing module configured to, if the interface path matches the serialization interface path, perform mask processing on the to-be-processed field by using the mask serialization tool and the mask mode.
[0085] Optionally, in the embodiment of the present application, the information masking device, wherein the mask configuration information is obtained from an Apollo configuration center.
[0086] It should be understood that the device corresponds to the above-mentioned information masking method embodiments, and can perform various steps involved in the above-mentioned method embodiments. The specific functions of the device can be referred to the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module stored in the memory in the form of software or firmware or solidified in the operating system (OS) of the device.
[0087] Please refer to Figure 5 The electronic device 300 provided by the embodiment of the present application is shown in the structure schematic diagram of the electronic device. The electronic device 300 provided by the embodiment of the present application comprises a processor 310 and a memory 320. The memory 320 stores machine readable instructions executable by the processor 310. The machine readable instructions are executed by the processor 310 to perform the method as above.
[0088] The embodiment of the present application further provides a storage medium, and the storage medium stores a computer program. The computer program is run by a processor to perform the method as above.
[0089] The storage medium can be realized by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0090] It should be understood that the disclosed apparatus and method can also be implemented in other manners. The embodiments described above are merely exemplary embodiments of the present application. In the embodiments of the present application, the described apparatus embodiments are merely schematic, and the functions of the flowcharts and the block diagrams can be implemented in other manners. For example, the flowcharts and the block diagrams can be implemented by using a computer program, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, a processor, a controller, another hardware device, or a combination thereof. In this case, the disclosed apparatus and method can be implemented in a form of a computer program product. The computer program product is directly downloadable from a network, or stored in a computer-readable storage medium, and includes a plurality of instructions. When the instructions are executed by a processor, the processor performs the method according to the embodiments of the present application.
[0091] In addition, each functional module in each of the embodiments of the present application can be integrated together to form a separate part, or each module can exist independently, or two or more modules can be integrated to form a separate part.
[0092] The above description is merely optional implementation of the embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.
Claims
1. An information masking method, characterized in that, Applied to gateways; including: Receive a response message, the response message including field information; The fields to be processed are determined from the field information; Based on the field to be processed, obtain the mask serialization tool corresponding to the field to be processed; The field to be processed is masked using the mask serialization tool. The response message includes the interface path; determining the field to be processed from the field information includes: Obtain mask configuration information, which includes a serialization interface path and preset field information corresponding to the serialization interface path; wherein, the serialization interface path is the interface path that needs to be serialized; and the preset field information is the field information that needs to be serialized. Determine whether the interface path matches the serialization interface path; If so, then the field to be processed is determined from the preset field information corresponding to the serialization interface path; The step of obtaining the mask serialization tool corresponding to the field to be processed includes: Obtain a serialization filter; the serialization filter includes a mask field and a mask serialization tool corresponding to the mask field; the mask field is the field information that needs to be masked. Determine whether the field to be processed matches the mask field; If so, then according to the serialization filter, obtain the mask serialization tool corresponding to the field information to be processed.
2. The method according to claim 1, characterized in that, Prior to obtaining the serialization filter, the method further includes: The serialization filter is established by overriding the serializeAsField method; wherein the serializeAsField method inherits from the SimpleBeanPropertyFilter class.
3. The method according to claim 1, characterized in that, The method further includes: If the field to be processed does not match the mask field, the field to be processed is processed using normal serialization tools.
4. The method according to claim 1, characterized in that, The mask configuration information also includes the masking method corresponding to the preset field information; the masking process of the field to be processed using the mask serialization tool includes: If the interface path matches the serialization interface path; The field to be processed is then masked using the mask serialization tool and the masking method.
5. The method according to claim 1, characterized in that, in, The mask configuration information is obtained from the Apollo configuration center.
6. An information masking device, characterized in that, include: The acquisition module is used to acquire a response message, the response message including field information; The field determination module is used to determine the field to be processed from the field information; The tool module is used to obtain the mask serialization tool corresponding to the field to be processed based on the field to be processed. The processing module is used to perform masking processing on the field to be processed using the mask serialization tool; The response message includes the interface path; the determination field module is specifically used for: Obtain mask configuration information, which includes a serialization interface path and preset field information corresponding to the serialization interface path; wherein, the serialization interface path is the interface path that needs to be serialized; and the preset field information is the field information that needs to be serialized. Determine whether the interface path matches the serialization interface path; If so, then the field to be processed is determined from the preset field information corresponding to the serialization interface path; The determination tool module is specifically used for: Obtain a serialization filter; the serialization filter includes a mask field and a mask serialization tool corresponding to the mask field; the mask field is the field information that needs to be masked. Determine whether the field to be processed matches the mask field; If so, then according to the serialization filter, obtain the mask serialization tool corresponding to the field information to be processed.
7. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when executed by the processor, perform the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data protection method and system, equipment and storage medium
CN113886880A