A document content processing method and device, electronic equipment and storage medium

CN115269775BActive Publication Date: 2026-09-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210863736.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2026-09-04
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

[0005]本申请提供一种文档内容处理方法、装置、电子设备和存储介质,以至少解决相关技术中,仅能对一个文档中的一个词语进行替换,导致操作效率低下的问题

Benefits of technology

[0038] This application provides a document content processing method, apparatus, electronic device, and storage medium. Considering that the find-and-replace function in related technologies only supports detection on one file at a time and only supports searching for a single word, it cannot simultaneously handle content replacement for multiple files and multiple rules, resulting in excessive repetitive work. This application no longer limits itself to detecting only a single word in a single document, but utilizes a method of storing multiple documents in a variable to achieve batch processing of multiple documents. Then, based on multiple matching rules, it simultaneously performs fast batch find-and-replace on multiple words in multiple documents, shortening operation time and improving operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269775B_ABST
    Figure CN115269775B_ABST
Patent Text Reader

Abstract

The application relates to the field of information technology and software development, and particularly relates to a document content processing method and device, electronic equipment and a storage medium, which are used to solve the problem that the current find-replace function can only be used for one word in one document, resulting in low operation efficiency. The method comprises the following steps: storing file contents of at least one to-be-operated document in objects of preset variables respectively; determining to-be-processed contents related to a matching rule set from each object contained in the preset variables; and processing each to-be-operated document based on processing requirements for the to-be-processed contents to obtain corresponding target documents. The application can find and replace multiple words in multiple documents, shorten operation time and improve operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of information technology and software development, and in particular to a document content processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of computer technology, the Internet has become an indispensable part of people's lives. Web development, which is closely related to the Internet, has become increasingly important. During the development process, as project functions are constantly updated, new and old technologies are replaced, and performance requirements become increasingly stringent, it is necessary to migrate and refactor the technical framework to improve performance and modularity. Among these, the migration and refactoring of the technical framework involves replacing multiple syntax and semantics.

[0003] The find and replace function in related technologies only supports checking one file at a time and searching only for a single word. However, in business scenarios involving technology framework migration and restructuring, it is often necessary to perform replacement operations on multiple syntactic and semantic elements. When there are multiple documents that need to be replaced, each document must be searched and replaced separately. This results in a lot of repetitive work, greatly increasing working time and reducing work efficiency.

[0004] In summary, the current find and replace function can only operate on a single word in a single document, and cannot perform find and replace multiple words in multiple documents simultaneously. Summary of the Invention

[0005] This application provides a document content processing method, apparatus, electronic device, and storage medium to at least solve the problem in the related art that only one word in a document can be replaced, resulting in low operating efficiency.

[0006] This application provides a document content processing method, including:

[0007] Store the contents of at least one document to be operated on into a preset variable object, with each document to be operated on corresponding to one object;

[0008] From the objects contained in the preset variables, determine the content to be processed related to the matching rule set, wherein the matching rule set includes at least one matching rule;

[0009] Based on the processing requirements for the content to be processed, each document to be operated on is processed to obtain the corresponding target document.

[0010] This application provides a document content processing apparatus, comprising:

[0011] The document storage unit stores the file content of at least one document to be operated on into a preset variable object, with each document to be operated on corresponding to one object;

[0012] The determining unit determines, from the objects included in the preset variables, the content to be processed related to the matching rule set, wherein the matching rule set includes at least one matching rule;

[0013] The processing unit processes each document to be operated on based on the processing requirements for the content to be processed, and obtains the corresponding target document.

[0014] In some optional embodiments, each matching rule corresponds to a piece of content to be processed, the content to be processed including a string to be adjusted, and the determining unit is specifically used for:

[0015] For each object, perform the following operations:

[0016] For an object, based on each matching rule in the matching rule set, the string to be adjusted corresponding to each matching rule is cyclically detected from the object;

[0017] The processing unit is specifically used for:

[0018] Based on the processing requirements of each string to be adjusted, the corresponding strings in each object are processed to obtain the corresponding target document.

