Log desensitization method and device, electronic equipment and storage medium

By automating the desensitization configuration items of log files, the problems of information security and high costs in manual processing are solved, and efficient and secure log file desensitization is achieved.

CN120688079APending Publication Date: 2025-09-23NETSUNION CLEARING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410339262.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-22
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, the processing of sensitive information in log files relies on manual desensitization, which has the problems of unguaranteed information security and high cost.

Method used

By obtaining the desensitization configuration items of the log file, including the replacement method and replacement information of sensitive information, the sensitive information in the log file is automatically replaced and the replacement information is marked to ensure security and efficiency.

Benefits of technology

It achieves automated log file desensitization, improves processing efficiency, ensures information security, and flexibly handles different types of sensitive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688079A_ABST
    Figure CN120688079A_ABST
Patent Text Reader

Abstract

The invention discloses a log desensitization method and device, electronic equipment and a storage medium, belongs to the field of data processing, and is used for improving the processing efficiency of log desensitization. The method comprises the following steps: acquiring a to-be-processed log file; determining a desensitization configuration item of the log file, wherein the desensitization configuration item comprises a replacement mode and replacement information of sensitive information; replacing the field corresponding to the sensitive information with the replacement information according to the replacement mode; and marking the replacement information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of log file management, and specifically to a log desensitization method, device, electronic device, and storage medium. Background Art

[0002] As businesses develop, related technical issues are constantly updated and updated, and community communication becomes active. Users will seek help from the technical community when encountering difficult business or technical issues. When seeking help from the community, users often need to provide error-related information from log files to determine the specific type of business or technical issue. Furthermore, to standardize the relevant steps and technical solutions for technical development, relevant personnel will also review log files. Log files often contain sensitive information, such as Internet Protocol (IP) addresses.

[0003] Related technologies export log files and then manually screen and replace sensitive information, which can easily lead to sensitive information leakage. In addition, since the format of log files is not fixed, the cost of manual desensitization is high. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, electronic device, and storage medium for log desensitization, which can solve the problem that manual desensitization cannot guarantee information security and is costly, and improve the processing efficiency of log desensitization.

[0005] In a first aspect, an embodiment of the present application provides a method for log desensitization, the method comprising: obtaining a log file to be processed; determining a desensitization configuration item of the log file, the desensitization configuration item including a replacement method and replacement information for sensitive information; according to the replacement method, replacing a field corresponding to the sensitive information with the replacement information; and marking the replacement information.

[0006] In the second aspect, an embodiment of the present application provides a log desensitizing device, which includes: an acquisition module for acquiring a log file to be processed; a first processing module for determining a desensitizing configuration item of the log file, wherein the desensitizing configuration item includes a replacement method and replacement information for sensitive information; a second processing module for replacing a field corresponding to the sensitive information with the replacement information according to the replacement method; and a marking module for marking the replacement information.

[0007] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In an embodiment of the present application, by obtaining a log file to be processed; determining a desensitizing configuration item of the log file, the desensitizing configuration item includes a replacement method and replacement information for sensitive information; according to the replacement method, replacing the field corresponding to the sensitive information with the replacement information; marking the replacement information to desensitize the log file, it is possible to solve the problem that manual desensitization cannot guarantee information security and is costly, realize automatic desensitization, and improve desensitization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 This is a flow chart of a log desensitization method provided in an embodiment of the present application;

[0011] Figure 2 This is a flow chart of another log desensitization method provided in an embodiment of the present application;

[0012] Figure 3 This is a schematic diagram of the structure of a log desensitization device provided in an embodiment of the present application;

[0013] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0014] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0015] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0016] The following, in conjunction with the accompanying drawings, describes in detail a log desensitization method, device, electronic device, and storage medium provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0017] Figure 1 An embodiment of the present invention provides a log desensitization method, which can be performed by an electronic device, which may include a server and / or a terminal device. In other words, the method can be performed by software or hardware installed on the electronic device, and the method includes the following steps:

[0018] S101: Obtain a log file to be processed.

