A method, device and electronic device for processing official document elements in official document template

By capturing and deleting and restoring operations in official document templates, using preset hidden characters and feature content databases, efficient processing of official document elements is achieved, and the problem of low efficiency in official document processing in the existing technology is solved, ensuring the improvement of location accuracy and efficiency.

CN113743070BActive Publication Date: 2025-05-13ZHUHAI KINGSOFT OFFICE SOFTWARE +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010474710.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-29
Publication Date
2025-05-13
Estimated Expiration
2040-05-29

AI Technical Summary

Technical Problem

When writing official documents, users need to frequently process official documents elements, such as copy number, confidentiality level, confidentiality period, etc. In the prior art, official documents can only be inserted into the location where the cursor is located in the document, resulting in time-consuming position adjustment and reducing processing efficiency.

Method used

Provide a method for handling official document elements in official document templates. Through capturing, deletion and recovery operations, the display content of the elements in the target official document template is replaced with preset hidden characters, and the feature content is determined from the preset feature content database, and the hidden characters are replaced according to the location to realize the re-adding of features.

Benefits of technology

It improves the efficiency of document processing, reduces the time wasted due to position adjustment, and ensures that the location of official document elements meets the national standard requirements without manual adjustment by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113743070B_ABST
    Figure CN113743070B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device and electronic device for processing official document elements in an official document template, the method comprising: when capturing a deletion operation for a first target element in a target official document template, replacing the display content corresponding to the first target element in the target official document template with preset hidden characters; when capturing a recovery operation for the first target element, determining the content corresponding to the first target element from a preset element content database as the target element content, wherein the element content database includes the correspondence between each official document element and the content; determining the display position of the first target element in the target official document template according to the position of each official document element; replacing the preset hidden characters located at the display position with the target element content. The scheme provided by the embodiment of the present invention can improve the efficiency of processing official documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic document processing, and in particular to a method, device and electronic equipment for processing official document elements in an official document template. Background Art

[0002] In daily work, study and life, users often need to edit documents through document editing software in electronic devices. When users write official documents, they often need to process the document elements such as the copy number, confidentiality level, confidentiality period, urgency, issuing agency logo, urgency, etc. Among them, official documents are official documents. Official documents are written materials formed and used by statutory agencies and organizations in official activities in a specific format and through a certain processing procedure.

[0003] At present, when users write official documents, they can create official document templates through pre-set official document parts. Specifically, when a user wants to add a certain official document part, the user can select the desired target official document part from multiple preset official document parts, and then insert the target official document part at the location of the cursor in the document; when a user wants to delete a certain official document part, the user can select the official document part to delete. Among them, the official document part includes at least one official document element. For example, when the official document part is a version, the official document elements included in the official document part can be the main sending agency, the copy sending agency, the issuing agency and the issuing date.

[0004] When the user wants to re-add a deleted document part, he can only re-select the target document part from the preset multiple document parts, and then insert the target document part at the position of the cursor in the document. Since the document part can only be inserted at the position of the cursor in the document, when the position of the cursor does not meet the national standard requirements for the position of document elements in the document part, the user also needs to adjust the position of the target document part, which will consume a lot of time and result in low efficiency in processing the document. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a method, device and electronic device for processing official document elements in an official document template to improve the efficiency of processing official documents. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a method for processing document elements in a document template, the method comprising:

[0007] When capturing a deletion operation on a first target element in a target document template, replacing the displayed content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template conform to the requirements of the national standard;

[0008] When capturing the recovery operation for the first target element, determining the content corresponding to the first target element from a preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content;

[0009] Determining a display position of the first target element in the target document template according to the positions of the document elements;

[0010] The preset hidden character located at the display position is replaced with the target element content.

[0011] Optionally, after the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters when capturing the deletion operation on the first target element in the target document template, the method further includes:

[0012] If there are no other official document elements in the row where the displayed content is located, the row height of the row where the displayed content is located is adjusted to 0.

[0013] Optionally, the element content database also includes the line height corresponding to each official document element;

[0014] Before the step of replacing the preset hidden character located at the display position with the target element content, the method further includes:

[0015] Determine whether the row height of the row corresponding to the display position is 0;

[0016] If not, performing the step of replacing the preset hidden character located at the display position with the target element content;

[0017] If yes, the row height of the row corresponding to the display position is adjusted from 0 to the row height corresponding to the first target element, and the step of replacing the preset hidden character located at the display position with the target element content is performed.

[0018] Optionally, before the step of replacing the displayed content corresponding to the first target element in the document template with preset hidden characters when capturing the deletion operation on the first target element in the document template, the method further includes:

[0019] When capturing the document template selection operation, a target document template is determined from a plurality of pre-generated document templates.

[0020] Optionally, the document template is generated by:

[0021] Add all types of official document elements to the preset initial template corresponding to each type of official document, wherein the position and content of each type of official document element conform to the requirements of the national standard;

[0022] Each type of official document element and its corresponding content are saved in correspondence to obtain an element content database;

[0023] According to the national standard requirements, determining the second target element in each of the preset initial templates, wherein the second target element is the document element in the preset initial template that does not meet the national standard requirements;

[0024] The displayed content of each of the second target elements in the corresponding preset initial template is replaced with preset hidden characters to obtain the official document template.

[0025] Optionally, after the step of replacing the display content of each second target element in the corresponding preset initial template with preset hidden characters, the method further includes:

[0026] If there are no other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located, the row height of the row is adjusted to 0.

[0027] Optionally, before the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters, the method further includes:

[0028] Determining whether the first target element can be deleted according to the first target element and the pre-set add / delete tags of each document element, wherein the add / delete tags are used to identify the corresponding document element as a deletable and restorable element;

[0029] If yes, execute the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters.

[0030] In a second aspect, an embodiment of the present invention provides a device for processing document elements in a document template, the device comprising:

[0031] A deletion module, used for replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters when capturing a deletion operation for the first target element in the target document template, wherein the position and content of each document element included in the target document template meet the requirements of the national standard;

[0032] a content determination module, configured to determine, when capturing a recovery operation for the first target element, the content corresponding to the first target element from a preset element content database as the target element content, wherein the element content database includes a correspondence between each document element and the content;