[0019] In some optional embodiments, after, for an object, cyclically detecting the string to be adjusted corresponding to each matching rule in the matching rule set from the object, the determining unit is further configured to:

[0020] The detected row and column position information of the string to be adjusted is stored in the position array corresponding to the object.

[0021] The processing unit is specifically used for:

[0022] Perform the following operations for each object:

[0023] For a given object, determine the string to be adjusted within that object based on the position array corresponding to that object;

[0024] Based on the processing requirements for the string to be adjusted, the corresponding string to be adjusted is processed to obtain the target document corresponding to the object.

[0025] In some optional embodiments, the content of the matching rule is determined based on the processing requirements of the content to be processed, and when the matching rule set includes multiple matching rules, the data format of the matching rule set is an array.

[0026] In some optional embodiments, the processing requirement includes at least one of a lookup requirement and a replacement requirement; the processing unit is specifically used for:

[0027] If the processing requirement is a search requirement, then the content to be processed is highlighted in each document to be processed to obtain the corresponding target document;

[0028] If the processing requirement is a replacement requirement, then the content to be processed in each document to be operated on will be replaced in batches with the corresponding target to be adjusted; the replaced documents to be operated on will be stored in a new variable to obtain the corresponding target document.

[0029] In some optional embodiments, the processing unit is specifically used for:

[0030] The new variable is converted into a downloadable document format, and the file content in the new variable is saved and the corresponding target document is generated based on the download requirements.

[0031] In some optional embodiments, each matching rule is determined by at least one of the following methods:

[0032] Determined based on the matching rules of the current input;

[0033] Selected from historically used matching rules.

[0034] An electronic device provided in this application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the above-described document content processing methods.

[0035] This application provides a computer-readable storage medium including a computer program. When the computer program is run on an electronic device, the computer program is used to cause the electronic device to perform the steps of any of the above-described document content processing methods.

[0036] This application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. When the processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any of the above-described document content processing methods.

[0037] The beneficial effects of this application are as follows:

[0038] This application provides a document content processing method, apparatus, electronic device, and storage medium. Considering that the find-and-replace function in related technologies only supports detection on one file at a time and only supports searching for a single word, it cannot simultaneously handle content replacement for multiple files and multiple rules, resulting in excessive repetitive work. This application no longer limits itself to detecting only a single word in a single document, but utilizes a method of storing multiple documents in a variable to achieve batch processing of multiple documents. Then, based on multiple matching rules, it simultaneously performs fast batch find-and-replace on multiple words in multiple documents, shortening operation time and improving operational efficiency.

[0039] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0040] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0041] Figure 1 This is a schematic diagram illustrating an application scenario of a document content processing method provided in an embodiment of this application.

[0042] Figure 2 A flowchart illustrating an overall document content processing method provided in this application embodiment;

[0043] Figure 3 A logical diagram for obtaining a target document provided in an embodiment of this application;

[0044] Figure 4 An architecture diagram for document content replacement provided in this application embodiment;

[0045] Figure 5 This application provides an overall flowchart for searching and replacing document content to obtain a target document.

[0046] Figure 6 A schematic diagram of the composition structure of a document content processing device provided in an embodiment of this application;

[0047] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0048] Figure 8This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.

[0050] The following describes some of the concepts involved in the embodiments of this application.

[0051] Variable: A storage space where various data can be stored. In this application, the content of all files in the document to be processed is stored in a pre-defined variable; after all the content in the document has been replaced, the processed file content is stored in a new variable.

[0052] Content to be processed: This includes strings to be adjusted, which are the contents in each document to be searched and / or replaced. In this embodiment, a piece of content to be processed can be a single character, a word, a string, etc.

[0053] Target to be adjusted: Replacement words for each piece of content to be processed. For example, if the content to be processed in a document is X, and the corresponding target to be adjusted is Y, then X needs to be replaced with Y.

[0054] Matching rule set: The matching rule set contains one or more matching rules. These rules reflect the content to be processed in each document and can also reflect the adjustment targets for replacing this content. The matching rules in this application include, but are not limited to, plain text-based matching rules and regular expression matching rules. When there are multiple matching rules, the data format of the matching rule set can be an array.