[0019] Log files are files or collections of files used to record system operational events. They can be categorized as event logs and message logs. Log files are very helpful for diagnosing and resolving problems. When a system runs a program, it typically writes messages or error events to a corresponding log file, providing a reliable reference for troubleshooting technical issues or standardizing development procedures.

[0020] Optionally, if the log file is large, a method of retrieving a fixed number of log lines can be used multiple times when retrieving the log file to be processed. For example, if the log file is larger than 200MB, only a certain number of log lines starting from the starting line can be retrieved each time, such as retrieving 500 lines of log files to be processed each time. This fixed number of lines can be set according to actual needs and is not specifically limited in this application.

[0021] S102: Determine the desensitization configuration item of the log file.

[0022] The desensitization configuration items include a replacement method for sensitive information and replacement information.

[0023] Sensitive information refers to any information whose improper use, unauthorized access, or modification could be detrimental to national interests or federal government programs, or to individuals' legally protected privacy rights. Sensitive information in log files includes personal identification information, device information such as mobile phone numbers, IP addresses, and network port addresses, or any combination of at least one of these sensitive information types.

[0024] Specifically, desensitizing a log file is essentially transforming the sensitive information in the log file to protect the security of the sensitive information. Since the log file includes different types of sensitive information, in the embodiment of the present application, when determining the desensitization configuration items, the same replacement method and replacement information can be determined for different types of sensitive information, or different replacement methods and replacement information can be determined for different types of sensitive information. That is, the embodiment of the present application can flexibly determine the desensitization configuration items for different types of sensitive information.

[0025] Optionally, the above-mentioned desensitizing configuration items can be displayed on the front-end page, and the replacement method and replacement information of sensitive information can be set in the form of front-end components such as radio buttons or check boxes. Users select and combine the desensitizing configuration items of the log file by clicking the radio buttons or check boxes of the above-mentioned replacement method and the above-mentioned replacement information.

[0026] Optionally, the above replacement information can be randomly generated or obtained through user input.

[0027] S103: According to the replacement method, the field corresponding to the sensitive information is replaced with the replacement information.

[0028] Specifically, after determining the replacement method and replacement information for sensitive information, the embodiment of the present application replaces the fields corresponding to the sensitive information in the log file with the above-mentioned replacement information, thereby ensuring the security of the sensitive information in the log file.

[0029] S104: Mark the replacement information.

[0030] Specifically, since the above-mentioned replacement information is not the original content in the log file, after the log file is desensitized, in order to facilitate the rapid identification of the above-mentioned replacement information, the embodiment of the present application marks the replacement information in the desensitized log file to distinguish the replacement information from the original content in the log file.

[0031] As an example, the replacement information in the log file may be marked by bolding, italicizing, or highlighting.

[0032] The log desensitization method provided in an embodiment of the present application obtains a log file to be processed; determines a desensitization configuration item of the log file, wherein the desensitization configuration item includes a replacement method and replacement information for sensitive information; replaces a field corresponding to the sensitive information with the replacement information according to the replacement method; and marks the replacement information. This method can solve the problem that manual desensitization cannot guarantee information security and is costly, and can flexibly determine desensitization configuration items, realize automatic desensitization of log files, and improve the desensitization efficiency of log files.

[0033] In one implementation, the desensitization configuration item further includes a desensitization rule, which is used to determine the replacement method and the replacement information; the desensitization rule includes at least one of the following:

[0034] The replacement information for the same sensitive information is the same; specifically, for the same sensitive information at different locations in the log file, the embodiment of the present application can determine the replacement information for the sensitive information at different locations as the same replacement information through the above-mentioned desensitization rules. This implementation method can ensure that the replacement information in the log file has the same association relationship as the sensitive information, thereby ensuring the continuity of the log file context. For example, in a log file of a database, when the same name is stored in different data tables, the same name in different data tables before desensitization is also the same after desensitization, which can ensure the association relationship between different data tables.

[0035] The replacement method for the field containing the sensitive information is the same as the replacement method for the sensitive information; specifically, since the log file will contain other information containing the sensitive information obtained by permutation and combination of at least one sensitive information, such as an order number containing a complete mobile phone number. The embodiment of the present application can select the same replacement method as the sensitive information for the field containing the sensitive information, and desensitize the other information containing the sensitive information. Compared with the manual desensitization method that is prone to errors and omissions, the embodiment of the present application can desensitize different forms of sensitive information, thereby ensuring the security of sensitive information.