[0033] A position determination module, used for determining a display position of the first target element in the target document template according to the positions of the document elements;

[0034] A replacement module is used to replace the preset hidden characters located at the display position with the target element content.

[0035] Optionally, the device module further includes:

[0036] The first line height adjustment module is used to, when capturing a deletion operation on the first target element in the target document template, replace the display content corresponding to the first target element in the target document template with preset hidden characters, and if there are no other document elements in the line where the display content is located, adjust the line height of the line where the display content is located to 0.

[0037] Optionally, the element content database also includes the line height corresponding to each official document element;

[0038] The device also includes:

[0039] A judgment module, used for judging whether the row height of the row corresponding to the display position is 0 before replacing the preset hidden character at the display position with the target element content;

[0040] A first execution module, configured to, if not, execute the step of replacing the preset hidden character located at the display position with the target element content;

[0041] The second row height adjustment module is used to adjust the row height of the row corresponding to the display position from 0 to the row height corresponding to the first target element, and replace the preset hidden characters located at the display position with the target element content.

[0042] Optionally, the device further comprises:

[0043] A template determination module is used to, when capturing a deletion operation on a first target element in a document template, replace the display content corresponding to the first target element in the document template with preset hidden characters before, when capturing a document template selection operation, determine a target document template from multiple document templates pre-generated by a template generation module.

[0044] Optionally, the template generation module includes:

[0045] The element adding submodule is used to add all types of official document elements to the preset initial template corresponding to each type of official document, wherein the position and content of each type of official document element conform to the national standard requirements;

[0046] The database generation submodule is used to store each type of official document element and its corresponding content in correspondence to obtain an element content database;

[0047] A second target element determination submodule, for determining a second target element in each of the preset initial templates according to the national standard requirements, wherein the second target element is an official document element in the preset initial template that does not meet the national standard requirements;

[0048] The replacement submodule is used to replace the display content of each of the second target elements in the corresponding preset initial template with preset hidden characters to obtain the official document template.

[0049] Optionally, the template generation module further includes:

[0050] A line height adjustment submodule is used to adjust the line height of each second target element in the corresponding preset initial template to 0 after replacing the display content of the second target element in the corresponding preset initial template with preset hidden characters, if there are no other official document elements in the line where the display content of the second target element in the corresponding preset initial template is located.

[0051] Optionally, the device further comprises:

[0052] a determination module, used for determining whether the first target element can be deleted according to the first target element and the pre-set add / delete tags of each document element before replacing the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the add / delete tag is used to identify the corresponding document element as a deletable and restorable element;

[0053] The second execution module is used to execute the replacement of the displayed content corresponding to the first target element in the target document template with preset hidden characters if yes.

[0054] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0055] Memory, used to store computer programs;

[0056] The processor is used to implement the steps of the method for processing the official document elements in any of the official document templates described above when executing the program stored in the memory.

[0057] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing document elements in any of the above-mentioned document templates are implemented.

[0058] In the scheme provided by the embodiment of the present invention, when capturing the deletion operation on the first target element in the target document template, the electronic device can replace the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template meet the requirements of the national standard; when capturing the recovery operation on the first target element, the content corresponding to the first target element is determined from a preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden character located at the display position is replaced with the target element content. The position of each document element in the target document template is preset and meets the requirements of the national standard, and the content of each document element is stored in the element content database. When a deleted document element needs to be added again, the electronic device can determine the target element content from the element content database, and then replace the preset hidden character located at the display position with the target element content, so that the position of the first target element added again meets the requirements of the national standard, and there is no need to adjust the position of the first target element, which can improve the efficiency of users in processing official documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 A flowchart of a method for processing official document elements in an official document template provided by an embodiment of the present invention;

[0061] Figure 2(a) shows Figure 1 A first schematic diagram of a target document template in the illustrated embodiment;

[0062] Figure 2(b) shows Figure 1 Another schematic diagram of the target document template in the illustrated embodiment;

[0063] Figure 3 for Figure 1 A schematic diagram of an element processing page in the illustrated embodiment;

[0064] Figure 4(a) shows Figure 1 Another schematic diagram of the target document template in the illustrated embodiment;

[0065] Figure 4(b) shows Figure 1 Another schematic diagram of the target document template in the illustrated embodiment;

[0066] Figure 5 for Figure 1 A flow chart of a method for generating a document template in the illustrated embodiment;

[0067] Figure 6 A schematic diagram of the structure of a device for processing official document elements in an official document template provided by an embodiment of the present invention;

[0068] Figure 7 Based on Figure 6 A schematic diagram of the specific structure of the template generation module of the illustrated embodiment;

[0069] Figure 8 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0071] In order to improve the efficiency of processing official documents, embodiments of the present invention provide a method, device, electronic device, computer-readable storage medium and computer program product for processing official document elements in an official document template.

[0072] The following first introduces a method for processing document elements in a document template provided by an embodiment of the present invention. The method for processing document elements in a document template provided by an embodiment of the present invention can be applied to any electronic device that needs to process a document template, for example, a computer, a processor, a server, etc., which is not specifically limited here. For the sake of clarity, it is referred to as an electronic device in the following.

[0073] like Figure 1 As shown, a method for processing official document elements in an official document template includes:

[0074] S101, when capturing a deletion operation on a first target element in a target document template, replacing displayed content corresponding to the first target element in the target document template with a preset hidden character;

[0075] The position and content of each document element included in the target document template meet the requirements of the national standard;

[0076] S102, when capturing a recovery operation for the first target element, determining content corresponding to the first target element from a preset element content database as target element content;

[0077] The element content database includes the corresponding relationship between each official document element and content;

[0078] S103, determining a display position of the first target element in the target document template according to the positions of the document elements;

[0079] S104: Replace the preset hidden characters located at the display position with the target element content.

[0080] It can be seen that in the scheme provided by the embodiment of the present invention, when capturing the deletion operation of the first target element in the target document template, the electronic device can replace the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template meet the requirements of the national standard; when capturing the recovery operation for the first target element, the content corresponding to the first target element is determined from the preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden character located at the display position is replaced with the target element content. The position of each document element in the target document template is preset and meets the requirements of the national standard, and the content of each document element is stored in the element content database. When it is necessary to re-add a deleted document element, the electronic device can determine the target element content from the element content database, and then replace the preset hidden character located at the display position with the target element content, so that the position of the re-added first target element also meets the requirements of the national standard, and there is no need to adjust the position of the first target element, which can improve the efficiency of users in processing official documents.