[0055] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.

[0056] like Figure 1 The diagram shown is an application scenario illustration of an embodiment of this application. The application scenario diagram includes a terminal device 110 and a server 120.

[0057] In this application embodiment, the terminal device 110 includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, cameras, camcorders, smart home appliances, vehicle terminals, and other devices. The terminal device may have a related client installed, which can be software (such as document editing software, office software, etc.), or a webpage, mini-program, etc. The server 120 is the backend server corresponding to the software, webpage, mini-program, etc., or a server specifically used for document content replacement; this application does not impose specific limitations. The server 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0058] It should be noted that the document content replacement methods in the various embodiments of this application can be executed by an electronic device, such as... Figure 1 As shown, the electronic device can be a terminal device 110 or a server 120. That is, the method can be executed by the terminal device 110 or the server 120 alone, or by the terminal device 110 and the server 120 together.

[0059] Taking server 120 as an example, in a technical framework reconstruction scenario, it may be necessary to replace a large amount of syntax and semantics in multiple documents containing interface templates. Server 120 stores the file content of multiple documents into multiple objects of a preset variable, with each document corresponding to one object. Then, server 120 determines each matching rule in the matching rule set, identifies the relevant content to be processed based on the matching rules, and detects each object. The content to be processed includes strings to be adjusted. Server 120 stores the position information of the detected strings to be adjusted into a position array corresponding to an object, and determines the strings to be adjusted within an object based on the position array corresponding to an object. Finally, server 120 processes each document according to the processing requirements of the content to be processed, obtains the corresponding target document, and sends it to terminal device 110 to realize the reconstruction of the interface template.

[0060] In one alternative implementation, the terminal device 110 and the server 120 can communicate via a communication network.

[0061] In one alternative implementation, the communication network is a wired network or a wireless network.

[0062] It should be noted that, Figure 1The examples shown are merely illustrative; in reality, the number of terminal devices and servers is unlimited and is not specifically limited in the embodiments of this application.

[0063] Furthermore, the embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, and smart transportation.

[0064] The document content processing method provided by the exemplary embodiments of this application will be described below with reference to the accompanying drawings and the application scenarios described above. It should be noted that the application scenarios described above are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.

[0065] See Figure 2 This is a flowchart illustrating the implementation of a document content processing method provided in this application. Taking the server executing the method alone as an example, the specific implementation process of this method is as follows: S201-S203:

[0066] S201: Store the contents of at least one document to be operated on into a predefined variable object.

[0067] Among them, the documents to be operated on are the documents that need to be searched or replaced, and there can be one or more of them.

[0068] The server reads the contents of all currently uploaded documents and stores them in a pre-defined variable (such as currentFiles). The terminal device can then display these documents layered on top of each other in the user interface. If the server fails to read the file content due to file format issues, password protection, or file corruption, it can notify the user of the problem via showInformationMessage(info).

[0069] It should be noted that the above-mentioned display methods of multiple documents on the operation interface and the methods of issuing reminders to the operator are only illustrative examples. Any method that can display multiple documents on the operation interface and inform the operator of file problems is applicable to the embodiments of this application and is not specifically limited here.

[0070] Suppose we have three documents, A, B, and C, to be processed, with contents X1, X2, and X3 to be processed. X1 and X2 correspond to the adjustment targets Y1 and Y2, respectively. Document A contains X1, X2, and X3; document B contains X1 and X2; and document C contains X2 and X3. There is a document selection control that allows simultaneous processing of one or more documents. The server stores A, B, and C in the `currentFiles` array variable.

[0071] S202: Determine the content to be processed related to the set of matching rules from the various objects contained in the preset variables.

[0072] The content to be processed includes strings to be adjusted, which are the contents in each document that need to be searched or replaced. In addition, the content to be processed can also be a single character, a word, etc. The matching rule set contains one or more matching rules, including but not limited to plain text matching rules, regular expression matching, etc., which reflect the content to be processed in each document to be operated on, and can also reflect the replacement words to replace these contents to be processed, i.e., the targets to be adjusted.