[0036] The replacement information of the field containing the sensitive information is the same as the replacement information of the sensitive information; specifically, the embodiment of the present application can determine the replacement information of the field containing the sensitive information as the same replacement information through the above-mentioned desensitization rules, thereby ensuring the consistency of the log file context.

[0037] Optionally, the embodiment of the present application may desensitize the complete field containing the above-mentioned sensitive information, or may only desensitize the sensitive information in the field.

[0038] In one implementation, the type of the replacement information includes a numeric type or a character type; and when the type of the sensitive information is a numeric type, the replacement information meets a first preset condition, and the first preset condition includes at least one of the following:

[0039] The replacement information is of a numerical type; specifically, maintaining the type of the replacement information consistent with the type of the sensitive information can improve the relevance of the replacement information and the sensitive information. In some application scenarios, technical issues can be more efficiently identified or data analysis can be performed based on log files. For example, in a data analysis scenario, maintaining the type of the replacement information consistent with the type of the sensitive information allows operators to directly use the content in the desensitized log file for data analysis or verification, which helps improve work efficiency.

[0040] The replacement information is the same length as the sensitive information. Specifically, in some application scenarios, sensitive information in log files has certain length restrictions, such as a mobile phone number must be 11 digits. By maintaining the same length as the replacement information, embodiments of the present application can overcome information length restrictions in some application scenarios, allowing for more efficient identification of technical issues or data analysis based on log files.

[0041] The replacement information has the same encoding rules as the sensitive information; specifically, different types of sensitive information have corresponding encoding rules, for example, the encoding rules for a telephone number include the first three digits being the network identification number, the fourth to seventh digits being the area code, and the eighth to eleventh digits being the user number. The embodiment of the present application maintains the type of replacement information being the same as the encoding rules for the sensitive information to more efficiently perform business verification and determine whether the technical problem is caused by illegally encoded sensitive information. For example, in a model training application scenario, using a virtual phone number to replace a real phone number can ensure the validity and security of the data.

[0042] In one implementation, when the sensitive information is of character type, the replacement information meets a second preset condition, which includes: the replacement information is of character type; or the replacement information is the same length as the sensitive information. By maintaining the same type of replacement information as the sensitive information, embodiments of the present application can improve the relevance of the replacement information and the sensitive information. By maintaining the same length as the sensitive information, information length limitations in some application scenarios can be overcome, allowing for more efficient identification of technical issues or data analysis based on log files.

[0043] In one implementation, the replacement includes at least one of the following:

[0044] Contact information replacement;

[0045] Internet Protocol IP address replacement;

[0046] Port address replacement;

[0047] Regular expression replacement.

[0048] Specifically, the embodiment of the present application can determine the corresponding replacement method based on the sensitive information. Among them, the regular expression replacement method requires the user to input a matching regular expression. For example, the bank card number in the log file can be matched through the regular expression ((?<=[^\d])|^)([1-9]{1})(\d{15,16}|\d{18})((?=[^\d]xX)|$), and then the bank card number in the log file is desensitized through the embodiment of the present application. This method can match and desensitize any character in the log file to avoid missing sensitive information.

[0049] Optionally, when the user selects a regular expression replacement, the next regular expression replacement option is automatically added to support multiple regular expression replacements at the same time.

[0050] Optionally, you can set the length of the replacement information replaced by the regular expression to no more than twice the length of the sensitive information to avoid the replacement information being too long.

[0051] In one implementation, marking the replacement information after replacement includes: marking each piece of replacement information in the log file according to the replacement method of the sensitive information.

[0052] Specifically, due to the different types of sensitive information, when marking the replacement information, different methods can be used to mark each replacement information in the log file to identify different replacement methods. For example, different colors can be used to mark replacement information based on contact information, IP address, port address, or regular expression.

[0053] In one implementation, marking the replaced information includes: marking each piece of replacement information included in a currently displayed page when previewing the log file.