[0081] In order to facilitate the deletion of official document elements in an official document template, a deletion method can be pre-set. When the user wants to delete a certain official document element in the official document template, he can issue a deletion operation for the official document element according to the pre-set deletion method. Then, the electronic device can capture the deletion operation for the official document element and execute the above step S101. The electronic device can replace the display content corresponding to the first target element in the target official document template with preset hidden characters. In this way, the content of the first target element will no longer be displayed in the target official document template.

[0082] Among them, the first target element is the document element that the user wants to delete in the target document template. The above-mentioned target document template is one of the pre-generated document templates. In the process of generating these document templates, all types of document elements can be added to the document template, and then the format, position and content of each document element can be set according to the national standard requirements. In this way, the format, position and content of each document element included in the document template meet the national standard requirements.

[0083] The preset hidden characters are characters that are preset and not displayed in the official document template, for example, characters such as spaces with a horizontal width of 0. Official document elements may include copy number, confidentiality level, confidentiality period, urgency, issuing agency logo, document number, issuer, title, main addressee, text, attachment description, issuing agency signature, document date, seal, notes, attachments, copy addressee, issuing agency, issuing date, page number, etc. The preset deletion method may be double-clicking the official document element, right-clicking the official document element, clicking a preset delete button, etc., which are not specifically limited here.

[0084] For example, as shown in FIG2(a), when the electronic device captures the deletion operation for the first target element 202 in the target document template 201, the electronic device can replace the display content "★XX year" corresponding to the first target element 202 with a preset hidden character. In this way, as shown in FIG2(b), "★XX year" is no longer displayed in the target document template 201.

[0085] After deleting the first target element, the user may want to restore the first target element in the target document template. In order to facilitate the user to restore the deleted document element, a restoration method can be preset. When the user wants to restore the first target element, he can issue a restoration operation for the first target element according to the preset restoration method. Then, the electronic device can capture the restoration operation and execute the above step S102. The electronic device can determine the content corresponding to the first target element from the preset element content database as the target element content.

[0086] The above-mentioned element content database stores the correspondence between each document element and content in the target document template, and the electronic device can determine the content corresponding to the first target element from the element content database according to the correspondence. The pre-set recovery method can be double-clicking the target document template, right-clicking the target document template, clicking a pre-set recovery button, etc., which is not specifically limited here.

[0087] For example, the correspondence between the official document elements and contents stored in the element content database is shown in the following table:

[0088] Document elements content Main sending agency Mainly sent to: ×××, ×××, ×××. Copy to Cc: ×××, ×××. Issuer Issuer: XXX Date of issue Date:

[0089] When the first target element is the issuer, the electronic device can determine that the content of the first target element is "Issuer: So-and-so" according to the corresponding relationship shown in the above table.

[0090] In one embodiment, the electronic device can display each deletable and restorable document element in the target document template. After viewing each deletable and restorable document element, the user can issue a deletion operation or a restoration operation for the first target element according to a pre-set deletion method or restoration method.

[0091] like Figure 3 As shown, the electronic device can display an element processing page 301, and the official document elements displayed in the element processing page 301 include the issuing authority, the copy number, the confidentiality level, the confidentiality period, the urgency level, the issuing document number and the issuer, and display the check boxes corresponding to the copy number, the confidentiality level, the confidentiality period, the urgency level, the issuing document number and the issuer. The user can input the number of issuing authorities through the issuing authority number input box 302. When the user wants to issue a delete operation or a restore operation for a certain official document element, the user can click the check box corresponding to the official document element to issue the delete operation or the restore operation.

[0092] For example, when the user clicks the check box 303 corresponding to the copy number and unchecks the check box 303, the electronic device can delete the copy number in the target document template, and when the user clicks the check box 303 corresponding to the copy number again and checks the check box 303, the electronic device can restore the copy number in the target document template. Function buttons can also be displayed on the left and top of the element processing page 301, and corresponding functions can be executed by clicking, which is convenient for users to edit document templates.

[0093] In order to add the content of the first target element at a position that complies with national standards when capturing the recovery operation for the first target element, the position of each official document element in the target official document template can be recorded in advance. In this way, the electronic device can determine the display position of the first target element in the target official document template based on the position of each official document element in the target official document template.

[0094] For example, the positions of various document elements in the pre-recorded target document template are shown in the following table:

[0095] Document elements Location Document elements A The first line in the upper right corner of the page Document element B The first line in the upper left corner of the page Document Element C The second line from the top left corner of the page Document element D The third line from the top left corner of the page

[0096] When the first target element is document element C, the electronic device can determine the display position of the first target element in the target document template as "the second line from the top left corner of the page" based on the positions of the document elements shown in the above table.

[0097] After determining the target element content and the display position of the first target element in the target document template, the electronic device can replace the preset hidden characters at the display position with the target element content, so that the target element content can be displayed at the display position corresponding to the first target element. Since the display position corresponding to the first target element is preset and meets the requirements of the national standard, the position of the restored first target element also meets the requirements of the national standard, so there is no need to adjust the position of the first target element, which can improve the efficiency of users in processing official documents.

[0098] For example, as shown in FIG2(b), after the user deletes the first target element 202, "★XX year" is no longer displayed in the target document template 201. When the user wants to restore the first target element 202, he can issue a restore operation for the first target element 202. When the electronic device captures the deletion operation for the first target element 202, it can be determined that the display position of the first target element 202 in the target document template 201 is the position of the third to sixth characters from the left to the right in the second row of the upper left corner. Then the electronic device can replace the preset hidden characters at this position with "★XX year". In this way, as shown in FIG2(a), "★XX year" can be displayed again in the target document template 201.

