WO2020258492A1 - 信息处理方法、装置、存储介质及终端设备 - Google Patents
信息处理方法、装置、存储介质及终端设备 Download PDFInfo
- Publication number
- WO2020258492A1 WO2020258492A1 PCT/CN2019/103028 CN2019103028W WO2020258492A1 WO 2020258492 A1 WO2020258492 A1 WO 2020258492A1 CN 2019103028 W CN2019103028 W CN 2019103028W WO 2020258492 A1 WO2020258492 A1 WO 2020258492A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- text content
- processed
- file
- regular expression
- string
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
Definitions
- This application relates to the field of data processing, in particular to an information processing method, device, storage medium and terminal equipment.
- this application provides an information processing method, including:
- this application provides an information processing device, including:
- Formatting module used to obtain a file containing text content, and format the text content of the file into a string array;
- Matching module used to filter the string array according to the regular expression, and obtain the to-be-processed strings in the string array that meet the requirements of the regular expression;
- Determination module used to replace the characters contained in the character string to be processed according to the regular expression, generate a matching character string corresponding to the character string to be processed, perform reverse formatting processing on the matching character string, and determine The matched text content corresponding to the matched string;
- Replacement module used to obtain the to-be-processed text content corresponding to the to-be-processed character string in the file, and replace the to-be-processed text content with the matching text content corresponding to the matching character string.
- the present application also provides a non-volatile storage medium storing computer-readable instructions.
- the computer-readable instructions When executed by one or more processors, one or more processors execute a An information processing method, the information processing method includes the following steps:
- the present application also provides a terminal device.
- the terminal device includes one or more processors, memories, and one or more computer programs, wherein the one or more computer programs are used to execute a type of information Processing method, the information processing method includes the following steps:
- This application provides a method for processing the specified text content in the file.
- the text content of the file is processed, and the text content of the file is formatted into a string of characters, so that the The text content is regarded as a string array composed of one character string, and then a regular expression for processing the text content of the file is obtained, and the strings to be processed in the string array that meet the requirements of the regular expression are filtered, and according to the regular expression Replace the characters contained in the string to be processed, generate a matching string corresponding to the string to be processed, perform reverse formatting processing on the matched string, and determine the matched text content corresponding to the matched string.
- the file is simulated to be opened, and the replacement operation is simulated to obtain the text content to be processed corresponding to the character string to be processed in the file, Replace the to-be-processed text content with the matching text content corresponding to the matching string, complete the conversion of the to-be-processed text content in the
- FIG. 1 is a schematic flowchart of an embodiment of the information processing method of this application
- FIG. 2 is a schematic flowchart of another embodiment of the information processing method of this application.
- FIG. 3 is a schematic diagram of an embodiment of the information processing device of this application.
- Figure 4 is a schematic structural diagram of an embodiment of a terminal device of this application.
- the embodiment of the present application provides an information processing method. As shown in FIG. 1, the method includes the following steps:
- S10 Obtain a file containing text content, and format the text content of the file into a string array.
- the processing includes mask processing, replacement processing,
- a file containing text content is first obtained, and then text preprocessing is performed on the file.
- the text content is formatted.
- the content analysis tool is integrated into the In the application program of the embodiment, the text content of the file is processed by calling the content analysis tool such as tika to obtain the metadata, content and other content of the file, and the formatting information is returned, thereby formatting the text content of the file into a string
- the collection of these strings is defined as a string array.
- S20 Filter the string array according to the regular expression, and obtain the to-be-processed strings in the string array that meet the requirements of the regular expression.
- a configuration file is provided, and regular expressions are configured in the configuration file.
- the configuration file is an xml configuration file.
- the regular expression is formulated in the xml configuration file.
- the regular expression is a string A logical formula for operation, including operations on ordinary characters (for example, letters between a and z) and special characters (called "metacharacters"), using pre-defined characters and combinations of these characters A "rule string” is formed, and the string is filtered by the "rule string”.
- a regular expression is used to filter the string array, and from the string Strings that meet the regular expression rules are found in the array, and these strings are defined as strings to be processed.
- the regular expressions include different condition rules, and different strings are matched according to different condition rules, and further Yes, you can also match strings that meet multiple condition rules based on a combination of multiple condition rules to filter out the specified text content in the file.
- a condition rule included in a regular expression is to filter out the character "aa”
- the string containing the character "aa” can be filtered out.
- the regular expression Replace the characters contained in the string to be processed includes changing the characters of the string, for example, replacing the character a with the character b; the replacing also includes deleting the characters of the string, that is, replacing the character a with empty Characters; the replacement also includes adding characters to the string, that is, replacing the character a with the character ab;, after the string to be processed is replaced, a matching string corresponding to the string to be processed is generated, that is, the string to be processed
- the replacement is performed according to the regular expression rules, and the result of the replacement is still a character string.
- the replaced character string is defined as a matching character string
- the matching character string is used for subsequent replacement of the character string to be processed
- the matching string corresponding to the string aaaa to be processed is xxxx
- the matching string corresponding to the string bbcc to be processed is xyxy.
- the generated matching character string is subjected to reverse formatting processing to determine the matching text content corresponding to the matching character string, and the matching text content is saved in the configuration file.
- the character string to be processed is a character string in a general format or a standard format of the file, and can be converted into other character strings in any format.
- S40 Obtain the to-be-processed text content corresponding to the to-be-processed character string in the file, and replace the to-be-processed text content with the matching text content corresponding to the matching character string.
- the file is simulated to be opened, specifically, the file format type of the file is obtained , And then obtain the method of simulating opening the file format type according to the file format type, including simulating opening a .txt format file, a .doc format file or a .pdf file, and then simulating a text content replacement operation.
- the to-be-processed character string is converted into the to-be-processed text content, and then the to-be-processed text content is searched and located in the file, and then the matching text content corresponding to the converted matching string is obtained, and then the to-be-processed content is replaced with
- the matched text content completes the conversion of the to-be-processed text content in the file, and realizes the shielding, modification or masking of important or sensitive information in the file.
- This embodiment provides a method for processing the text content specified in the file.
- the text content of the file is processed, and the text content of the file is formatted into a string of characters, thereby converting the file
- the text content of is regarded as a string array composed of one string, and then the regular expression for processing the text content of the file is obtained, and the strings to be processed in the string array that meet the requirements of the regular expression are filtered, and according to the regular expression
- the expression replaces the characters contained in the string to be processed, generates a matching string corresponding to the string to be processed, performs reverse formatting processing on the matched string, and determines the matched text corresponding to the matched string Content, after determining the matching character string corresponding to each character string to be processed, obtain the text content to be processed corresponding to the character string to be processed in the file, and replace the text content to be processed with the
- the matching text content corresponding to the matching string can complete the conversion of the to-be-processed text content in the file, and realize the shielding
- the to-be-processed text content corresponding to the to-be-processed character string in the file is acquired, and the to-be-processed text content is replaced with the one corresponding to the matching character string After matching the text content, it also includes:
- the to-be-processed text content is replaced with the matching text content corresponding to the matching string
- the original text format of the to-be-processed text content is obtained, and then the text format of the matching text content that replaces the to-be-processed text content is set
- the text format of the matched text content is the same as the text format of the text content to be processed, and both are the original text format.
- the text format of the replaced text content is still the bold format
- the original text format is the to-be-processed text content of No. 5 Song
- the text format of the replaced text content is still On No. 5 Song Ti
- the text content is replaced or modified under the text format that does not modify the text content of the original file, so as to achieve the advantage of not affecting the overall text format of the file.
- the method further includes:
- the modification to the matching character string of the configuration file is received, and the corresponding regular expression is modified.
- the modification of the regular expression of the configuration file is received, and the replacement condition of the regular expression is modified. After the modification, it can be based on the string to be processed and the replacement condition of the regular expression. Generate different matching strings to modify the matching strings corresponding to the strings to be processed. When you need to replace the same to-be-processed text content with different matching text content, you can modify the regular expression in the configuration file to modify The corresponding match string.
- the modification to the matching character string of the configuration file is received, and the corresponding regular expression is modified.
- the configuration file determines After the character string to be processed, the corresponding regular expression can be modified by modifying the matching character string to ensure that the character string to be processed can be replaced with the required matching character string, so that the configuration file can be modified in real time, thereby improving The processing efficiency of the text content in the file meets the needs of different businesses for processing the file content.
- the method after replacing the to-be-processed text content with the matching text content corresponding to the matching string, the method further includes:
- the text content replacement file is regenerated.
- a text content replacement file is generated based on the replaced matching text content. Due to the initial stage of machine processing, there may be a relatively high rate of text content replacement errors.
- the accuracy rate of the content processing of the text content replacement file is counted, and when the accuracy rate is lower than the preset value, adjust according to the accuracy rate
- the regular expression used in this replacement is used to determine the target regular expression, and then the target regular expression is configured, and the information processing operation is performed on the file again to regenerate the text content replacement file.
- the regular expression with high accuracy is first used to process the file. If the accuracy of the regular expression does not meet the requirements in actual applications, replace it with other regular expressions to improve the accuracy of file content processing .
- the method before the filtering the string array according to the regular expression and obtaining the to-be-processed strings in the string array that meet the requirements of the regular expression, the method includes:
- the attribute information of the file is acquired, and a regular expression corresponding to the attribute information of the file is matched according to a preset rule.
- different regular expressions are used to implement different processing of files at different stages. Specifically, Before the string array is filtered according to the regular expression to obtain the to-be-processed strings in the string array that meet the requirements of the regular expression, the attribute information of the file is obtained, and then the file is matched according to preset rules. A regular expression corresponding to the attribute information of the file, so as to determine the regular expression required for files with different attribute information at this time.
- the attribute information includes the creation time of the file, and then the current time is determined The time interval between the file creation time and the file creation time, the regular expression corresponding to the time interval is obtained, and then the files with different creation times are processed correspondingly according to the different regular expressions. For example, if the interval between the creation time of the file and the current time is greater than 6 months, the matching regular expression A will mask the text content X and Y in the file based on the regular expression A, and when the time interval Less than 6 months, the matching regular expression B will mask the text content Y in the file based on the regular expression B, and the text content X will not be masked.
- the method before the filtering the string array according to the regular expression and obtaining the to-be-processed strings in the string array that meet the requirements of the regular expression, the method includes:
- the files to be processed include a variety of file formats, such as .doc format, .txt format, and .pdf format.
- file formats such as .doc format, .txt format, and .pdf format.
- the regular expression it is judged whether the file format of the file is a preset format, if not, the file format is converted to a preset format, and the file of the preset format has a corresponding regular expression Matching is performed, and then the regular expression corresponding to the preset format is obtained, so as to realize the processing of files in different file formats and improve the processing efficiency of files in different file formats.
- the present application provides an information processing device, including:
- Formatting module 10 used to obtain a file containing text content, and format the text content of the file into a string array;
- the matching module 20 is configured to filter the string array according to the regular expression, and obtain the to-be-processed strings in the string array that meet the requirements of the regular expression;
- the determining module 30 is configured to replace characters contained in the character string to be processed according to the regular expression, generate a matching character string corresponding to the character string to be processed, and perform reverse formatting processing on the matching character string, Determine the matching text content corresponding to the matching string;
- Replacement module 40 used to obtain the to-be-processed text content corresponding to the to-be-processed character string in the file, and replace the to-be-processed text content with the matching text content corresponding to the matching character string.
- the replacement module 40 further includes execution
- the device further includes:
- Configuration module used to associate and save the regular expression, the character string to be processed, and the matching character string to a configuration file; receive the modification of the regular expression of the configuration file, modify the corresponding matching character string, or receive the Modify the matching string of the configuration file and modify the corresponding regular expression.
- the device further includes:
- Adjustment module used to generate a text content replacement file based on the matched text content after replacement; count the correct rate of the text content replacement file, determine the target regular expression according to the correct rate; renew according to the target regular expression Generate the text content replacement file.
- the matching module 20 further includes executing:
- the matching module 20 further includes executing:
- the present application provides a non-volatile storage medium storing computer-readable instructions, and a computer program is stored on the computer-readable storage medium.
- the computer program is executed by a processor to implement the above-mentioned embodiments.
- the described information processing method includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random AcceSS) Memory), EPROM (EraSable Programmable Read-Only Memory), EEPROM (Electrically EraSable Programmable Read-Only Memory), flash memory, magnetic card or Light card.
- a storage device includes any medium that stores or transmits information in a readable form by a device (for example, a computer, a mobile phone), and may be a read-only memory, a magnetic disk, or an optical disk.
- the embodiment of the application provides a non-volatile storage medium storing computer-readable instructions, which can obtain a file containing text content, format the text content of the file into a string array;
- the string array is filtered to obtain the string to be processed in the string array that meets the requirements of the regular expression; the characters contained in the string to be processed are replaced according to the regular expression to generate the string to be processed Process the matching character string corresponding to the character string, perform reverse formatting processing on the matching character string, and determine the matching text content corresponding to the matching character string; obtain the text content to be processed corresponding to the character string to be processed in the file , Replacing the to-be-processed text content with the matching text content corresponding to the matching string.
- the text content of the file is processed, and the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- a regular expression for processing the text content of the file filter the strings to be processed in the string array that meet the requirements of the regular expression, and pair according to the regular expression
- the characters contained in the character string to be processed are replaced, a matching character string corresponding to the character string to be processed is generated, and the matching character string is subjected to reverse formatting processing to determine the matching text content corresponding to the matching character string.
- the non-volatile storage medium storing the computer-readable instructions provided in the embodiments of the present application can implement the foregoing information processing method embodiments.
- the present application also provides a terminal device.
- the terminal device includes a processor 403, a memory 405, an input unit 407, and a display unit 409.
- the memory 405 may be used to store a computer program 401 and various functional modules, and the processor 403 runs the computer program 401 stored in the memory 405 to execute various functional applications and data processing of the device.
- the memory 405 may be internal memory or external memory, or include both internal memory and external memory.
- the internal memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory.
- ROM read only memory
- PROM programmable ROM
- EPROM electrically programmable ROM
- EEPROM electrically erasable programmable ROM
- flash memory or random access memory.
- External storage can include hard disks, floppy disks, ZIP disks, U disks, tapes, etc.
- the memory disclosed in this application includes but is not limited to these types of memory.
- the memory 405 disclosed in this application is only an example and not a limitation.
- the input unit 407 is used to receive signal input and user input.
- the input unit 407 can include a touch panel and other input devices.
- the touch panel can collect user touch operations on or near it (for example, the user uses a finger, a stylus, etc.). The operation of any suitable objects or accessories on the touch panel or near the touch panel), and drive the corresponding connection device according to the preset program; other input devices can include but are not limited to physical keyboards, function keys (such as One or more of playback control buttons, switch buttons, etc.), trackball, mouse, joystick, etc.
- the display unit 409 can be used to display information input by the user or information provided to the user and various menus of the computer device.
- the display unit 409 may take the form of a liquid crystal display, an organic light emitting diode, or the like.
- the processor 403 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer. By running or executing the software programs and/or modules stored in the memory 403, and calling the data stored in the memory, execute Various functions and processing data.
- the terminal device includes one or more processors 403, one or more memories 405, and one or more computer programs 401, wherein the one or more computer programs 401 are stored in the memory. 405 and configured to be executed by the one or more processors 403, and the one or more computer programs 401 are configured to execute the file text content processing method described in the above embodiments.
- the one or more processors 403 shown in FIG. 4 can execute and realize the functions of the formatting module 10, the matching module 20, the determination module 30, and the replacement module 40 shown in FIG. 3.
- a terminal device can obtain a file containing text content, and format the text content of the file into a string array; filter the string array according to a regular expression to obtain the The string to be processed in the string array that meets the requirements of the regular expression; replace the characters contained in the string to be processed according to the regular expression to generate a matching string corresponding to the string to be processed, and Perform reverse formatting processing on the matched string to determine the matched text content corresponding to the matched string; obtain the to-be-processed text content corresponding to the to-be-processed string in the file, and replace the to-be-processed text content with The matched text content corresponding to the matched string.
- the text content of the file is processed, and the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- the text content of the file is formatted into a string of characters, thereby converting the text content of the file
- a regular expression for processing the text content of the file filter the strings to be processed in the string array that meet the requirements of the regular expression, and pair according to the regular expression
- the characters contained in the character string to be processed are replaced, a matching character string corresponding to the character string to be processed is generated, and the matching character string is subjected to reverse formatting processing to determine the matching text content corresponding to the matching character string.
- the terminal device provided in the embodiment of the present application can implement the embodiment of the information processing method provided above.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Document Processing Apparatus (AREA)
Abstract
一种信息处理方法、装置、存储介质及终端设备,涉及数据处理领域,所述方法包括:获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行匹配,获取所述字符串数组中满足正则表达式要求的待处理字符串;根据所述正则表达式与所述待处理字符串,确定所述待处理字符串对应的匹配字符串;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。该方法能够批量处理文件中的文本内容,提高了文件内容的处理效率。
Description
本申请要求于2019年6月28日提交中国专利局、申请号为201910575551.3,发明名称为“信息处理方法、装置、存储介质及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据处理领域,具体涉及一种信息处理方法、装置、存储介质及终端设备。
随着互联网信息的发展,公司信息、合同信息、个人信息及客户信息等信息都记录在计算机设备中,而在不同时间段或面向不同的用户,需要对记录在案的部分信息进行特殊处理,例如该些信息面向大众时,对重要、敏感的信息作屏蔽处理。而目前,发明人意识到对于此类信息,通常是对存储该些信息的文件直接作加密处理,或者通过人工一一修改文件中的重要、敏感信息,直接对文件进行加密处理无法让文件针对性地面向不同用户,同时,若面向不同的用户需要对文件进行不同处理,通过人工一一修改文件需要耗费大量的资源,造成时间、人力、资源的浪费。
发明内容
为克服以上技术问题,特别是现有技术无法高效、低成本地进行文件内容处理的问题,特提出以下技术方案:
第一方面,本申请提供了一种信息处理方法,包括:
获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;
根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;
根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;
获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
第二方面,本申请提供一种信息处理装置,包括:
格式化模块:用于获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;
匹配模块:用于根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;
确定模块:用于根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;
替换模块:用于获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
第三方面,本申请还提供了一种存储有计算机可读指令的非易失存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行一种信息处理方法,所述信息处理方法包括以下步骤:
获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;
根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;
根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;
获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。。
第四方面,本申请还提供了一种终端设备,所述终端设备包括一个或 多个处理器、存储器、一个或多个计算机程序,其中所述一个或多个计算机程序用于执行一种信息处理方法,所述信息处理方法包括以下步骤:
获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;
根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;
根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;
获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
本申请提供了一种对文件中指定的文本内容进行处理的方法,在获取到文件后,将文件的文本内容进行处理,将文件的文本内容格式化为一个一个的字符串,从而将文件的文本内容看作由一个个字符串组成的字符串数组,然后获取处理该文件文本内容的正则表达式,筛选所述字符串数组中满足正则表达式要求的待处理字符串,根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容,在确定了待处理字符串跟各待处理字符串对应的匹配字符串后,模拟打开所述文件,模拟执行替换操作,获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容,完成对文件中的待处理文本内容的转换,实现对文件中重要或敏感信息的屏蔽、修改或掩码处理,批量化的文件内容处理节省了时间,提高对文件中文本内容的处理效率。
图1为本申请信息处理方法的一实施例流程示意图;
图2为本申请信息处理方法的另一实施例流程示意图;
图3为本申请信息处理装置的一实施例示意图;
图4为本申请终端设备的一实施例结构示意图。
本领域技术人员应当理解,本申请所称的“应用”、“应用程序”、“计算机程序”以及类似表述的概念,是业内技术人员所公知的相同概念,是指由一系列计算机指令及相关数据资源有机构造的适于电子运行的计算机软件。除非特别指定,这种命名本身不受编程语言种类、级别,也不受其赖以运行的操作系统或平台所限制。理所当然地,此类概念也不受任何形式的终端所限制。
本申请实施例提供一种信息处理方法,如图1所示,所述方法包括以下步骤:
S10:获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组。
本实施例中,在需要对文件中包含的内容进行处理时,例如文件中存储的公司信息,个人信息,客户信息,需要对特定的信息进行处理,所述处理包括掩码处理、替换处理、删改处理,首先获取包含文本内容的文件,然后对所述文件进行文本预处理,本实施例的一种实施方式,对所述文本内容进行格式化处理,具体的,将内容分析工具集合到本实施例的应用程序中,通过调用内容分析工具如tika将文件的文本内容进行处理,得到文件的metadata,content等内容,返回格式化信息,从而将文件的文本内容格式化为一个一个的字符串,本实施例将该些字符串的集合成定义为字符串数组。
S20:根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串。
本实施例中,设置有一配置文件,配置文件中配置有正则表达式,一种实施方式,所述配置文件为xml配置文件,在xml配置文件中制定正则表达式,正则表达式是对字符串操作的一种逻辑公式,包括对普通字符(例如,a到z之间的字母)和特殊字符(称为“元字符”)的操作,利用事先定义好的一些字符、及该些字符的组合组成一个“规则字符串”,通 过所述“规则字符串”对字符串进行过滤,具体的,根据xml配置文件的规则,利用正则表达式对所述字符串数组进行筛选,从所述字符串数组中查找到满足正则表达式规则的字符串,将该些字符串定义为待处理字符串,所述正则表达式中包括不同的条件规则,根据不同的条件规则匹配到不同的字符串,进一步的,还可以根据多个条件规则的组合匹配到满足多个条件规则的字符串,从而筛选出文件中指定的文本内容,例如,正则表达式包含的一条件规则为筛选出包含字符“aa”的字符串,根据该正则表达式对字符串数组中的字符串进行筛选,便能筛选出包含字符“aa”的字符串。
S30:根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容。
为了对文件中特定的文本内容进行处理,包括对文本内容进行掩码处理、屏蔽处理、替换处理等,本实施例中,在获取到待处理字符串后,根据所述正则表达式对所述待处理字符串包含的字符进行替换,所述替换包括对字符串的字符进行更改,例如将字符a替换成字符b;所述替换还包括对字符串的字符进行删除,即将字符a替换成空字符;所述替换还包括对字符串的字符进行增加,即将字符a替换成字符ab;,对待处理字符串进行替换后,生成所述待处理字符串对应的匹配字符串,即将待处理字符串按照正则表达式的规则进行替换,替换的结果仍为字符串,本实施例将替换后的字符串定义为匹配字符串,所述匹配字符串为后续替换所述待处理字符串所用,例如,待处理的字符串aaaa对应的匹配字符串为xxxx,待处理字符串bbcc对应的匹配字符串为xyxy。字符串与文本内容存在映射关系,本实施例将生成的匹配字符串进行逆格式化处理,从而确定所述匹配字符串对应的匹配文本内容,并将匹配文本内容保存至配置文件中。
本实施例的一种实施方式,所述待处理字符串为文件的通用格式或标准格式的字符串,可以转化为任意格式的其它字符串。
S40:获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
本实施例中,在xml配置文件中确定了文件中的待处理字符串及每个待处理字符串对应的匹配字符串后,模拟打开所述文件,具体的,获取所述文件的文件格式类型,然后根据所述文件格式类型获取模拟打开所述文件格式类型的方式,包括模拟打开.txt格式文件、.doc格式文件或.pdf文件,然后再模拟执行文本内容替换操作,具体的,将所述待处理字符串转化为待处理文本内容,然后从文件中查找、定位所述待处理文本内容,再获取所述匹配字符串转化后对应的匹配文本内容,然后将所述待处理内容替换为所述的匹配文本内容,完成对文件中的所述待处理文本内容的转换,实现对文件中重要或敏感信息的屏蔽、修改或掩码处理。
本实施例提供了一种对文件中指定的文本内容进行处理的方法,在获取到文件后,将文件的文本内容进行处理,将文件的文本内容格式化为一个一个的字符串,从而将文件的文本内容看作由一个个字符串组成的字符串数组,然后获取处理该文件文本内容的正则表达式,筛选所述字符串数组中满足正则表达式要求的待处理字符串,根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容,在确定了待处理字符串跟各待处理字符串对应的匹配字符串后,获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容,完成对文件中的待处理文本内容的转换,实现对文件中重要或敏感信息的屏蔽、修改或掩码处理,批量化的文件内容处理节省了时间,提高对文件中文本内容的处理效率。
本申请的一种实施例,如图2所示,所述获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,还包括:
S41:获取所述待处理文本内容的原始文本格式,将所述匹配文本内容的文本格式设置为所述原始文本格式。
在实际应用中,由于不同文件具有不同的文本格式,甚至同一文件中不同文字内容亦具有不同的文本格式,包括粗体格式、不同字体格式、不 同颜色格式等,本实施例中,在将将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,获取所述待处理文本内容的原始文本格式,然后将替换掉所述待处理文本内容的匹配文本内容的文本格式设置为所述原始文本格式,设置后所述匹配文本内容的文本格式与待处理文本内容的文本格式相同,均为所述原始文本格式。例如,原先文本格式为粗体格式的待处理文本内容,替换后文本内容的文本格式仍为粗体格式,原先文本格式为5号宋体的待处理文本内容,替换后文本内容的文本格式仍为5号宋体,在不修改原文件文本内容的文本格式下对文本内容进行替换或修改,从而达到不影响文件整体文本格式的优点。
本申请的一种实施例,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之后,还包括:
将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件;
接收对所述配置文件的正则表达式的修改,修改对应的匹配字符串,或
接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式。
在实际应用中,可能不同部门对于文件的内容要求不同,对于文件中相同文本内容想要的处理结果亦不相同,例如,对于部门S1,需要将文件A中的所有涉及人物姓名的文本内容替换为“***”的形式,对于部门S2,需要将文件A中的所有涉及人物姓名的文本内容替换为“姓氏+**”的形式,本实施例中,将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件,例如保存至xml配置文件,然后当不同部门对于文件中相同文本内容的替换需求不同时,只需要修改所述xml配置文件,以修改配置文件中的正则表达式或匹配字符串,便可根据不同的需求替换不同的文本内容。
本实施例的一种实施方式,接收对所述配置文件的正则表达式的修改,对正则表达式的替换条件进行修改,修改后根据待处理字符串及所述正则表达式的替换条件便能生成不同的匹配字符串,以修改待处理字符串 对应的匹配字符串,在需要将相同的待处理文本内容替换为不同的匹配文本内容时,可以通过修改配置文件中的正则表达式,从而修改相应的匹配字符串。本实施例的另一种实施方式,接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式,当业务人员不具备修改正则表达式的能力时,所述配置文件中确定了待处理字符串后,然后通过修改所述匹配字符串,从而修改相应的正则表达式,保证后续能够将待处理字符串替换为所需的匹配字符串,实现实时修改所述配置文件,从而提高对文件中文本内容的处理效率,满足不同业务对文件内容处理的需求。
本申请的一种实施例,所述将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,还包括:
根据替换后的匹配文本内容,生成文本内容替换文件;
统计所述文本内容替换文件的正确率,根据所述正确率确定目标正则表达式;
根据所述目标正则表达式,重新生成所述文本内容替换文件。
本实施例中,在将文件中的待处理文本内容替换为匹配文本内容后,根据替换后的匹配文本内容,生成文本内容替换文件,由于机器处理的开始阶段,可能存在文本内容替换错误率较高的现象,为了进一步提高机器处理的正确率,在一次处理后,统计所述文本内容替换文件的内容处理的正确率,当所述正确率低于预设值时,根据所述正确率调整此次替换时所使用的正则表达式,从而确定目标正则表达式,然后格局所述目标正则表达式,对所述文件再执行一次信息处理操作,重新生成文本内容替换文件。例如,在测试阶段,设置多个不同正则表达式应用于对同一文件的相同文本内容的处理,然后统计所述不同正则表达式的处理结果的正确率,进而根据正确率进行排序,在实际应用中,优先使用正确率高的正则表达式对文件进行处理,若实际应用中,该正则表达式的正确率不满足要求时,再更换为其它正则表达式,以提高对文件内容处理的正确率。
本申请的一种实施例,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:
获取所述文件的属性信息,根据预设规则匹配出与所述文件的属性信息对应的正则表达式。
在实际应用中,不同文件随着业务发展的不同阶段,文件所需要处理的内容不尽相同,本实施例中,通过不同的正则表达式实现对不同阶段的文件进行不同的处理,具体的,在根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,获取所述文件的属性信息,然后根据预设规则匹配出与所述文件的属性信息对应的正则表达式,从而确定不同属性信息的文件此时所需的正则表达式,在一种实施方式中,所述属性信息包括文件的创建时间,然后判断当前时间与所述文件创建时间之间的时长间隔,获取该时长间隔对应的正则表达式,然后再根据不同的正则表达式对不同创建时间的文件进行相应的处理。例如,若文件的创建时间与当前时间的间隔时长大于6个月,匹配的正则表达式A,基于正则表达式A将文件中的文本内容X及Y作掩码处理,而当所述时间间隔小于6个月,匹配的正则表达式B,基于正则表达式B将文件中的文本内容Y作掩码处理,对于文本内容X不作掩码处理。本实施例的一种应用场景,对于申请专利的交底材料,判断该交底材料的创建时间是否小于12个月,若是则屏蔽技术信息和发明人信息;若该交底材料的创建时间大于12个月后,该交底材料的专利文献一般已公开,不需要屏蔽该交底材料的技术信息,只屏蔽发明人信息。
本申请的一种实施例,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:
判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式;
获取所述预置格式对应的正则表达式。
在实际中,待处理的文件包括多种文件格式,如.doc格式、.txt格式、.pdf格式,为了减少对不同格式的文件开发不同的处理逻辑代码而带来二额外的工作量,本实施例中,在确定正则表达式时,判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式,预置 格式的文件则有相应的正则表达式进行匹配,然后获取所述预置格式对应的正则表达式,从而实现对不同文件格式的文件进行处理,提高对不同文件格式的文件的处理效率。
如图3所示,在另一种实施例中,本申请提供了一种信息处理装置,包括:
格式化模块10:用于获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;
匹配模块20:用于根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;
确定模块30:用于根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;
替换模块40:用于获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
本申请的一种实施例,所述替换模块40还包括执行;
获取所述待处理文本内容的原始文本格式,将所述匹配文本内容的文本格式设置为所述原始文本格式。
本申请的一种实施例,所述装置还包括:
配置模块:用于将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件;接收对所述配置文件的正则表达式的修改,修改对应的匹配字符串,或接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式。
本申请的一种实施例,所述装置还包括:
调整模块:用于根据替换后的匹配文本内容,生成文本内容替换文件;统计所述文本内容替换文件的正确率,根据所述正确率确定目标正则表达式;根据所述目标正则表达式,重新生成所述文本内容替换文件。
本申请的一种实施例,所述匹配模块20还包括执行:
获取所述文件的属性信息,根据预设规则匹配出与所述文件的属性信 息对应的正则表达式。
本申请的一种实施例,所述匹配模块20还包括执行:
判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式;获取所述预置格式对应的正则表达式。
在另一种实施例中,本申请提供了一种存储有计算机可读指令的非易失存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例所述的信息处理方法。其中,所述计算机可读存储介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘)、ROM(Read-Only Memory,只读存储器)、RAM(Random AcceSS Memory,随即存储器)、EPROM(EraSable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically EraSable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,存储设备包括由设备(例如,计算机、手机)以能够读的形式存储或传输信息的任何介质,可以是只读存储器,磁盘或光盘等。
本申请实施例提供的一种存储有计算机可读指令的非易失存储介质,可实现获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。通过提供一种对文件中指定的文本内容进行处理的方法,在获取到文件后,将文件的文本内容进行处理,将文件的文本内容格式化为一个一个的字符串,从而将文件的文本内容看作由一个个字符串组成的字符串数组,然后获取处理该文件文本内容的正则表达式,筛选所述字符串数组中满足正则表达式要求的待处理字符串,根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所 述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容,在确定了待处理字符串跟各待处理字符串对应的匹配字符串后,获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容,完成对文件中的待处理文本内容的转换,实现对文件中重要或敏感信息的屏蔽、修改或掩码处理,批量化的文件内容处理节省了时间,提高对文件中文本内容的处理效率。
本申请实施例提供的存储有计算机可读指令的非易失存储介质可以实现上述信息处理方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。
此外,在又一种实施例中,本申请还提供一种终端设备,如图4所示,所述终端设备包括处理器403、存储器405、输入单元407以及显示单元409等器件。本领域技术人员可以理解,图4示出的结构器件并不构成对所有终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件。所述存储器405可用于存储计算机程序401以及各功能模块,所述处理器403运行存储在存储器405的计算机程序401,从而执行设备的各种功能应用以及数据处理。所述存储器405可以是内存储器或外存储器,或者包括内存储器和外存储器两者。内存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)、快闪存储器、或者随机存储器。外存储器可以包括硬盘、软盘、ZIP盘、U盘、磁带等。本申请所公开的存储器包括但不限于这些类型的存储器。本申请所公开的存储器405只作为例子而非作为限定。
输入单元407用于接收信号的输入及接收用户的输入,输入单元407可包括触控面板以及其它输入设备,触控面板可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并根据预先设定的程序驱动相应的连接装置;其它输入设备可以包括但不限于物理键盘、功能键(比如播放控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。显示单元409可用于显示用户输入的信息或提供给用户的信息以及计算机设备的各 种菜单。显示单元409可采用液晶显示器、有机发光二极管等形式。处理器403是计算机设备的控制中心,利用各种接口和线路连接整个电脑的各个部分,通过运行或执行存储在存储器403内的软件程序和/或模块,以及调用存储在存储器内的数据,执行各种功能和处理数据。
在一种实施方式中,所述终端设备包括一个或多个处理器403,以及一个或多个存储器405,一个或多个计算机程序401,其中所述一个或多个计算机程序401被存储在存储器405中并被配置为由所述一个或多个处理器403执行,所述一个或多个计算机程序401配置用于执行以上实施例所述的文件文本内容处理方法。图4中所示的一个或多个处理器403能够执行、实现图3中所示的格式化模块10、匹配模块20、确定模块30、替换模块40的功能。
本申请实施例提供的一种终端设备,可实现获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。通过提供一种对文件中指定的文本内容进行处理的方法,在获取到文件后,将文件的文本内容进行处理,将文件的文本内容格式化为一个一个的字符串,从而将文件的文本内容看作由一个个字符串组成的字符串数组,然后获取处理该文件文本内容的正则表达式,筛选所述字符串数组中满足正则表达式要求的待处理字符串,根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容,在确定了待处理字符串跟各待处理字符串对应的匹配字符串后,获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容,完成对文件中的待处理文本内容的转换,实现对文件中重 要或敏感信息的屏蔽、修改或掩码处理,批量化的文件内容处理节省了时间,提高对文件中文本内容的处理效率。
本申请实施例提供的终端设备可以实现上述提供的信息处理方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。
以上所述仅是本申请的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。
Claims (20)
- 一种信息处理方法,包括:获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
- 根据权利要求1所述的方法,所述获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,所述方法还包括:获取所述待处理文本内容的原始文本格式,将所述匹配文本内容的文本格式设置为所述原始文本格式。
- 根据权利要求1所述的方法,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之后,还包括:将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件;接收对所述配置文件的正则表达式的修改,修改对应的匹配字符串,或,接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式。
- 根据权利要求1所述的方法,所述将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,还包括:根据替换后的匹配文本内容,生成文本内容替换文件;统计所述文本内容替换文件的正确率,根据所述正确率确定目标正则 表达式;根据所述目标正则表达式,重新生成所述文本内容替换文件。
- 根据权利要求1所述的方法,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:获取所述文件的属性信息,根据预设规则匹配出与所述文件的属性信息对应的正则表达式。
- 根据权利要求1所述的方法,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式;获取所述预置格式对应的正则表达式。
- 一种信息处理装置,包括:格式化模块:用于获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;匹配模块:用于根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;确定模块:用于根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;替换模块:用于获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
- 一种存储有计算机可读指令的非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行一种信息处理方法,所述信息处理方法包括以下步骤:获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
- 根据权利要求8所述的非易失性存储介质,所述获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,所述方法还包括:获取所述待处理文本内容的原始文本格式,将所述匹配文本内容的文本格式设置为所述原始文本格式。
- 根据权利要求8所述的非易失性存储介质,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之后,还包括:将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件;接收对所述配置文件的正则表达式的修改,修改对应的匹配字符串,或,接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式。
- 根据权利要求8所述的非易失性存储介质,所述将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,还包括:根据替换后的匹配文本内容,生成文本内容替换文件;统计所述文本内容替换文件的正确率,根据所述正确率确定目标正则表达式;根据所述目标正则表达式,重新生成所述文本内容替换文件。
- 根据权利要求8所述的非易失性存储介质,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:获取所述文件的属性信息,根据预设规则匹配出与所述文件的属性信息对应的正则表达式。
- 根据权利要求8所述的非易失性存储介质,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式;获取所述预置格式对应的正则表达式。
- 一种终端设备,包括:一个或多个处理器;存储器;一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机程序配置用于执行一种信息处理方法,所述信息处理方法包括以下步骤:获取包含文本内容的文件,将所述文件的文本内容格式化为字符串数组;根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串;根据所述正则表达式对所述待处理字符串包含的字符进行替换,生成所述待处理字符串对应的匹配字符串,将所述匹配字符串进行逆格式化处理,确定所述匹配字符串对应的匹配文本内容;获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容。
- 根据权利要求14所述的终端设备,所述获取所述文件中所述待处理字符串对应的待处理文本内容,将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,所述方法还包括:获取所述待处理文本内容的原始文本格式,将所述匹配文本内容的文本格式设置为所述原始文本格式。
- 根据权利要求14所述的终端设备,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之后,还包括:将所述正则表达式、待处理字符串及匹配字符串关联保存至配置文件;接收对所述配置文件的正则表达式的修改,修改对应的匹配字符串,或,接收对所述配置文件的匹配字符串的修改,修改对应的正则表达式。
- 根据权利要求14所述的终端设备,所述将所述待处理文本内容替换为所述匹配字符串对应的匹配文本内容之后,还包括:根据替换后的匹配文本内容,生成文本内容替换文件;统计所述文本内容替换文件的正确率,根据所述正确率确定目标正则表达式;根据所述目标正则表达式,重新生成所述文本内容替换文件。
- 根据权利要求14所述的终端设备,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:获取所述文件的属性信息,根据预设规则匹配出与所述文件的属性信息对应的正则表达式。
- 根据权利要求14所述的终端设备,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转换为预置格式;获取所述预置格式对应的正则表达式。
- 根据权利要求14所述的终端设备,所述根据正则表达式对所述字符串数组进行筛选,获取所述字符串数组中满足所述正则表达式要求的待处理字符串之前,包括:判断所述文件的文件格式是否为预置格式,若否,将所述文件格式转 换为预置格式;获取所述预置格式对应的正则表达式。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910575551.3 | 2019-06-28 | ||
| CN201910575551.3A CN110427773A (zh) | 2019-06-28 | 2019-06-28 | 信息处理方法、装置、存储介质及终端设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020258492A1 true WO2020258492A1 (zh) | 2020-12-30 |
Family
ID=68409929
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/103028 Ceased WO2020258492A1 (zh) | 2019-06-28 | 2019-08-28 | 信息处理方法、装置、存储介质及终端设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110427773A (zh) |
| WO (1) | WO2020258492A1 (zh) |
Families Citing this family (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110941946A (zh) * | 2019-11-29 | 2020-03-31 | 西安四叶草信息技术有限公司 | 一种信息提取方法、装置、设备及存储介质 |
| CN111090671B (zh) * | 2019-12-19 | 2023-06-23 | 山大地纬软件股份有限公司 | 消除数据库中空字符串和无效字符串差异的方法和装置 |
| CN113111231B (zh) * | 2020-02-13 | 2024-09-06 | 北京明亿科技有限公司 | 基于正则表达式接处警文本人物信息要素提取方法和装置 |
| CN112183034A (zh) * | 2020-10-26 | 2021-01-05 | 阳光保险集团股份有限公司 | 语料合成方法、装置、电子设备和存储介质 |
| CN114697311B (zh) * | 2020-12-31 | 2024-09-13 | 中国移动通信有限公司研究院 | 文件处理方法、装置、设备及存储介质 |
| CN113378518B (zh) * | 2021-05-17 | 2024-06-11 | 广东广宇科技发展有限公司 | 基于正则表达式的json数据格式替换方法、系统及存储介质 |
| CN114331588A (zh) * | 2021-11-30 | 2022-04-12 | 广州品唯软件有限公司 | 数据修改方法及装置 |
| CN114398578B (zh) * | 2021-12-23 | 2024-11-29 | 网易有道信息技术(北京)有限公司 | 用于对html字符串进行预处理的方法及其相关产品 |
| CN114791879A (zh) * | 2022-04-13 | 2022-07-26 | 贝塔通科技(北京)有限公司 | 关键字筛查方法及数据处理方法 |
| CN114818667A (zh) * | 2022-04-14 | 2022-07-29 | 支付宝(杭州)信息技术有限公司 | 文本修正方法以及装置 |
| CN115061726A (zh) * | 2022-06-22 | 2022-09-16 | 中国工商银行股份有限公司 | 脚本文件批量处理方法、装置、设备、介质和程序产品 |
| CN116127101A (zh) * | 2022-07-05 | 2023-05-16 | 马上消费金融股份有限公司 | 文本检索方法、装置、电子设备及存储介质 |
| CN115291934A (zh) * | 2022-08-05 | 2022-11-04 | 合众新能源汽车有限公司 | 一种程序模块的配置方法及装置 |
| CN117852496A (zh) * | 2024-01-09 | 2024-04-09 | 镁佳(北京)科技有限公司 | 一种文本分割格式化方法及装置 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060265357A1 (en) * | 2005-04-26 | 2006-11-23 | Potts Matthew P | Method of efficiently parsing a file for a plurality of strings |
| CN105701074A (zh) * | 2016-01-04 | 2016-06-22 | 北京京东尚科信息技术有限公司 | 一种字符处理方法和装置 |
| CN107329957A (zh) * | 2017-05-18 | 2017-11-07 | 网易(杭州)网络有限公司 | 替换代码中文字符串的方法以及计算机可读存储介质 |
| CN109376547A (zh) * | 2018-09-29 | 2019-02-22 | 北京邮电大学 | 基于文件路径的信息防护方法和系统 |
| CN109829328A (zh) * | 2018-12-19 | 2019-05-31 | 上海晶赞融宣科技有限公司 | 数据脱敏、逆脱敏方法及装置、存储介质、终端 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012073794A (ja) * | 2010-09-28 | 2012-04-12 | Fujitsu Ltd | 文字列選択方法、文字列選択プログラム、および文字列選択装置 |
| CN103455307B (zh) * | 2012-05-29 | 2018-02-23 | 腾讯科技(深圳)有限公司 | 对命令行输出的信息进行处理的方法和装置 |
| CN109684469B (zh) * | 2018-12-13 | 2023-06-06 | 平安科技(深圳)有限公司 | 敏感词过滤方法、装置、计算机设备及存储介质 |
-
2019
- 2019-06-28 CN CN201910575551.3A patent/CN110427773A/zh active Pending
- 2019-08-28 WO PCT/CN2019/103028 patent/WO2020258492A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060265357A1 (en) * | 2005-04-26 | 2006-11-23 | Potts Matthew P | Method of efficiently parsing a file for a plurality of strings |
| CN105701074A (zh) * | 2016-01-04 | 2016-06-22 | 北京京东尚科信息技术有限公司 | 一种字符处理方法和装置 |
| CN107329957A (zh) * | 2017-05-18 | 2017-11-07 | 网易(杭州)网络有限公司 | 替换代码中文字符串的方法以及计算机可读存储介质 |
| CN109376547A (zh) * | 2018-09-29 | 2019-02-22 | 北京邮电大学 | 基于文件路径的信息防护方法和系统 |
| CN109829328A (zh) * | 2018-12-19 | 2019-05-31 | 上海晶赞融宣科技有限公司 | 数据脱敏、逆脱敏方法及装置、存储介质、终端 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110427773A (zh) | 2019-11-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020258492A1 (zh) | 信息处理方法、装置、存储介质及终端设备 | |
| JP7708828B2 (ja) | 異種にプログラムされたデータ処理システムの自動依存性アナライザ | |
| US11341116B2 (en) | Techniques for automated data analysis | |
| US10169471B2 (en) | Generating and executing query language statements from natural language | |
| WO2021017735A1 (zh) | 一种智能合约的形式化验证方法、电子装置及存储介质 | |
| KR20190076047A (ko) | 데이터 요소 간의 관계를 결정하기 위한 시스템 및 방법 | |
| CN113268500B (zh) | 业务处理方法、装置及电子设备 | |
| US9135591B1 (en) | Analysis and assessment of software library projects | |
| CN108762743A (zh) | 一种数据表操作代码生成方法及装置 | |
| WO2019200700A1 (zh) | 一种公文处理的方法、装置、终端设备及存储介质 | |
| US12339829B2 (en) | Dataset multiplexer for data processing system | |
| CN116126918A (zh) | 数据生成方法、信息筛选方法、设备以及介质 | |
| US20240086409A1 (en) | Techniques for pre-assignment validation of data managed by a data processing system | |
| CN116166634A (zh) | 数据血缘关系图构建方法、装置、存储介质及电子设备 | |
| US8745008B2 (en) | Propagating per-custodian preservation and collection requests between ediscovery management applications and content archives | |
| CN115391438A (zh) | 数据仓库配置文档的生成方法、装置、设备和存储介质 | |
| CN112799638B (zh) | 无侵入式快速开发方法、平台、终端及存储介质 | |
| Barton | Talend open studio cookbook | |
| WO2025093052A1 (zh) | 低代码转换方法、装置、可读存储介质及设备 | |
| US11244000B2 (en) | Information processing apparatus and non-transitory computer readable medium storing program for creating index for document retrieval | |
| US20080104016A1 (en) | Method and system for comparing data | |
| JP6870454B2 (ja) | 分析装置、分析プログラム及び分析方法 | |
| US11914557B2 (en) | Techniques for performing lifecycle operations on a data store | |
| KR102430880B1 (ko) | 도면 데이터 베이스 제공 방법 | |
| US11704094B2 (en) | Data integrity analysis tool |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19934839 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19934839 Country of ref document: EP Kind code of ref document: A1 |