[0054] Specifically, when the log file is too large, desensitizing the complete log file will cause the desensitization process to be stuck. The embodiment of the present application only marks the various replacement information included in the currently displayed page, and when the user drags the log file downward, the log file entering the currently displayed page is dynamically desensitized. The embodiment of the present application can avoid the problem of being stuck when the log file is too large due to desensitizing the complete log file by marking the various replacement information included in the currently displayed page when previewing the log file, thereby achieving a better preview effect.

[0055] Optionally, after the desensitization processing of the log file is completed, a download portal is provided so that the user can save the desensitized log file locally.

[0056] Optionally, after the desensitization process of the log file is completed, the desensitization times of different types of sensitive information in the log file are displayed.

[0057] The following is a detailed description of the log desensitization method provided by this application through a specific example.

[0058] Figure 2 Another log desensitization method provided by the embodiment of the present application is shown as follows: Figure 2 As shown, the log desensitization method includes the following steps:

[0059] S201: Select a log file.

[0060] Specifically, the log files that need to be desensitized can be stored in a local storage path or cloud storage space.

[0061] S202: Preview the log file content.

[0062] Specifically, the contents of the log file can be previewed on a display page. Optionally, the display page displays a fixed number of lines of the log file.

[0063] S203: Select a replacement method.

[0064] Specifically, select the corresponding replacement method based on the type of sensitive information in the log file. For example, the replacement method for mobile phone numbers can be contact information replacement or regular expression replacement.

[0065] S204: Select replacement information.

[0066] Specifically, after determining the replacement method, the replacement information of the sensitive information is determined, and the replacement information includes one of equal-length numbers, equal-length characters, random-length numbers, random-length characters, and fixed values.

[0067] If it is detected that the replacement information is a fixed value, step S205 is executed; if it is not detected that the replacement information is a fixed value, step S206 is executed.

[0068] S205: Input a fixed value.

[0069] Specifically, the user inputs a fixed value that replaces the sensitive information.

[0070] S206: Select a desensitization rule.

[0071] Specifically, at least one desensitization rule can be selected, in which the replacement information of the same sensitive information is the same, the replacement method of the field containing the sensitive information is the same as the replacement method of the sensitive information, or the replacement information of the field containing the sensitive information is the same as the replacement information of the sensitive information.

[0072] Optionally, when the replacement information is a number of equal length or a number of random length, the desensitization rule may also include selecting the replacement information to maintain the original encoding rule of the sensitive information.

[0073] S207: Display the replacement information in a special color.

[0074] Specifically, the replacement information according to the contact information, IP address, port address, and regular expression can be marked with different colors.

[0075] Optionally, when the mouse points to the replacement information, the sensitive information before desensitization is displayed, and when the mouse moves away, the replacement information is displayed.

[0076] S208: Confirm the desensitization and export the desensitized log file.

[0077] Specifically, after previewing the log file of the current page, you can choose to perform desensitization processing on the complete log file and export the desensitized log file to a local path.

[0078] The log desensitization method provided in the embodiment of the present application can flexibly determine the replacement method and replacement information of sensitive information by selecting a log file; previewing the log file content; selecting a replacement method; selecting replacement information; entering a fixed value; selecting a desensitization rule; displaying the replacement information in a special color; confirming the desensitization and exporting the desensitized log file, thereby increasing the diversity of desensitization processing, realizing automatic desensitization of log files, and improving the desensitization efficiency of log files. By displaying the replacement information in a special color, it is convenient for users to preview and identify the replacement information.

[0079] Figure 3 This is a structural diagram of a log desensitization device provided by the present invention. Figure 3 As shown, the log desensitization device 300 includes: an acquisition module 310, a first processing module 320, a second processing module 330, and a marking module 340.

[0080] An acquisition module 310 is used to acquire a log file to be processed; a first processing module 320 is used to determine a desensitizing configuration item of the log file, wherein the desensitizing configuration item includes a replacement method and replacement information for sensitive information; a second processing module 330 is used to replace the field corresponding to the sensitive information with the replacement information according to the replacement method; and a marking module 340 is used to mark the replacement information.

[0081] In one implementation, the marking module 340 is further configured to mark each of the replacement information in the log file according to the replacement method of the sensitive information.