[0099] In the process of generating an official document template, all types of official document elements can be added to the official document template. If a certain official document element does not meet the requirements of the national standard, the content of the official document element can be replaced with preset hidden characters. In other words, the official document template can include official document elements whose default display content is preset hidden characters. When a user wants to add an official document element whose default display content is preset hidden characters to a target official document template, an add operation for the official document element can be issued. After capturing the add operation, the electronic device can determine the content corresponding to the official document element from the element content database, and then determine the display position of the official document element in the target official document template, and then replace the preset hidden characters located at the display position with the content corresponding to the official document element.

[0100] As an implementation of an embodiment of the present invention, after the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters when capturing the deletion operation of the first target element in the target document template, the method may further include:

[0101] If there are no other official document elements in the row where the displayed content is located, the row height of the row where the displayed content is located will be adjusted to 0.

[0102] When the electronic device captures the deletion operation for the first target element in the target document template, the display content corresponding to the first target element in the target document template can be replaced with a preset hidden character, and the content corresponding to the first target element is no longer displayed in the target document template. If there are no other document elements in the row where the display content corresponding to the first target element is located, then the row where the display content corresponding to the first target element is located will be a blank row, which does not meet the national standard requirements.

[0103] Therefore, after replacing the display content corresponding to the first target element with the preset hidden characters, the electronic device can determine whether there are other official document elements in the row where the display content corresponding to the first target element is located. If there are other official document elements, then the row where the display content corresponding to the first target element is located will not be a blank row, which meets the requirements of the national standard, and the electronic device may not perform the operation; if there are no other official document elements, then the row where the display content corresponding to the first target element is located will be a blank row, which does not meet the requirements of the national standard. In order to make the target official document template meet the requirements of the national standard, the electronic device can adjust the row height of the row where the display content is located to 0, that is, delete the blank row.

[0104] For example, as shown in FIG4(a), after the electronic device replaces the display content "Sent to: ×××, ×××, ×××." corresponding to the first target element 402 in the target document template 401 with preset hidden characters, since there are no other document elements in the row where the display content corresponding to the first target element 402 is located, the electronic device can adjust the row height of the row where the display content corresponding to the first target element 402 is located to 0. In this way, as shown in FIG4(b), after deleting the first target element 402, the electronic device can delete the blank row where the display content corresponding to the first target element 402 is located, and the target document template 401 will not display the blank row.

[0105] It can be seen that in the solution provided by the embodiment of the present invention, when capturing the deletion operation for the first target element in the target document template, after replacing the display content corresponding to the first target element in the target document template with the preset hidden characters, if there are no other document elements in the row where the display content is located, the electronic device can adjust the row height of the row where the display content is located to 0. In this way, when the first target element is deleted, no blank row will be generated in the target document template, and a target document template that meets the national standard can be obtained.

[0106] As an implementation method of the embodiment of the present invention, the above-mentioned element content database may also include the line height corresponding to the above-mentioned each official document element.

[0107] The national standard has requirements for the line height of each element in the official document template. For example, GB / T 9704-2012 (official document format of party and government agencies) requires that the line height is the height of a Chinese character plus 7 / 8 of the height of a size 3 Chinese character. In order to ensure that the line height of the restored official document element meets the national standard requirements when restoring the official document element, the above-mentioned element content database may include the line height corresponding to each official document element in addition to the content of each official document element.

[0108] In view of this situation, before the step of replacing the preset hidden characters located at the display position with the target element content, the method may further include:

[0109] Determine whether the row height of the row corresponding to the display position is 0; if not, execute the above-mentioned step of replacing the preset hidden characters located at the display position with the target element content; if yes, adjust the row height of the row corresponding to the display position from 0 to the row height corresponding to the first target element, and execute the above-mentioned step of replacing the preset hidden characters located at the display position with the target element content.

[0110] When there are no other official document elements in the row where the display content corresponding to the first target element is located, after capturing the deletion operation on the first target element, the electronic device may adjust the row height of the row where the display content corresponding to the first target element is located to 0. Therefore, when the electronic device determines the display position of the first target element in the target official document template, the row height of the row corresponding to the display position of the first target element in the target official document template may be 0.

[0111] Therefore, before the electronic device replaces the preset hidden characters at the display position with the target element content, the electronic device can determine whether the row height of the row corresponding to the display position is 0. If the row height of the row corresponding to the display position is not 0, the electronic device can replace the preset hidden characters at the display position with the target element content, that is, execute the above step S104.

[0112] If the row height of the row corresponding to the display position is 0, it means that the row where the display content corresponding to the first target element is located is not displayed in the current target document template, then the electronic device can determine the row height corresponding to the first target element from the element content database, and then adjust the row height of the row corresponding to the display position from 0 to the row height corresponding to the first target element, and then replace the preset hidden characters at the display position with the target element content, that is, perform the above step S104. Since the row heights of the document elements stored in the element content database meet the national standard requirements, the restored row height of the first target element also meets the national standard requirements.

[0113] For example, the row heights corresponding to the various document elements included in the element content database are as follows:

[0114] Document elements Line Height M1 11 M2 22 M3 25 M4 30

[0115] When the electronic device determines that the row height corresponding to the display position of the first target element M1 in the target official document template is 0, the electronic device can determine that the row height corresponding to the first target element M1 is 11 according to the above table, and then adjust the row height of the row corresponding to the display position of the first target element M1 in the target official document template from 0 to 11, and then, replace the preset hidden characters located at the display position with the target element content.

[0116] It can be seen that in the solution provided by the embodiment of the present invention, before replacing the preset hidden characters at the display position with the target element content, the electronic device can determine whether the line height of the line corresponding to the display position is 0; if not, replace the preset hidden characters at the display position with the target element content; if yes, adjust the line height of the line corresponding to the display position from 0 to the line height corresponding to the first target element, and replace the preset hidden characters at the display position with the target element content. In this way, it can be ensured that the line height of the first target element after restoration meets the national standard requirements.

[0117] As an implementation of an embodiment of the present invention, before the step of replacing the displayed content corresponding to the first target element in the document template with a preset hidden character when capturing the deletion operation on the first target element in the document template, the method may further include:

[0118] When capturing the document template selection operation, a target document template is determined from a plurality of pre-generated document templates.