[0073] For example: Rules: [{type: 'text', find: 'content to be processed', to: 'target to be adjusted'}, {type: 'reg', find: 'content to be processed', to: 'target to be adjusted'}]. Here, `type` indicates the type of the matching rule. If the type is `text`, it means this is a plain text matching rule; if the type is `reg`, it means this is a regular expression matching rule. When there are multiple matching rules, the data format of the matching rule set is an array.

[0074] Each matching rule can be determined based on the currently input matching rule, or it can be selected from historically used matching rules. Adding, modifying, and deleting matching rules is also supported.

[0075] Specifically, based on each matching rule in the predetermined set of matching rules, the server iteratively detects the string to be adjusted and other content to be processed corresponding to each matching rule in each object of the preset variables, and stores the row position information and column position information of the detected string to be adjusted and other content to be processed into the position array corresponding to each object.

[0076] Taking the assumption in S201 as an example, suppose the operator chooses to process three documents A, B, and C simultaneously. X1 is a string, corresponding to regular expression matching, while X2 and X3 are plain text matching. After the operator inputs all the matching rules, the server calls different detection functions based on each matching rule, and iteratively checks whether the string to be adjusted X1 and other content to be processed X2 and X3 exist in each object of the currentFiles array variable. The server then stores the row position information and column position information of the detected X1, X2, and X3 into the position array pos corresponding to each object.

[0077] Furthermore, a control can be provided so that, after the operator triggers the control, the server begins to examine each object in the currentFiles array variable.

[0078] After determining the location of each piece of content to be processed, the server needs to perform the following steps:

[0079] S203: Based on the processing requirements for the content to be processed, process each document to be processed to obtain the corresponding target document.

[0080] Specifically, the server determines the content to be processed in each object based on the position information in the position array corresponding to each object; and processes the corresponding content to be processed based on the processing requirements for the content to be processed, which include at least one of search requirements and replacement requirements.

[0081] After the operator inputs all the matching rules, the server can automatically determine whether the processing requirement for each piece of content to be processed is a search requirement or a replacement requirement based on the format of the matching rules, and process them in a unified and parallel manner.

[0082] Optionally, a search text input box can also be provided, where the operator can enter the content to be searched. The server will highlight the content to be processed in the text box and automatically replace it according to the matching rules entered by the operator.

[0083] In addition, a find and replace control can be provided. After the operator triggers the corresponding control, the server will process it. For example, after the operator enters the matching rules, he / she can directly click the replace control. The server will start to detect the content to be processed and directly replace the detected strings to be adjusted and other content to be processed. Finally, the interface will display the document before and after the replacement for the operator to view and compare.

[0084] Taking a string to be adjusted as an example, if the processing requirement for a certain string is a search, the server highlights the string in each document to be processed. Specifically, a CSS class named `match` can be defined for the string to be adjusted, which includes the `background-color: #f0f` property to highlight the string. Then, the server records and displays the number of times the string to be adjusted is found in each document. If no string to be adjusted is detected, it displays that 0 strings were found.

[0085] It should be noted that the methods for highlighting the strings to be adjusted listed above are only illustrative examples. Any method that can achieve highlighting is applicable to the embodiments of this application and is not specifically limited here.

[0086] If the processing requirement for a certain string to be adjusted is a replacement requirement, the server will replace the string to be adjusted in each document with the corresponding target string according to the matching rules corresponding to the string to be adjusted, and store the replaced document in a new variable. The content of the document before and after the replacement can be displayed on the interface for the operator to view and compare.

[0087] In this embodiment of the application, after completing the detection and processing of the content to be processed corresponding to all matching rules, the resulting new document is the target document.

[0088] In addition, a download control can be provided, which the user can trigger to download and save the target document. Specifically, after the user triggers the download control, the server converts the new variable into a downloadable document format, thus enabling the download of the target document.