[0082] In one implementation, the marking module 340 is further configured to mark each of the replacement information included in the currently displayed page when previewing the log file.

[0083] The log desensitization device in the embodiment of the present application can be a device, or it can be a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplary, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an ATM or an Automated Machine, etc., which is not specifically limited in the embodiment of the present application.

[0084] The log desensitization device in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0085] The log desensitization device provided in the embodiment of the present application can achieve Figure 1 and Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0086] Alternatively, as Figure 4 As shown, an embodiment of the present application further provides an electronic device 400, including a processor 401 and a memory 402, wherein the memory 402 stores a program or instruction that can be run on the processor 401, and when the program or instruction is executed by the processor 401, it implements: obtaining the log file to be processed; determining the desensitizing configuration item of the log file, the desensitizing configuration item including the replacement method and replacement information of the sensitive information; according to the replacement method, replacing the field corresponding to the sensitive information with the replacement information; marking the replacement information.

[0087] In one implementation, when the program or instruction is executed by the processor 401 , it can further implement: marking each of the replacement information in the log file according to the replacement method of the sensitive information.

[0088] In one implementation, when the program or instruction is executed by the processor 401 , it can further achieve: when previewing the log file, marking each of the replacement information included in the currently displayed page.

[0089] The specific execution steps can refer to the various steps of the above-mentioned log desensitization method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0090] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices other than terminals.

[0091] The above electronic device structure does not constitute a limitation of the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. to configure the display panel. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include but are not limited to a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0092] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus random access memory (DRRAM).

[0093] The processor may include one or more processing units; optionally, the processor may integrate an application processor and a modem processor, wherein the application processor primarily handles operations related to the operating system, user interface, and application programs, and the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into the processor.

[0094] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned log desensitization method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0095] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as ROM, RAM, magnetic disk or optical disk.

[0096] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0098] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A log desensitization method, characterized in that: include: Get the log files to be processed; Determining a desensitization configuration item for the log file, wherein the desensitization configuration item includes a replacement method for sensitive information and replacement information; According to the replacement method, the field corresponding to the sensitive information is replaced with the replacement information; The replacement information is marked.

2. The method according to claim 1, characterized in that The desensitization configuration item further includes a desensitization rule, and the desensitization rule is used to determine the replacement method and the replacement information; The desensitization rules include at least one of the following: The replacement information for the same sensitive information is the same; The field containing the sensitive information is replaced in the same manner as the sensitive information; The replacement information of the field containing the sensitive information is the same as the replacement information of the sensitive information.

3. The method according to claim 1, characterized in that The type of the replacement information includes a numerical type or a character type; and When the sensitive information is of a numerical type, the replacement information meets a first preset condition, and the first preset condition includes at least one of the following: The type of the replacement information is a numerical type; The replacement information has the same length as the sensitive information; The replacement information has the same encoding rule as the sensitive information.

4. The method according to claim 3, characterized in that In a case where the type of the sensitive information is character type, the replacement information meets a second preset condition, and the second preset condition includes: The type of the replacement information is a character type; or The replacement information has the same length as the sensitive information.

5. The method according to claim 1, wherein The replacement method includes at least one of the following: Contact information replacement; Internet Protocol IP address replacement; Port address replacement; Regular expression replacement.

6. The method according to claim 1, wherein The replacement information after the mark is replaced includes: According to the replacement method of the sensitive information, each piece of replacement information in the log file is marked respectively.

7. The log desensitization method according to claim 1, characterized in that: The replacement information after the mark is replaced includes: When previewing the log file, each of the replacement information included in the currently displayed page is marked.

8. A log desensitization device, characterized in that: include: The acquisition module is used to obtain the log files to be processed; A first processing module is configured to determine a desensitization configuration item for the log file, where the desensitization configuration item includes a replacement method for sensitive information and replacement information; A second processing module, configured to replace the field corresponding to the sensitive information with the replacement information according to the replacement method; A marking module is used to mark the replacement information.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the log desensitization method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, which, when executed by a processor, implements the steps of the log desensitization method according to any one of claims 1 to 7.