[0119] In order to facilitate users to write official documents, multiple official document templates can be pre-generated in accordance with national standards. For example, official document templates corresponding to types of official documents such as upward documents, downward documents, letters, minutes, and commands can be generated in accordance with national standards. When a user needs to use an official document template, the electronic device can display the above-mentioned multiple pre-generated official document templates, and the user can choose from them. At this time, the user can issue an official document template selection operation in accordance with a pre-set selection method, and the electronic device can also capture the official document template selection operation and determine the target official document template that the user wants to use from multiple official document templates. Among them, the above-mentioned pre-set selection method can be clicking on the official document template, pressing Enter after selecting the official document template, etc., which is not specifically limited here.

[0120] In one embodiment, the electronic device may provide a template display button. After the user clicks the template display button, the electronic device may display a thumbnail of each document template for the user to view. When the user wants to use a document template, he or she may click the thumbnail of the document template, and the electronic device may determine the document template from multiple document templates, that is, the target document template.

[0121] It can be seen that in the solution provided by the embodiment of the present invention, when capturing the deletion operation for the first target element in the official document template, before replacing the display content corresponding to the first target element in the official document template with the preset hidden characters, the electronic device can determine the target official document template from the pre-generated multiple official document templates when capturing the official document template selection operation. In this way, when the user needs to use the official document template, he can select the official document template he needs from the pre-generated multiple official document templates, which can improve the efficiency of processing official documents and improve the user experience.

[0122] As an implementation method of the embodiment of the present invention, Figure 5 As shown, the generation method of the above document template may include:

[0123] S501, adding all types of official document elements to the preset initial template corresponding to each type of official document;

[0124] In order to facilitate users to add or delete official document elements in the official document template, the electronic device can add all types of official document elements in the preset initial template corresponding to each type of official document. Among them, the format, position and content of each type of official document element meet the requirements of the national standard. The preset initial template is a blank template that is pre-set to meet the national standard for the format size and layout requirements of official documents. The layout requirements can be page margins, page size, number of lines per page, number of words per line, etc.

[0125] For example, the types of official documents include upward documents, downward documents, letters, minutes and orders, and the types of official document elements include copy number, confidentiality level, confidentiality period, urgency, issuing agency mark, document number, issuer, title, main addressee, text, attachment description, issuing agency signature, date of writing, seal, notes, attachments, copy agencies, issuing agency, date of printing and page numbers. Electronic devices can add copy number, confidentiality level, confidentiality period, urgency, issuing agency mark, document number, issuer, title, main addressee, text, attachment description, issuing agency signature, date of writing, seal, notes, attachments, copy agencies, issuing agency, date of printing and page numbers to the preset initial templates corresponding to upward documents, downward documents, letters, minutes and orders. Although the national standard requires that the edition of a letter usually does not include the issuing agency and the issuing date, in order to facilitate users to add or delete official document elements in the official document template, when generating the official document template corresponding to the letter, the issuing agency and the issuing date can also be added to the preset initial template corresponding to the letter.

[0126] In one embodiment, in order to facilitate the setting of the row height of each document element in the document template, the electronic device can insert a table in the preset initial template, and then add all types of document elements to the table, and set the row height of the table row where each document element is located according to national standards.

[0127] S502, storing each type of document element and its corresponding content in correspondence to obtain an element content database;

[0128] In order to facilitate users to add or delete document elements in the document template, the electronic device can save each type of document element and its corresponding content to obtain an element content database, so that the element content database also includes the correspondence between each document element and its content.

[0129] For example, the content corresponding to the confidentiality level is "× Secret", the content corresponding to the urgency level is "× Urgent", the content corresponding to the document number is "×××〔20××〕× Number", and the content corresponding to the issuance date is "20×× Year × Month × Day". The electronic device can store the confidentiality level and its corresponding content in correspondence, store the urgency level and its corresponding content in correspondence, store the document number and its corresponding content in correspondence, and store the issuance date and its corresponding content in correspondence, and obtain the element content database shown in the following table:

[0130] Document elements content Classification × Urgency ×Urgent Document number No. ×××〔20××〕× Date of issue Date:

[0131] The electronic device can also store each type of official document element and its corresponding line height in correspondence, so that the element content database also includes the line height corresponding to each official document element.

[0132] S503, determining the second target element in each of the preset initial templates according to the national standard requirements;

[0133] The electronic device adds all types of official document elements to the preset initial template corresponding to each type of official document. For each type of official document, there may be official document elements that do not meet the national standard requirements among all the above types of official document elements. For example, in the national standard requirements, letters usually do not include the issuing authority and the issuing date. Therefore, the issuing authority and the issuing date included in the preset initial template corresponding to the letter do not meet the national standard requirements.

[0134] In order to make the generated official document template meet the national standard requirements, the electronic device can determine the second target element in each preset initial template according to the national standard requirements, and the second target element is the official document element in the preset initial template that does not meet the national standard requirements.

[0135] S504: Replace the displayed content of each of the second target elements in the corresponding preset initial template with preset hidden characters to obtain the official document template.

[0136] In order to make the generated official document template comply with the national standards, after determining the second target element in each preset initial template, the electronic device can replace the display content of each second target element in the corresponding preset initial template with preset hidden characters to obtain the official document template corresponding to each type of official document. In this way, the generated official document template will not display official document elements that do not comply with the national standards, and the generated official document template will also comply with the national standards.

[0137] It can be seen that in the scheme provided by the embodiment of the present invention, the electronic device can add all types of official document elements to the preset initial template corresponding to each type of official document, wherein the position and content of each type of official document element meet the requirements of the national standard; each type of official document element and its corresponding content are saved in correspondence to obtain an element content database; according to the requirements of the national standard, the second target element in each preset initial template is determined, wherein the second target element is the official document element in the preset initial template that does not meet the requirements of the national standard; the display content of each second target element in the corresponding preset initial template is replaced with preset hidden characters to obtain an official document template. In this way, the electronic device can generate multiple official document templates that meet the requirements of the national standard, which can be selected by the user when the user processes the official document, providing convenience for the user to process the official document.

[0138] As an implementation of an embodiment of the present invention, after the step of replacing the display content of each second target element in the corresponding preset initial template with a preset hidden character, the method may further include:

[0139] If there are no other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located, the row height of the row is adjusted to 0.