[0089] Taking the assumption in S201 as an example, X1 and X2 correspond to replacement processing, with X1 being a regular expression match and X2 being a plain text match. X3 corresponds to search processing and is also a plain text match. Figure 3 The diagram shown illustrates a logical process for obtaining a target document under this assumption, according to an embodiment of this application. For plain text X3, the server highlights X3 in documents A and C, assuming the highlighting method is bolding and adding an underline, and calculates the number of X3s displayed in documents A, B, and C. For X1 and X2, the server replaces the string X1 in documents A and B with Y1 based on the matching rules of string X1 and the position information of string X1. Similarly, the server replaces X2 in documents A, B, and C with Y2 based on the matching rules of plain text X2 and the position information of plain text X2.

[0090] After the replacement, the server assigns all the replaced document content to the fileReplaced variable and displays the document content before and after the replacement on the interface for the operator to view and compare. At this point, the document for which the find and replace process for X1, X2, and X3 has been completed is the target document.

[0091] After the user triggers the download control, the server converts the fileReplaced variable into a blob data type structure that supports downloading, and assigns a value to the href attribute of the download control, setting a.href = blob, which will download and save the target document.

[0092] In addition, this application also provides a historical record query list. The server records each operation and matching rule of the operator and supports one-click reuse, which can quickly realize the use of the same batch of rules to process different files.

[0093] Based on the above process, assuming there are m documents to be processed, and n pieces of content to be processed within these documents need to be searched and replaced, with each of the n pieces of content corresponding to a matching rule. For example... Figure 4 The diagram shown is an architecture diagram of document content replacement provided by an embodiment of this application in this scenario. The server performs search and replacement on m documents to be processed based on n matching rules in the matching rule set. After all search and replacement is completed, the server outputs the target document after all processing is completed, records the operator's historical operations, and saves all matching rules in the matching rule set to the historical matching rule library. When other documents to be processed need to be processed later, the previously used matching rules can be selected from the historical matching rule library.

[0094] Similarly, such as Figure 5 The diagram shows the overall process of finding and replacing document content to obtain the target document in this scenario.

[0095] Step 501: Read the file content of all documents to be operated on. If the reading is successful, proceed to step 502. If the reading fails, proceed to step 503.

[0096] After the operator uploads all the documents to be processed, the server reads the document content to determine if there are any documents that cannot be read or opened, such as documents with incorrect format, documents that are corrupted, or documents that are password protected.

[0097] Step 502: Store the contents of all documents to be operated on into the respective objects of the preset variables.

[0098] After a document is successfully read, the server stores the entire content of the document to be processed into various objects within a pre-defined set of variables. Each object corresponds to a document to be processed.

[0099] Step 503: The operator is prompted that the file upload failed.

[0100] If a document has a problem that causes the server to fail to read it, the server will display a prompt reminding the user that the file has a problem and needs to be re-uploaded.

[0101] Step 504: The operator inputs the matching rules.

[0102] Operators can input one or more matching rules according to processing needs. Matching rules can be added, modified, and deleted.

[0103] Step 505: Display the historical operation list.

[0104] Step 506: Trigger the use of historical matching rules.

[0105] Users can also directly select matching rules from the history rules for one-click reuse. Matching rules selected directly from the history rules can also be added, modified, and deleted.

[0106] Step 507: Determine each matching rule in the set of matching rules.

[0107] Step 508: Determine the content to be processed in each document to be operated on, and store the location information of each content to be processed into a location array.

[0108] The content to be processed includes strings to be adjusted, and may also include words, single characters, etc. The server calls different detection functions based on various matching rules, and iteratively checks whether each piece of content to be processed exists in each object of the preset variables. The row position information and column position information of the detected content to be processed are stored in the position array corresponding to each object.

[0109] Step 509: Highlight the pending content for the corresponding search and processing based on location information, and record the number of pending content items displayed.

[0110] For content to be processed with the requirement of finding the target, the server determines the content to be processed based on the position information in the position array and highlights it. Assuming that the highlighting method is highlighting, the server defines a CSS class named match for the content to be processed, which contains a background color property.

[0111] Step 510: Replace the content to be processed with the target to be adjusted, store the replaced document in a new variable, and display the document before and after the replacement on the interface.