[0140] After the electronic device replaces the display content of the second target element in the corresponding preset initial template with the preset hidden characters, the second target element is no longer displayed in the preset initial template. If there are no other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located, then the row where the display content of the second target element in the preset initial template is located will be a blank row, which does not meet the national standard requirements.

[0141] Therefore, after replacing the display content of the second target element in the corresponding preset initial template with the preset hidden characters, the electronic device can determine whether there are other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located. If there are other official document elements, then the row where the display content corresponding to the second target element is located will not be a blank row, which meets the requirements of the national standard, and the electronic device may not perform the operation; if there are no other official document elements, then the row where the display content corresponding to the second target element is located will be a blank row, which does not meet the requirements of the national standard. In order to make the generated official document template meet the requirements of the national standard, the electronic device can adjust the row height of the row where the display content of the second target element in the corresponding preset initial template is located to 0, that is, delete the blank row.

[0142] It can be seen that in the solution provided by the embodiment of the present invention, after the electronic device replaces the display content of each second target element in the corresponding preset initial template with the preset hidden characters, if there are no other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located, the row height can be adjusted to 0. In this way, when the electronic device replaces the display content of the second target element in the corresponding preset initial template with the preset hidden characters, the preset initial template will not generate blank lines, which can ensure that the generated official document template meets the national standard requirements.

[0143] As an implementation of an embodiment of the present invention, before the step of replacing the display content corresponding to the first target element in the target document template with preset hidden characters, the method may further include:

[0144] According to the first target element and the pre-set add / delete tags of each document element, determine whether the first target element can be deleted; if so, execute the step of replacing the display content corresponding to the first target element in the target document template with preset hidden characters.

[0145] Among the official document elements included in the target official document template, there may be official document elements that are not deletable and not recoverable. Therefore, after capturing the deletion operation for the first target element in the target official document template, the electronic device can determine whether the first target element can be deleted based on the first target element and the pre-set add / delete tags of each official document element. The add / delete tag is used to identify the corresponding official document element as a deletable and recoverable element.

[0146] For example, the pre-set add / delete tags for each document element are shown in the following table:

[0147] Document elements Add or delete tags G1 S G2 S G3 G4 S

[0148] When the first target element is the official document element G3, the electronic device can determine that there is no corresponding add / delete tag for the first target element G3 based on the above table, so the electronic device can determine that the first target element G3 cannot be deleted; when the first target element is the official document element G1, the electronic device can determine that there is a corresponding add / delete tag "S" for the first target element G1 based on the above table, so the electronic device can determine that the first target element is the official document element G1 and can be deleted.

[0149] In one embodiment, a tag that can be added and deleted can be pre-set for each deletable and restorable document element, and a tag that cannot be added and deleted can be pre-set for each non-deletable and non-recoverable document element, and then each document element and its corresponding tag are saved in correspondence to obtain a tag database. In this way, when a deletion operation for a first target element is captured, the electronic device can determine the tag corresponding to the first target element from the tag database, and if the tag corresponding to the first target element is a tag that can be added and deleted, it can be determined that the first target element can be deleted; if the tag corresponding to the first target element is a tag that cannot be added and deleted, it can be determined that the first target element cannot be deleted.

[0150] If the first target element can be deleted, the electronic device can replace the display content corresponding to the first target element in the target document template with a preset hidden character, that is, perform the above step S101; if the first target element cannot be deleted, the electronic device may not perform the operation, or may display a prompt message that the first target element cannot be deleted. In this way, the electronic device can accurately determine whether the first target element can be deleted based on the addition and deletion tags of each document element.

[0151] When a user wants to add a document element whose default display content is preset hidden characters in a target document template, he can issue an adding operation for the document element. When the electronic device captures the adding operation issued by the user for the document element, it can also determine whether the document element can be added based on the document element and the pre-set add / delete tags of each document element. If the document element can be added, the content corresponding to the document element can be determined from the element content database, and then the display position of the document element in the target document template can be determined, and then the preset hidden characters at the display position can be replaced with the content corresponding to the document element. If the document element cannot be added, the electronic device can either not perform the operation or display a prompt message indicating that the document element cannot be added.

[0152] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can determine whether the first target element can be deleted according to the first target element and the preset addition and deletion tags of each document element; if so, the step of replacing the display content corresponding to the first target element in the target document template with the preset hidden characters can be executed. In this way, the electronic device can accurately determine whether the first target element can be deleted or restored according to the preset addition and deletion tags.

[0153] Corresponding to the above method for processing document elements in a document template, an embodiment of the present invention further provides a device for processing document elements in a document template. The following is an introduction to a device for processing document elements in a document template provided by an embodiment of the present invention.

[0154] like Figure 6 As shown, a device for processing official document elements in an official document template, the device comprising:

[0155] The deletion module 601 is used to replace the displayed content corresponding to the first target element in the target document template with a preset hidden character when capturing a deletion operation on the first target element in the target document template;

[0156] Among them, the position and content of each document element included in the target document template meet the requirements of national standards.

[0157] A content determination module 602, configured to determine, when capturing a recovery operation for the first target element, content corresponding to the first target element from a preset element content database as target element content;

[0158] The element content database includes the correspondence between each official document element and content.

[0159] A position determination module 603, configured to determine a display position of the first target element in the target document template according to the positions of the document elements;

[0160] The replacement module 604 is used to replace the preset hidden characters located at the display position with the target element content.

[0161] It can be seen that in the scheme provided by the embodiment of the present invention, when capturing the deletion operation of the first target element in the target document template, the electronic device can replace the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template meet the requirements of the national standard; when capturing the recovery operation for the first target element, the content corresponding to the first target element is determined from the preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden character located at the display position is replaced with the target element content. The position of each document element in the target document template is preset and meets the requirements of the national standard, and the content of each document element is stored in the element content database. When it is necessary to re-add a deleted document element, the electronic device can determine the target element content from the element content database, and then replace the preset hidden character located at the display position with the target element content, so that the position of the re-added first target element also meets the requirements of the national standard, and there is no need to adjust the position of the first target element, which can improve the efficiency of users in processing official documents.

[0162] As an implementation of the embodiment of the present invention, the above device may further include:

[0163] The first row height adjustment module ( Figure 6 (not shown) is used for, when capturing a deletion operation on the first target element in the target document template, replacing the display content corresponding to the first target element in the target document template with preset hidden characters, and if there are no other document elements in the row where the display content is located, adjusting the row height of the row where the display content is located to 0.

[0164] As an implementation method of the embodiment of the present invention, the above-mentioned element content database also includes the line height corresponding to each of the above-mentioned official document elements;

[0165] The above device may also include:

[0166] Judgment module ( Figure 6 (not shown) for determining whether the row height of the row corresponding to the display position is 0 before replacing the preset hidden character at the display position with the target element content;

[0167] The first execution module ( Figure 6 ), for, if not, executing the step of replacing the preset hidden character located at the display position with the target element content;

[0168] The second row height adjustment module ( Figure 6(not shown) is used to, if yes, adjust the row height of the row corresponding to the display position from 0 to the row height corresponding to the first target element, and execute the replacement of the preset hidden character located at the display position with the target element content.

[0169] As an implementation of the embodiment of the present invention, the above device may further include:

[0170] Template determination module ( Figure 6 ), which is not shown in the figure, is used to replace the display content corresponding to the first target element in the document template with preset hidden characters before capturing the deletion operation for the first target element in the document template, and to determine the target document template from multiple document templates pre-generated by the template generation module when capturing the document template selection operation.

[0171] As an implementation method of the embodiment of the present invention, Figure 7 As shown, the template generation module may include:

[0172] The element adding submodule 701 is used to add all types of official document elements to the preset initial template corresponding to each type of official document;

[0173] Among them, the location and content of each type of official document elements meet the national standard requirements.

[0174] The database generation submodule 702 is used to store each type of document element and its corresponding content in correspondence to obtain an element content database;

[0175] The second target element determination submodule 703 is used to determine the second target element in each of the preset initial templates according to the national standard requirements;

[0176] Among them, the second target element is the official document element in the preset initial template that does not meet the requirements of the national standard.

[0177] The replacement submodule 704 is used to replace the display content of each of the second target elements in the corresponding preset initial template with preset hidden characters to obtain the official document template.

[0178] As an implementation of an embodiment of the present invention, the template generation module may further include:

[0179] Row height adjustment submodule ( Figure 7 (not shown) is used to adjust the line height of each second target element in the corresponding preset initial template to 0 after replacing the display content of each second target element in the corresponding preset initial template with preset hidden characters, if there are no other official document elements in the line where the display content of the second target element in the corresponding preset initial template is located.

[0180] As an implementation of the embodiment of the present invention, the above device may further include:

[0181] Determine the module ( Figure 6 ), used to determine whether the first target element can be deleted according to the first target element and the pre-set add / delete tags of each document element before replacing the displayed content corresponding to the first target element in the target document template with a preset hidden character;

[0182] The add / delete tag is used to identify the corresponding document element as a deletable and restorable element.

[0183] The second execution module ( Figure 6 (not shown) is used to, if yes, execute the replacement of the displayed content corresponding to the first target element in the target document template with preset hidden characters.

[0184] The embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0185] Memory 803, used for storing computer programs;

[0186] The processor 801 is used to implement the steps of the method for processing the document elements in the document template described in any of the above embodiments when executing the program stored in the memory 803.

[0187] It can be seen that in the scheme provided by the embodiment of the present invention, when capturing the deletion operation of the first target element in the target document template, the electronic device can replace the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template meet the requirements of the national standard; when capturing the recovery operation for the first target element, the content corresponding to the first target element is determined from the preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden character located at the display position is replaced with the target element content. The position of each document element in the target document template is preset and meets the requirements of the national standard, and the content of each document element is stored in the element content database. When it is necessary to re-add a deleted document element, the electronic device can determine the target element content from the element content database, and then replace the preset hidden character located at the display position with the target element content, so that the position of the re-added first target element also meets the requirements of the national standard, and there is no need to adjust the position of the first target element, which can improve the efficiency of users in processing official documents.

[0188] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0189] The communication interface is used for communication between the above electronic device and other devices.

[0190] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0191] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0192] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing document elements in any of the above-mentioned document templates are implemented.

[0193] It can be seen that in the scheme provided by the embodiment of the present invention, when the computer program stored in the computer-readable storage medium is executed by the processor, when capturing the deletion operation of the first target element in the target document template, the display content corresponding to the first target element in the target document template can be replaced with preset hidden characters, wherein the positions and contents of each document element included in the target document template meet the requirements of the national standard; when capturing the recovery operation for the first target element, the content corresponding to the first target element is determined from a preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden characters located at the display position are replaced with the target element content. The position of each official document element in the target official document template is pre-set and complies with the national standard requirements, and the content of each official document element is stored in the element content database. When a deleted official document element needs to be re-added, the electronic device can determine the target element content from the element content database, and then replace the preset hidden characters located in the display position with the target element content. In this way, the position of the first target element that is re-added also complies with the national standard requirements. There is no need to adjust the position of the first target element, which can improve the user's efficiency in processing official documents.

[0194] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute a method for processing document elements in any document template in the above-mentioned embodiments.

[0195] It can be seen that in the solution provided by the embodiment of the present invention, when the computer program product is running on a computer, when capturing a deletion operation on the first target element in the target document template, the display content corresponding to the first target element in the target document template can be replaced with preset hidden characters, wherein the positions and contents of each document element included in the target document template meet the requirements of the national standard; when capturing a recovery operation on the first target element, the content corresponding to the first target element is determined from a preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; according to the position of each document element, the display position of the first target element in the target document template is determined; and the preset hidden characters located at the display position are replaced with the target element content. The position of each official document element in the target official document template is pre-set and complies with the national standard requirements, and the content of each official document element is stored in the element content database. When a deleted official document element needs to be re-added, the electronic device can determine the target element content from the element content database, and then replace the preset hidden characters located in the display position with the target element content. In this way, the position of the first target element that is re-added also complies with the national standard requirements. There is no need to adjust the position of the first target element, which can improve the user's efficiency in processing official documents.

[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0197] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0198] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0199] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for processing official document elements in an official document template, characterized in that: The method comprises: When capturing a deletion operation on a first target element in a target document template, replacing the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the position and content of each document element included in the target document template meet the requirements of the national standard; in the case where there are no other document elements in the row where the display content corresponding to the first target element is located, adjusting the row height of the row where the display content corresponding to the first target element is located, so that the target document template meets the requirements of the national standard; When capturing the recovery operation for the first target element, determining the content corresponding to the first target element from a preset element content database as the target element content, wherein the element content database includes the correspondence between each document element and the content; Determining a display position of the first target element in the target document template according to the pre-recorded positions of each document element in the target document template; The preset hidden character located at the display position is replaced with the target element content.