[0112] For content to be processed that requires a search, the server determines the content to be processed based on the position information in the position array, and replaces the content with the target to be adjusted according to the corresponding matching rules. After the replacement is completed, the server stores the replaced document content in a new variable and sends it to the terminal. The terminal can display the document before and after the replacement on the interface for the operator to view and compare.

[0113] Step 511: Obtain the target document.

[0114] After all processing is complete, the target document is obtained.

[0115] Based on the above description, this application can efficiently complete the search and replace in various application scenarios. For example, when migrating a technology framework, a large amount of syntax and semantics needs to be replaced: a project built using Angular needs to be refactored using Vue, ng-if needs to be replaced with v-if, ng-for needs to be replaced with v-for, etc. Related technologies can only search and replace one of angular, ng-if, ng-for, etc. in a single document, and it takes a lot of time to complete all the processing. However, this application can simultaneously replace multiple contents such as angular, ng-if, and ng-for in multiple documents to be processed based on a set of matching rules, thereby improving the efficiency of operation.

[0116] Based on the same inventive concept, embodiments of this application also provide a document content processing apparatus. For example... Figure 6 As shown, this is a structural schematic diagram of a document content processing device 600, which may include:

[0117] The document storage unit 601 stores the file content of at least one document to be operated on into an object of preset variables, with each document to be operated on corresponding to one object;

[0118] The determining unit 602 determines the content to be processed related to the matching rule set from the various objects contained in the preset variables. The matching rule set includes at least one matching rule.

[0119] The processing unit 603 processes each document to be processed based on the processing requirements of the content to be processed, and obtains the corresponding target document.

[0120] In some optional embodiments, each matching rule corresponds to a content to be processed, which includes a string to be adjusted. The determining unit 602 is specifically used for:

[0121] For each object, perform the following operations:

[0122] For a given object, based on each matching rule in the matching rule set, the string to be adjusted is checked in a loop within the object according to each matching rule;

[0123] Processing unit 603 is specifically used for:

[0124] Based on the individual processing requirements of each string to be adjusted, the corresponding strings in each object are processed to obtain the corresponding target document.

[0125] In some optional embodiments, after, for an object, iteratively detecting the string to be adjusted corresponding to each matching rule in the matching rule set, the determining unit 602 is further configured to:

[0126] The detected row and column position information of the string to be adjusted is stored in a position array corresponding to an object;

[0127] Processing unit 603 is specifically used for:

[0128] Perform the following operations for each object:

[0129] For a given object, determine the string to be adjusted within that object based on an array of positions corresponding to that object;

[0130] Based on the processing requirements of the string to be adjusted, the corresponding string to be adjusted is processed to obtain the target document corresponding to an object.

[0131] In some optional embodiments, the content of the matching rules is determined based on the processing requirements of the content to be processed, and when the matching rule set includes multiple matching rules, the data format of the matching rule set is an array.

[0132] In some optional embodiments, the processing requirement includes at least one of a lookup requirement and a replacement requirement; the processing unit 603 is specifically used for:

[0133] If the processing requirement is a search requirement, then the content to be processed will be highlighted in each document to be processed, and the corresponding target document will be obtained;

[0134] If the processing requirement is a replacement requirement, then the content to be processed in each document to be operated on will be replaced in batches with the corresponding target to be adjusted; the replaced documents to be operated on will be stored in a new variable to obtain the corresponding target documents.

[0135] In some optional embodiments, the processing unit 603 is specifically used for:

[0136] The new variable is converted into a downloadable document format, and the file content in the new variable is saved and the corresponding target document is generated based on the download requirements.

[0137] In some optional embodiments, each matching rule is determined by at least one of the following methods:

[0138] Determined based on the matching rules of the current input;

[0139] Selected from historically used matching rules.

[0140] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. In one embodiment, the electronic device may be a server, such as... Figure 1 The server 120 is shown. In this embodiment, the structure of the electronic device can be as follows: Figure 7As shown, it includes a memory 701, a communication module 703, and one or more processors 702.