2. The method according to claim 1, characterized in that After the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters when capturing the deletion operation on the first target element in the target document template, the method further includes: If there are no other official document elements in the row where the displayed content is located, the row height of the row where the displayed content is located is adjusted to 0.

3. The method according to claim 2, characterized in that The element content database also includes the line height corresponding to each official document element; Before the step of replacing the preset hidden character located at the display position with the target element content, the method further includes: Determine whether the row height of the row corresponding to the display position is 0; If not, performing the step of replacing the preset hidden character located at the display position with the target element content; If yes, the row height of the row corresponding to the display position is adjusted from 0 to the row height corresponding to the first target element, and the step of replacing the preset hidden character located at the display position with the target element content is performed.

4. The method according to any one of claims 1 to 3, characterized in that: Before the step of replacing the displayed content corresponding to the first target element in the document template with a preset hidden character when capturing the deletion operation on the first target element in the document template, the method further includes: When capturing the document template selection operation, a target document template is determined from a plurality of pre-generated document templates.

5. The method according to claim 4, characterized in that The method for generating the document template includes: Add all types of official document elements to the preset initial template corresponding to each type of official document, wherein the position and content of each type of official document element conform to the requirements of the national standard; Each type of official document element and its corresponding content are saved in correspondence to obtain an element content database; According to the national standard requirements, determining the second target element in each of the preset initial templates, wherein the second target element is the document element in the preset initial template that does not meet the national standard requirements; The displayed content of each of the second target elements in the corresponding preset initial template is replaced with preset hidden characters to obtain the official document template.

6. The method according to claim 5, characterized in that After the step of replacing the display content of each second target element in the corresponding preset initial template with a preset hidden character, the method further includes: If there are no other official document elements in the row where the display content of the second target element in the corresponding preset initial template is located, the row height of the row is adjusted to 0.

7. The method according to any one of claims 1 to 3, characterized in that: Before the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters, the method further includes: Determining whether the first target element can be deleted according to the first target element and the pre-set add / delete tags of each document element, wherein the add / delete tags are used to identify the corresponding document element as a deletable and restorable element; If yes, execute the step of replacing the displayed content corresponding to the first target element in the target document template with preset hidden characters.

8. A device for processing official document elements in an official document template, characterized in that: The device comprises: A deletion module, configured to replace the display content corresponding to the first target element in the target document template with preset hidden characters when capturing a deletion operation on the first target element in the target document template, wherein the positions and contents of the document elements included in the target document template meet the requirements of the national standard; and in the case where there are no other document elements in the row where the display content corresponding to the first target element is located, adjust the row height of the row where the display content corresponding to the first target element is located, so that the target document template meets the requirements of the national standard; a content determination module, configured to determine, when capturing a recovery operation for the first target element, the content corresponding to the first target element from a preset element content database as the target element content, wherein the element content database includes a correspondence between each document element and the content; A position determination module, used to determine the display position of the first target element in the target document template according to the pre-recorded positions of each document element in the target document template; A replacement module is used to replace the preset hidden characters located at the display position with the target element content.

9. The device according to claim 8, characterized in that The device also includes: The first line height adjustment module is used to replace the display content corresponding to the first target element in the target document template with preset hidden characters when capturing a deletion operation on the first target element in the target document template. If there are no other document elements in the line where the display content is located, the line height of the line where the display content is located is adjusted to 0.

10. The device according to claim 9, characterized in that The element content database also includes the line height corresponding to each official document element; The device also includes: A judgment module, used for judging whether the row height of the row corresponding to the display position is 0 before replacing the preset hidden character at the display position with the target element content; A first execution module, configured to, if not, execute the step of replacing the preset hidden character located at the display position with the target element content; The second row height adjustment module is used to adjust the row height of the row corresponding to the display position from 0 to the row height corresponding to the first target element, and replace the preset hidden characters located at the display position with the target element content.

11. The device according to any one of claims 8 to 10, characterized in that: The device also includes: A template determination module is used to, when capturing a deletion operation on a first target element in a document template, replace the display content corresponding to the first target element in the document template with preset hidden characters, and when capturing a document template selection operation, determine a target document template from multiple document templates pre-generated by a template generation module.

12. The device according to claim 11, characterized in that The template generation module comprises: The element adding submodule is used to add all types of official document elements to the preset initial template corresponding to each type of official document, wherein the position and content of each type of official document element conform to the national standard requirements; The database generation submodule is used to store each type of official document element and its corresponding content in correspondence to obtain an element content database; A second target element determination submodule, for determining a second target element in each of the preset initial templates according to the national standard requirements, wherein the second target element is an official document element in the preset initial template that does not meet the national standard requirements; The replacement submodule is used to replace the display content of each of the second target elements in the corresponding preset initial template with preset hidden characters to obtain the official document template.

13. The device according to claim 12, characterized in that The template generation module also includes: A line height adjustment submodule is used to adjust the line height of each second target element in the corresponding preset initial template to 0 after replacing the display content of the second target element in the corresponding preset initial template with preset hidden characters, if there are no other official document elements in the line where the display content of the second target element in the corresponding preset initial template is located.

14. The device according to any one of claims 8 to 10, characterized in that: The device also includes: a determination module, used for determining whether the first target element can be deleted according to the first target element and the pre-set add / delete tags of each document element before replacing the display content corresponding to the first target element in the target document template with a preset hidden character, wherein the add / delete tag is used to identify the corresponding document element as a deletable and restorable element; The second execution module is used to execute the replacement of the displayed content corresponding to the first target element in the target document template with preset hidden characters if yes.

15. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Official document generation method and system based on Web

    CN108681530A