[0141] The memory 701 is used to store computer programs executed by the processor 702. The memory 701 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0142] Memory 701 may be volatile memory, such as random-access memory (RAM); memory 701 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 701 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 701 may be a combination of the above-described memories.

[0143] The processor 702 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 702 is used to implement the above-described document content processing method when it calls a computer program stored in the memory 701.

[0144] The communication module 703 is used to communicate with terminal devices and other servers.

[0145] This application embodiment does not limit the specific connection medium between the memory 701, communication module 703, and processor 702 described above. This application embodiment... Figure 7 The memory 701 and the processor 702 are connected via a bus 704, and the bus 704 is in Figure 7 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 7 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.

[0146] The memory 701 stores a computer storage medium, which stores computer-executable instructions for implementing the document content processing method of this application embodiment. The processor 702 is used to execute the above-described document content processing method, such as... Figure 2 As shown.

[0147] In another embodiment, the electronic device may also be other electronic devices, such as... Figure 1 The terminal device 110 is shown. In this embodiment, the electronic device can be structured as follows: Figure 8 As shown, it includes components such as a communication component 810, a memory 820, a display unit 830, a camera 840, a sensor 850, an audio circuit 860, a Bluetooth module 870, and a processor 880.

[0148] The communication component 810 is used to communicate with the server. In some embodiments, it may include a Wireless Fidelity (WiFi) module, which is a short-range wireless transmission technology. Electronic devices can use the WiFi module to help users send and receive information.

[0149] The memory 820 can be used to store software programs and data. The processor 880 executes various functions of the terminal device 110 and performs data processing by running the software programs or data stored in the memory 820. The memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The memory 820 stores an operating system that enables the terminal device 110 to run. In this application, the memory 820 may store the operating system and various application programs, and may also store computer programs that execute the document content processing method of the embodiments of this application.

[0150] The display unit 830 can also be used to display information input by the user or information provided to the user, as well as various menus of the terminal device 110, in a graphical user interface (GUI). Specifically, the display unit 830 may include a display screen 832 disposed on the front of the terminal device 110. The display screen 832 may be configured as a liquid crystal display, a light-emitting diode, or the like.

[0151] The display unit 830 can also be used to receive input digital or character information and generate signal inputs related to user settings and function control of the terminal device 110. Specifically, the display unit 830 may include a touch screen 831 disposed on the front of the terminal device 110, which can collect touch operations of the user on or near it, such as clicking buttons, dragging scroll boxes, etc.

[0152] The touchscreen 831 can be placed on top of the display screen 832, or the touchscreen 831 and the display screen 832 can be integrated to realize the input and output functions of the terminal device 110. After integration, it can be referred to as a touch display screen. In this application, the display unit 830 can display the application and the corresponding operation steps.

[0153] Camera 840 can be used to capture still images, which users can then share via an application. There can be one or multiple cameras 840. An object is projected onto a photosensitive element through a lens, generating an optical image. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to a processor 880 to be converted into a digital image signal.

[0154] The terminal device may also include at least one sensor 850, such as an accelerometer 851, a proximity sensor 852, a fingerprint sensor 853, and a temperature sensor 854. The terminal device may also be equipped with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, and motion sensor.

[0155] Audio circuitry 860, speaker 861, and microphone 862 provide an audio interface between the user and terminal device 110. Audio circuitry 860 converts received audio data into electrical signals, which are then transmitted to speaker 861, where they are converted into sound signals for output. Terminal device 110 may also be equipped with volume buttons for adjusting the volume of the sound signal. On the other hand, microphone 862 converts collected sound signals into electrical signals, which are received by audio circuitry 860, converted into audio data, and then output to communication component 810 for transmission to, for example, another terminal device 110, or to memory 820 for further processing.

[0156] The Bluetooth module 870 is used to interact with other Bluetooth devices that also have a Bluetooth module via the Bluetooth protocol. For example, a terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smartwatch) that also has a Bluetooth module through the Bluetooth module 870, thereby exchanging data.

[0157] The processor 880 is the control center of the terminal device, connecting various parts of the terminal through various interfaces and lines. It executes software programs stored in the memory 820 and calls data stored in the memory 820 to perform various functions and process data. In some embodiments, the processor 880 may include one or more processing units; the processor 880 may also integrate an application processor and a baseband processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the baseband processor mainly handles wireless communication. It is understood that the baseband processor may not be integrated into the processor 880. In this application, the processor 880 can run the operating system, applications, user interface display and touch response, and the document content processing method of the embodiments of this application. Furthermore, the processor 880 is coupled to the display unit 830.

[0158] In some possible implementations, various aspects of the document content processing method provided in this application can also be implemented as a program product, which includes a computer program. When the program product is run on an electronic device, the computer program causes the electronic device to perform the steps of the document content processing method according to the various exemplary embodiments of this application described above. For example, the electronic device can perform actions such as... Figure 2 The steps are shown in the figure.

[0159] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0160] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0161] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0162] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0164] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A document content processing method, characterized in that, The method includes: Store the contents of at least one document to be operated on into a preset variable object, with each document to be operated on corresponding to one object; For each object, perform the following operations: For each object, based on each matching rule in the matching rule set, iteratively detect the string to be adjusted corresponding to each matching rule in the object; store the row position information and column position information of the detected string to be adjusted into the position array corresponding to the object; each matching rule corresponds to a content to be processed; the content to be processed includes the string to be adjusted; each matching rule is determined by at least one of the currently input matching rule and the historically used matching rules; For each object, perform the following operations: For an object, determine the string to be adjusted in the object based on the position array corresponding to the object; Based on the processing requirements for the string to be adjusted, process the corresponding string to be adjusted to obtain the target document corresponding to the object; A content to be processed is a single character, a word, or a string, and the processing requirements include at least one of search requirements and replacement requirements; Record the operator's historical operations and save each matching rule in the matching rule set to the historical matching rule library so that when other documents to be processed need to be processed later, the previously used matching rules can be selected from the historical matching rule library.

2. The method as described in claim 1, characterized in that, The content of the matching rule is determined based on the processing requirements of the content to be processed. When the matching rule set includes multiple matching rules, the data format of the matching rule set is an array.

3. The method as described in claim 2, characterized in that, Based on the processing requirements for the content to be processed, each document to be operated on is processed to obtain a corresponding target document, including: If the processing requirement is a search requirement, then the content to be processed is highlighted in each document to be processed to obtain the corresponding target document; If the processing requirement is a replacement requirement, then the content to be processed in each document to be operated on will be replaced in batches with the corresponding target to be adjusted; the replaced documents to be operated on will be stored in a new variable to obtain the corresponding target document.

4. The method as described in claim 3, characterized in that, The step of storing the replaced document into a new variable to obtain the corresponding target document includes: The new variable is converted into a downloadable document format, and the file content in the new variable is saved and the corresponding target document is generated based on the download requirements.

5. A document content processing device, characterized in that, include: The document storage unit stores the file content of at least one document to be operated on into a preset variable object, with each document to be operated on corresponding to one object; For each object, the following operations are performed: For an object, based on each matching rule in the matching rule set, the string to be adjusted corresponding to each matching rule is detected cyclically from the object; the row position information and column position information of the detected string to be adjusted are stored in the position array corresponding to the object; each matching rule corresponds to one content to be processed. The content to be processed includes the string to be adjusted; each matching rule is determined by at least one of the currently input matching rule and the historically used matching rules; The processing unit performs the following operations for each object: For an object, based on the position array corresponding to the object, determines the string to be adjusted in the object; based on the processing requirements for the string to be adjusted, processes the corresponding string to be adjusted to obtain the target document corresponding to the object; a content to be processed is a single character, a word, or a string, and the processing requirements include at least one of search requirements and replacement requirements; records the operator's historical operations, and saves each matching rule in the matching rule set to the historical matching rule library so that when other documents to be processed need to be processed later, the previously used matching rules can be selected from the historical matching rule library.

6. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of any of the methods described in claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Includes a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of any of the methods described in claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for realizing bulk editing of file contents

    CN102012896A

  • Batch modification method and batch modification apparatus for file contents

    CN106933967A