Document editing method, device, equipment and storage medium

By judging and adjusting the level of document blocks in the document editor, the problem that some blocks cannot be used as parent levels in the prior art is solved, and the flexibility of flexibly adjusting and typifying the level of document blocks is achieved.

CN114707470BActive Publication Date: 2024-12-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210415789.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2024-12-27
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

In the existing document editor, some blocks cannot be used as parent level, resulting in the text below the picture being unable to directly adjust the level, affecting the user's layout of the document.

Method used

By obtaining the hierarchical adjustment instructions of the first document block in the document, it is determined whether there is a second document block that meets the hierarchical conditions in the document block that is the same as the first document block and has a typographical order before the first document block, and adjust the instructions according to the hierarchical adjustment instructions. Adjust the level of the first document block.

Benefits of technology

Users can easily adjust the levels of document blocks to achieve flexible layout of documents, solving the problem of cumbersome operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114707470B_ABST
    Figure CN114707470B_ABST
Patent Text Reader

Abstract

The present application discloses a document editing method, apparatus, device and storage medium, which obtains a level adjustment instruction for a first document block in a document, determines the first document block whose level needs to be adjusted, determines whether there is a second document block that meets the level condition in a document block that has the same level as the first document block and whose layout order is before the first document block, and in response to the existence of a second document block that meets the level adjustment condition, adjusts the level of the first document block according to the level adjustment instruction. The user triggers the level adjustment instruction, and when there is a second document block that meets the level condition, the user adjusts the level of the first document block to adjust the layout of the first document block. This makes it easy for the user to adjust the layout of the document block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a document editing method, device, equipment and storage medium. Background Art

[0002] With the popularization of computer technology and Internet technology, editing documents using computer software or web editors has become a common editing method. Some document editors also provide document layout functions. Users can use the document layout function of the document editor to flexibly adjust the document layout and obtain documents that meet user needs.

[0003] In some document editors, blocks are used as the smallest unit for editing documents. For example, a paragraph of text in a document is a block, a picture is a block, and a table is a block. When users are typeset a document, they can adjust the typeset of each block to edit the typeet of the entire document. However, in some cases, some blocks do not meet the conditions for adjusting the typeet and cannot be edited. Summary of the invention

[0004] In view of this, the present application provides a document editing method, apparatus, device and storage medium, which can more conveniently adjust the hierarchy of document blocks and flexibly adjust the layout of the document.

[0005] To solve the above problems, the technical solutions provided by this application are as follows:

[0006] In a first aspect, an embodiment of the present application provides a document editing method, the method comprising:

[0007] In response to obtaining a level adjustment instruction, determining a first document block based on the level adjustment instruction;

[0008] Determining whether there is a second document block, wherein the second document block is a document block that has the same level as the first document block and is before the first document block in typesetting order and satisfies the level adjustment condition;

[0009] In response to the existence of the second document block, the level of the first document block is adjusted according to the level adjustment instruction.

[0010] In a second aspect, an embodiment of the present application provides a document editing device, the device comprising:

[0011] a determining unit, configured to, in response to acquiring a level adjustment instruction, determine a first document block based on the level adjustment instruction;

[0012] a determination unit, configured to determine whether there is a second document block, wherein the second document block is a document block having the same level as the first document block and having a layout order before the first document block, and meeting the level adjustment condition;

[0013] The first adjustment unit is configured to adjust the level of the first document block according to the level adjustment instruction in response to the existence of the second document block.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0015] one or more processors;

[0016] a storage device having one or more programs stored thereon,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement any method described in the first aspect above.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any one of the first aspects is implemented.

[0019] It can be seen that this application has the following beneficial effects:

[0020] The present application provides a document editing method, device, equipment and storage medium, which obtains a level adjustment instruction for a first document block in a document, determines the first document block that needs to adjust the level, determines whether there is a second document block that meets the level condition in a document block that has the same level as the first document block and whose layout order is before the first document block, and in response to the existence of a second document block that meets the level adjustment condition, adjusts the level of the first document block according to the level adjustment instruction. The user triggers the level adjustment instruction, and when there is a second document block that meets the level condition, the user adjusts the level of the first document block to adjust the layout of the first document block. This makes it easy for the user to adjust the layout of the document block. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a document provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a document after typesetting adjustment provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of a document editing method provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of another document provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of another document after typesetting adjustment provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of a display level adjustment prompt provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of the structure of a document editing device provided in an embodiment of the present application;

[0028] Figure 8 A schematic diagram of the basic structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the background technology of the present application will be described below.

[0030] Documents edited by some document editors are in blocks. Blocks are divided by paragraphs and content types. For example, a paragraph of text is a block. An image is a block. A table is a block. The document editor builds a hierarchical structure between each block, which can be specifically displayed as a tree structure. Each block is a node on the tree structure. Users can adjust the layout of the document by setting the layer of each block in the document. For example, the indentation of lower-level blocks is higher, and the indentation of higher-level blocks is lower. In this way, different indentations can be achieved for blocks of different levels. However, some blocks cannot be used as parent levels. At present, except for text, other blocks cannot be used as parent levels. For example, the block corresponding to the image cannot be used as a parent level. This results in the text below the image not being able to directly adjust the level, affecting the user's layout of the document.

[0031] Based on this, the embodiments of the present application provide a document editing method, apparatus, device and storage medium, which obtains a level adjustment instruction for a first document block in a document, determines the first document block whose level needs to be adjusted, determines whether there is a second document block that meets the level conditions in a document block that has the same level as the first document block and whose layout order is before the first document block, and in response to the existence of a second document block that meets the level adjustment conditions, adjusts the level of the first document block according to the level adjustment instruction. The user triggers the level adjustment instruction, and when there is a second document block that meets the level conditions, adjusts the level of the first document block to adjust the layout of the first document block. This makes it easy for the user to adjust the layout of the document block.

[0032] In order to facilitate understanding of the document editing method provided in the embodiment of the present application, Figure 1 See the example scenario shown. Figure 1 and Figure 2, which is a framework diagram of an exemplary application scenario provided in an embodiment of the present application.

[0033] In actual applications, for example, the document content of a document editor includes seven document blocks. Figure 1 As shown, the solid-line box is the editing page of the document. Each dotted-line box is a document block. The content of document block 1 is a text title, the content of document blocks 2 to 4 is text content, the content of document block 5 is a picture, and the content of document blocks 6 and 7 is text content. Document blocks 1 and 2 are at the highest level, that is, the first level. Document block 3 is at the second level. Document block 4 is at the third level. Document blocks 5 to 7 have the same level as document block 3 and are all at the second level. The user can trigger a level adjustment instruction for 6 document blocks. Based on the level adjustment instruction triggered by the user, document block 6 is used as the first document block. It is determined whether there is a second document block that meets the level adjustment condition in the document blocks that have the same level as the first document block and whose typesetting order is before the typesetting order of the first document block. Among them, the level adjustment condition is, for example, that the content of the document block is text. The document block that has the same level as the first document block and whose typesetting order is before the first document block is document block 3. The content of document block 3 is text content, which meets the level adjustment condition. Determine document block 3 as the second document block. In response to the existence of a second document block that satisfies the level adjustment condition, adjust the level of the first document block according to the level adjustment instruction. Figure 2 As shown, the first document block after the level adjustment is displayed. The level of the first document block is lowered based on the level adjustment instruction, and correspondingly, as the level is lowered, the first document block is indented. In this way, by adjusting the level, the layout of the first document block is adjusted.

[0034] Those skilled in the art will understand that Figure 1 and Figure 2 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.

[0035] Based on the above description, the document editing method provided by the present application will be described in detail below in conjunction with the accompanying drawings.

[0036] First of all, it should be noted that the document editing method provided in the embodiment of the present application is applied to a document editor. The embodiment of the present application does not limit the type of document editor. The document editor is, for example, a software program or a web page editor.

[0037] The present application embodiment provides a document editing method. Figure 3 As shown, this figure is a schematic flow chart of a document editing method provided in an embodiment of the present application. The document editing method includes S301-S303.

[0038] S301: In response to obtaining a level adjustment instruction, determine a first document block based on the level adjustment instruction.

[0039] A document consists of multiple document blocks. A document block is the smallest unit of layout adjustment in a document. Document blocks are divided based on content type and paragraph. For example, for the same content type, each paragraph is a document block. For different content types, each content type is a document block. For example, each paragraph of text in a document is a document block, each picture is a document block, and each table is a document block.

[0040] The level adjustment instruction is used to determine the document block that needs to adjust the level. The level adjustment instruction can be generated by the user. The embodiment of the present application does not limit the specific implementation method of the user triggering the generation of the level adjustment instruction. In one possible implementation method, the user can trigger the generation of the level adjustment instruction by pressing a pre-set shortcut key. Among them, the shortcut key is, for example, the tab key. In another possible implementation method, the user can also use an input device such as a mouse, a stylus, etc. to trigger the generation of the level adjustment instruction by clicking.

[0041] The first document block whose level needs to be adjusted by the user can be determined according to the level adjustment instruction. In one possible implementation, the level adjustment instruction includes relevant information of the first document block. For example, the level adjustment instruction includes a document block identifier of the first document block. In another possible implementation, the first document block is determined based on the position of the document block to which the cursor position belongs when the user triggers the level adjustment instruction. Figure 1 Take the document diagram shown as an example, see Figure 4 As shown, when the user triggers the generation of the level adjustment instruction by triggering the shortcut key, the cursor is located at the position of document block 6, and document block 6 is the first document block. In another possible implementation, the document block selected by the user when the user triggers the level adjustment instruction is determined as the first document block.

[0042] It should be noted that the embodiment of the present application does not limit the content type of the content of the first document block. For example, the content corresponding to the first document block is the content in a document such as text, a picture or a table.

[0043] S302: Determine whether a second document block exists.

[0044] The second document block is a document block that has the same level as the first document block and whose layout order is before the first document block, and that meets the level adjustment condition.

[0045] After obtaining the level adjustment instruction, determine whether there is a document block that meets the level adjustment conditions in the document blocks that are at the same level as the first document block but whose typesetting order is before the typesetting order of the first document block. Wherein, as an example, the typesetting order is determined based on the document editing order or the preset typesetting layout of the document. For example, if the document is edited from top to bottom, the editing order is from top to bottom. The document block whose typesetting order is before the first document block is the document block above the first document block in the document. For another example, if the typesetting layout of the document is from left to right, the typesetting order is from left to right. The document block whose typesetting order is before the first document block is the document block to the left of the first document block in the document.

[0046] If it is determined that the document block having the same level as the first document block and whose typesetting order precedes the typesetting order of the first document block satisfies the level adjustment condition, the document block is determined as the second document block. The second document block is a document block having the same level as the first document block and whose typesetting order precedes the typesetting order of the first document block and satisfies the level adjustment condition.

[0047] As an example, an embodiment of the present application provides a specific implementation method for determining whether a second document block exists, and please refer to the following for details.

[0048] In some possible implementations, the hierarchical adjustment condition is that the second document block can establish a parent-child hierarchical relationship with the first document block. Among them, the second document block can establish a parent-child hierarchical relationship with the first document block means that the second document block can serve as the parent level of the first document block, that is, a higher level of the hierarchy of the first document block. The embodiments of the present application do not limit the judgment method of whether the second document block can establish a parent-child hierarchical relationship with the first document block. As some examples, whether a document block has the ability to establish a parent-child hierarchical relationship with other document blocks is preset. In some other possible implementations, the hierarchical adjustment condition is that the content type of the second document block is a target content type. The target content type can be a preset type. For example, the target content type can be a text type.

[0049] S303: In response to the existence of the second document block, adjusting the level of the first document block according to the level adjustment instruction.

[0050] If the second document block exists, the level of the first document block is adjusted based on the level adjustment instruction.

[0051] It should be noted that the layout of the document block can be adjusted by adjusting the level of the document block. For example, the level of the level is related to the indentation degree of the document block. For example, the indentation degree of the block at a lower level is higher, and the indentation degree of the block at a higher level is lower.

[0052] In some possible implementations, adjusting the level of the first document block specifically means lowering the level of the first document block. The level of the first document block is a level below the level of the second document block, that is, by lowering the level of the first document block, a parent-child hierarchical relationship between the second document block and the first document block is established. The second document block is a parent level of the first document block, and the first document block is a child level of the second document block.

[0053] As some examples, adjusting the level can realize the typesetting of the document blocks. In some possible implementations, the level of the first document block and the level of the third document block are lowered, and correspondingly, the first document block and the third document block are indented. Specifically, the indentation processing is, for example, indenting the distance of one text character.

[0054] Based on the above S301-S303 related contents, it can be known that the user adjusts the level of the first document block when the second document block exists by triggering the level adjustment instruction. In this way, the level of the first document block can be conveniently adjusted, the document layout can be flexibly adjusted, and the problem of cumbersome user operations can be solved.

[0055] In some possible implementations, the embodiment of the present application provides a specific implementation method for determining whether a second document block exists, which specifically includes the following three steps:

[0056] A1: Sequentially traverse the document blocks that are at the same level as the first document block and whose layout order is before the first document block, and determine whether the document block meets the level adjustment condition.

[0057] Determine a document block that has the same level as the first document block and whose layout order precedes the first document block. Traverse the determined document blocks in sequence to determine whether the document blocks meet the level adjustment condition.

[0058] As some examples, the embodiments of the present application provide two methods for sequentially traversing document blocks at the same level as the first document block and whose layout order is before the first document block. In one possible implementation, starting from the first document block, document blocks at the same level as the first document block and whose layout order is before the first document block are traversed in order from back to front in terms of layout order.

[0059] Correspondingly, after determining that there is a document block that satisfies the level adjustment condition, that is, after determining that there is a second document block, the traversal of the document blocks can be stopped. For example, determine whether the first document block with the same level as the first document block in the typesetting order meets the level adjustment condition. If the first document block with the same level as the first document block in the typesetting order meets the level adjustment condition, stop determining other document blocks. If the first document block with the same level as the first document block in the typesetting order does not meet the level adjustment condition, then continue to determine whether the second document block with the same level as the first document block in the typesetting order meets the level adjustment condition. If the second document block with the same level as the first document block in the typesetting order meets the level adjustment condition, then stop determining other document blocks. If the second document block with the same level as the first document block in the typesetting order does not meet the level adjustment condition, then continue to determine the third document block with the same level as the first document block in the typesetting order, and so on. Until a document block that meets the level adjustment condition is determined, or all document blocks are determined to not meet the level adjustment condition, or the number of document blocks reaches a threshold. The threshold can be pre-set. By setting the threshold, it is possible to avoid excessive document block determination and excessive operation resources.

[0060] In another possible implementation, document blocks that are at the same level as the first document block and whose layout order is before the first document block are traversed in a layout order from front to back.

[0061] Correspondingly, as an example, in the order from front to back according to the typesetting order, it is necessary to traverse all the document blocks that are at the same level as the first document block and whose typesetting order is before the first document block. For example, starting from the first document block, the document blocks that are at the same level as the first document block and meet the level adjustment conditions are judged in turn in the typesetting order to see whether they meet the level adjustment conditions. For example, it is judged whether the first document block at the same level as the first document block in the typesetting order meets the level adjustment conditions. Regardless of whether the first document block at the same level as the first document block in the typesetting order meets the level adjustment conditions, the document blocks are judged in the typesetting order to see whether they meet the level adjustment conditions.

[0062] As another example, in the order from front to back according to the layout order, after determining that there is a document block that satisfies the level adjustment condition, that is, after determining that there is a second document block, the document block can be stopped from being traversed. For example, starting from the first document block, the document blocks that are at the same level as the first document block and meet the level adjustment condition are judged in turn in the layout order to see whether they meet the level adjustment condition. If the first document block at the same level as the first document block in the layout order meets the level adjustment condition, then the judgment of other document blocks is stopped. If the first document block at the same level as the first document block in the layout order does not meet the level adjustment condition, then the judgment of the second document block at the same level as the first document block in the layout order is continued to meet the level adjustment condition. If the second document block at the same level as the first document block in the layout order meets the level adjustment condition, then the judgment of other document blocks is stopped. If the second document block at the same level as the first document block in the layout order does not meet the level adjustment condition, then the judgment of the third document block at the same level as the first document block in the layout order is continued, and so on. Until the second document block is determined, or all document blocks before the first document block are determined to not meet the level adjustment condition, or the number of document blocks is determined to reach a threshold. The threshold can be pre-set. By setting the threshold, it is possible to avoid excessive document block determination and excessive operation resources.

[0063] A2: Determine the document block that meets the level adjustment condition as the second document block.

[0064] A3: Determine the document block that does not meet the level adjustment condition as the third document block.

[0065] In some possible implementations, in addition to not meeting the level adjustment condition, the condition for determining the third document block also needs to meet the condition that the layout order is after the second document block. That is, the document block that does not meet the level adjustment condition and whose layout order is after the second document block is taken as the third document block. The level of the third document block is also the same as that of the first document block, and its layout order is before the first document block.

[0066] In a possible implementation, after the third document block is determined, the first document block and the third document block can be adjusted simultaneously based on the level adjustment instruction.

[0067] Specifically, in response to the existence of the third document block, adjusting the level of the first document block according to the level adjustment instruction includes:

[0068] The levels of the first document block and the third document block are adjusted according to the level adjustment instruction.

[0069] It should be noted that the adjusted first document block and the third document block are independent document blocks, which are independent nodes of the block tree in the hierarchical structure of the document. The layout can be adjusted by adjusting the hierarchy. For example, the hierarchy has the same degree of indentation as the document block. For example, the indentation of the blocks at the lower level is higher, and the indentation of the blocks at the higher level is lower. As some examples, the hierarchy of the adjusted first document block and the third document block is the same. Correspondingly, the indentation of the first document block and the third document block is also the same.

[0070] With the above Figure 1 Take the document shown in the figure as an example, where document block 6 is the first document block, document block 3 is the second document block, and document block 5 is the third document block. In response to determining the third document block, the levels of document block 6 and document block 5 are adjusted according to the level adjustment instruction. Specifically, the levels of document block 6 and document block 5 can be lowered. Correspondingly, document block 6 and document block 5 are indented. The layout of the adjusted document is shown in FIG. Figure 5 shown.

[0071] In some other possible implementations, the user is required to confirm the hierarchical adjustment of the third document block. The present application embodiment provides a document editing method, which also includes the following two steps:

[0072] B1: In response to the existence of the third document block, a hierarchy adjustment prompt is displayed.

[0073] After determining that the third document block exists, a level adjustment prompt is displayed. The level adjustment prompt is used to remind the user to trigger the level adjustment instruction again. By the user triggering the level adjustment instruction again, it can be determined that the user needs to adjust the level of the third document block.

[0074] It should be noted that the embodiment of the present application does not limit the position of displaying the level adjustment prompt. For example, the level adjustment prompt may be displayed within the position where the third document block is located. For another example, the level adjustment prompt may be displayed near the position where the third document block is located. Figure 6 As shown, this figure is a schematic diagram of a display level adjustment prompt provided in an embodiment of the present application.

[0075] As an example, the level adjustment prompt includes one or more of a prompt text and a special display of the third document block.

[0076] The prompt text is used to instruct the user on how to trigger the level adjustment instruction. For example, the prompt text is "Press the tab key to continue adjusting the level." Or, the prompt text is "Continue to press the tab key to make the next adjustment."

[0077] In addition, the prompt text can also be used to identify the third document block. The embodiment of the present application does not limit the specific method of identifying the third document block. For example, the prompt text includes the block identifier of the third document block. For example, the prompt text is "Press the tab key to adjust the level of document block 6 and document block 5 above document block 6". For another example, the prompt text includes the position and content type of the third document block. For example, the prompt text is "Press the tab key to adjust the level of the text and the picture above the text". In addition, the prompt text can also prompt the typesetting effect after the level adjustment. For example, the prompt text is "Only the content below the picture supports indentation, continue to press tab to indent the upper picture together". It should be noted that when the third document block is a plurality of document blocks with the same content type, deduplication can be performed to display only the same content type. For example, the third document block is three document blocks, and the content types of the three document blocks are table, table and picture respectively. The prompt text is "Press the tab key to adjust the level of the text and the table and picture above the text".

[0078] The special display is to use a relatively special display mode for the third document block, so as to distinguish the third document block from other document blocks, such as highlight display and boundary box display.

[0079] It should be noted that, in some possible implementations, the level adjustments of the first document block and the third document block are independent of each other. That is, in response to the existence of the second document block, the level of the first document block is adjusted according to the level adjustment instruction, which may be before the third document block is adjusted, or after the third document block is adjusted. In another possible implementation, the levels of the first document block and the third document block are adjusted together. That is, first determine the existence of the third document block, and display the level adjustment prompt. In response to the level adjustment instruction obtained again, the levels of the first document block and the third document block are adjusted based on the level adjustment instruction obtained again.

[0080] Correspondingly, the level adjustment prompt includes one or more of a prompt text and a special display of the first document block and the third document block.

[0081] The prompt text can also be used to identify the first document block and the third document block. The embodiment of the present application does not limit the specific method of identifying the first document block and the third document block. For example, the prompt text includes the block identifier of the first document block and the block identifier of the third document block. For example, the prompt text is "Press the tab key to adjust the level of document block 6 and document block 5 above document block 6". For another example, the prompt text includes the position and content type of the first document block and the position and content type of the third document block. For example, the prompt text is "Press the tab key to adjust the level of the text and the picture above the text". In addition, the prompt text can also prompt the typesetting effect after the level adjustment. For example, the prompt text is "Only the content below the picture supports indentation, continue to press tab to indent the upper picture together". It should be noted that when the third document block is a plurality of document blocks with the same content type, deduplication can be performed to display only the same content type. For example, the third document block is three document blocks, and the content types of the three document blocks are table, table and picture respectively. The prompt text is "Press the tab key to adjust the level of the text and the table and picture above the text".

[0082] The special display is to use a relatively special display mode for the first document block and the third document block, so as to distinguish the first document block and the third document block from other document blocks. The special display is, for example, highlight display and boundary box display.

[0083] B2: In response to obtaining the hierarchy adjustment instruction again, adjusting the hierarchy of the third document block.

[0084] After obtaining the level adjustment instruction again, the level of the third document block is adjusted. The level adjustment method of the third document block is similar to the level adjustment method of the first document block. For details, please refer to the above description of the level adjustment of the first document block, which will not be repeated here.

[0085] In some possible implementations, the document blocks that are at the same level as the first document block and whose layout order is before the first document block do not include document blocks that meet the level adjustment conditions. That is, there is no second document block. It should be noted that in some possible implementations, in order to save computing resources, it is possible to determine whether n document blocks that are at the same level as the first document block and whose layout order is before the first document block meet the level adjustment conditions in the order from back to front of the layout order. When it is determined that n document blocks that are at the same level as the first document block and whose layout order is before the first document block do not meet the level adjustment conditions in the order from back to front of the layout order, it is determined that the document blocks that are at the same level as the first document block and whose layout order is before the first document block do not include document blocks that meet the level adjustment conditions in the order from back to front of the layout order. Wherein, n is a positive integer.

[0086] In such a case, the second document block cannot be determined. Correspondingly, a level adjustment failure prompt is displayed. The level adjustment failure prompt is used to indicate that the level adjustment of the first document block has failed.

[0087] Based on a document editing method provided by the above method embodiment, the embodiment of the present application also provides a document editing device, which will be described below in conjunction with the accompanying drawings.

[0088] See also Figure 7 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a document editing device provided in an embodiment of the present application. Figure 7 As shown, the document editing device includes:

[0089] A determining unit 701 is configured to determine a first document block based on the level adjustment instruction in response to obtaining the level adjustment instruction;

[0090] A judging unit 702 is configured to judge whether there is a second document block, wherein the second document block is a document block having the same level as the first document block and having a layout order before the first document block, and meeting the level adjustment condition;

[0091] The first adjustment unit 703 is configured to adjust the level of the first document block according to the level adjustment instruction in response to the existence of the second document block.

[0092] In a possible implementation, the determining unit 702 includes:

[0093] A traversal unit, configured to sequentially traverse document blocks at the same level as the first document block and before the first document block in typesetting order, and determine whether the document blocks meet a level adjustment condition;

[0094] A first determining subunit, configured to determine a document block satisfying the level adjustment condition as a second document block;

[0095] The second determining subunit is configured to determine the document block that does not satisfy the level adjustment condition as a third document block.

[0096] In a possible implementation, in response to the existence of the third document block, the first adjusting unit 703 is configured to adjust the level of the first document block according to the level adjustment instruction, including:

[0097] The first adjustment unit 703 is configured to adjust the levels of the first document block and the third document block according to the level adjustment instruction.

[0098] In a possible implementation, the second determining subunit is configured to determine a document block that does not satisfy the level adjustment condition and whose layout order is after the second document block as the third document block.

[0099] In a possible implementation manner, the device further includes:

[0100] A first display unit, configured to display a level adjustment prompt in response to the presence of the third document block, wherein the level adjustment prompt is used to remind the user to trigger the level adjustment instruction again;

[0101] The second adjustment unit is configured to adjust the level of the third document block in response to obtaining the level adjustment instruction again.

[0102] In a possible implementation, the first display unit is used to display a level adjustment prompt, including:

[0103] The first display unit is used to display a prompt text and one or more of special displays of the first document block and the third document block, wherein the prompt text is used to instruct the user on how to trigger the level adjustment instruction and to identify the first document block and the third document block.

[0104] In a possible implementation, the traversal unit is used to sequentially traverse document blocks that are at the same level as the first document block and whose layout order is before the first document block, including:

[0105] The traversal unit is used to traverse the document blocks at the same level as the first document block and whose layout order is before the first document block in a sequence from back to front in a layout order;

[0106] or,

[0107] The document blocks having the same level as the first document block and whose layout order is before the first document block are traversed in the order from front to back in the layout order.

[0108] In a possible implementation, the first adjusting unit 703, configured to adjust the level of the first document block according to the level adjustment instruction, includes:

[0109] The first adjustment unit 703 is configured to reduce the level of the first document block.

[0110] In a possible implementation, the first adjusting unit 703, configured to reduce the level of the first document block, includes:

[0111] The first adjustment unit 703 is used to perform indentation processing on the first document block.

[0112] In a possible implementation, the hierarchical adjustment condition is that the second document block can establish a parent-child hierarchical relationship with the first document block; or,

[0113] The level adjustment condition is that the content type of the second document block belongs to the target content type.

[0114] In a possible implementation manner, the device further includes:

[0115] The second display unit is configured to display a prompt indicating that the level adjustment fails in response to the absence of the second document block satisfying the level adjustment condition.

[0116] Based on a document editing method provided by the above method embodiment, the present application also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the document editing method as described in any of the above embodiments.

[0117] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0118] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 806 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0119] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 806 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication devices 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0120] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 806, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0121] The electronic device provided in the embodiment of the present application and the document editing method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0122] Based on a document editing method provided by the above method embodiment, an embodiment of the present application provides a computer storage medium on which a computer program is stored, wherein when the program is executed by a processor, the document editing method as described in any of the above embodiments is implemented.

[0123] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0124] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0125] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0126] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the document editing method as described in any of the above embodiments.

[0127] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0129] The units involved in the embodiments described in this application may be implemented by software or hardware. The name of a unit / module does not limit the unit itself in some cases. For example, a voice data acquisition module may also be described as a "data acquisition module".

[0130] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0131] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0132] According to one or more embodiments of the present application, [Example 1] provides a document editing method, the method comprising:

[0133] In response to obtaining a level adjustment instruction, determining a first document block based on the level adjustment instruction;

[0134] Determining whether there is a second document block, wherein the second document block is a document block that has the same level as the first document block and is before the first document block in typesetting order and satisfies the level adjustment condition;

[0135] In response to the existence of the second document block, the level of the first document block is adjusted according to the level adjustment instruction.

[0136] According to one or more embodiments of the present application, [Example 2] provides a document editing method, wherein determining whether a second document block exists includes:

[0137] Sequentially traverse document blocks at the same level as the first document block and before the first document block in typesetting order, and determine whether the document block meets the level adjustment condition;

[0138] Determining a document block that meets the level adjustment condition as a second document block;

[0139] The document block that does not satisfy the level adjustment condition is determined as a third document block.

[0140] According to one or more embodiments of the present application, [Example 3] provides a document editing method, in response to the existence of the third document block, adjusting the level of the first document block according to the level adjustment instruction, including:

[0141] The levels of the first document block and the third document block are adjusted according to the level adjustment instruction.

[0142] According to one or more embodiments of the present application, [Example 4] provides a document editing method, wherein determining a document block that does not satisfy the level adjustment condition as a third document block includes:

[0143] A document block that does not meet the level adjustment condition and whose layout order is after the second document block is determined as the third document block.

[0144] According to one or more embodiments of the present application, [Example 5] provides a document editing method, the method further comprising:

[0145] In response to the existence of the third document block, displaying a level adjustment prompt, wherein the level adjustment prompt is used to remind the user to trigger the level adjustment instruction again;

[0146] In response to obtaining the level adjustment instruction again, the level of the third document block is adjusted.

[0147] According to one or more embodiments of the present application, [Example 6] provides a document editing method, wherein the display level adjustment prompt includes:

[0148] One or more of displaying a prompt text and performing special display on the first document block and the third document block, wherein the prompt text is used to instruct the user on how to trigger the level adjustment instruction and to identify the first document block and the third document block.

[0149] According to one or more embodiments of the present application, [Example 7] provides a document editing method, wherein the sequentially traversing document blocks having the same level as the first document block and having a layout order before the first document block includes:

[0150] Traversing the document blocks at the same level as the first document block and before the first document block in the layout order from back to front;

[0151] or,

[0152] The document blocks having the same level as the first document block and whose layout order is before the first document block are traversed in the order from front to back in the layout order.

[0153] According to one or more embodiments of the present application, [Example 8] provides a document editing method, wherein adjusting the level of the first document block according to the level adjustment instruction includes:

[0154] The first document block is downgraded.

[0155] According to one or more embodiments of the present application, [Example 9] provides a document editing method, wherein lowering the level of the first document block includes:

[0156] The first document block is indented.

[0157] According to one or more embodiments of the present application, [Example 10] provides a document editing method, wherein the hierarchical adjustment condition is that the second document block can establish a parent-child hierarchical relationship with the first document block; or,

[0158] The level adjustment condition is that the content type of the second document block belongs to the target content type.

[0159] According to one or more embodiments of the present application, [Example 11] provides a document editing method, the method further comprising:

[0160] In response to the absence of the second document block satisfying the level adjustment condition, a level adjustment failure prompt is displayed.

[0161] According to one or more embodiments of the present application, [Example 12] provides a document editing device, the device comprising:

[0162] a determining unit, configured to, in response to acquiring a level adjustment instruction, determine a first document block based on the level adjustment instruction;

[0163] a determination unit, configured to determine whether there is a second document block, wherein the second document block is a document block having the same level as the first document block and having a layout order before the first document block, and meeting the level adjustment condition;

[0164] The first adjustment unit is configured to adjust the level of the first document block according to the level adjustment instruction in response to the existence of the second document block.

[0165] According to one or more embodiments of the present application, [Example 13] provides a document editing device, wherein the judgment unit includes:

[0166] A traversal unit, configured to sequentially traverse document blocks at the same level as the first document block and before the first document block in typesetting order, and determine whether the document blocks meet a level adjustment condition;

[0167] A first determining subunit, configured to determine a document block satisfying the level adjustment condition as a second document block;

[0168] The second determining subunit is configured to determine the document block that does not satisfy the level adjustment condition as a third document block.

[0169] According to one or more embodiments of the present application, [Example 14] provides a document editing device, in response to the existence of the third document block, the first adjustment unit is used to adjust the level of the first document block according to the level adjustment instruction, including:

[0170] The first adjustment unit is used to adjust the levels of the first document block and the third document block according to the level adjustment instruction.

[0171] According to one or more embodiments of the present application, [Example 15] provides a document editing device, wherein the second determination subunit is used to determine a document block that does not meet the hierarchical adjustment condition and whose typesetting order is after the second document block as a third document block.

[0172] According to one or more embodiments of the present application, [Example 16] provides a document editing device, the device further comprising:

[0173] A first display unit, configured to display a level adjustment prompt in response to the presence of the third document block, wherein the level adjustment prompt is used to remind the user to trigger the level adjustment instruction again;

[0174] The second adjustment unit is configured to adjust the level of the third document block in response to obtaining the level adjustment instruction again.

[0175] According to one or more embodiments of the present application, [Example 17] provides a document editing device, wherein the first display unit is used to display a level adjustment prompt, including:

[0176] The first display unit is used to display a prompt text and one or more of special displays of the first document block and the third document block, wherein the prompt text is used to instruct the user on how to trigger the level adjustment instruction and to identify the first document block and the third document block.

[0177] According to one or more embodiments of the present application, [Example 18] provides a document editing device, wherein the traversal unit is used to sequentially traverse document blocks that are at the same level as the first document block and whose layout order is before the first document block, including:

[0178] The traversal unit is used to traverse the document blocks at the same level as the first document block and whose layout order is before the first document block in a sequence from back to front in a layout order;

[0179] or,

[0180] The document blocks having the same level as the first document block and whose layout order is before the first document block are traversed in the order from front to back in the layout order.

[0181] According to one or more embodiments of the present application, [Example 19] provides a document editing device, wherein the first adjustment unit is used to adjust the level of the first document block according to the level adjustment instruction, including:

[0182] The first adjustment unit is used to lower the level of the first document block.

[0183] According to one or more embodiments of the present application, [Example 20] provides a document editing device, wherein the first adjustment unit is used to reduce the level of the first document block, including:

[0184] The first adjustment unit is used to perform indentation processing on the first document block.

[0185] According to one or more embodiments of the present application, [Example 21] provides a document editing device, wherein the hierarchical adjustment condition is that the second document block can establish a parent-child hierarchical relationship with the first document block; or,

[0186] The level adjustment condition is that the content type of the second document block belongs to the target content type.

[0187] According to one or more embodiments of the present application, [Example 22] provides a document editing device, the device further comprising:

[0188] The second display unit is configured to display a prompt indicating that the level adjustment fails in response to the absence of the second document block satisfying the level adjustment condition.

[0189] According to one or more embodiments of the present application, [Example 23] provides an electronic device, including:

[0190] one or more processors;

[0191] a storage device having one or more programs stored thereon,

[0192] When the one or more programs are executed by the one or more processors, the one or more processors implement the document editing method as described in any one of [Example 1] to [Example 11] above.

[0193] According to one or more embodiments of the present application, [Example 24] provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the document editing method as described in any one of [Example 1] to [Example 11] above is implemented.

[0194] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0195] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0196] It should also 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 presence of other identical elements in the process, method, article or device including the elements.

[0197] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0198] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A document editing method, characterized in that: The method comprises: In response to obtaining a level adjustment instruction, determining a first document block based on the level adjustment instruction; Determining whether there is a second document block, wherein the second document block is a document block that has the same level as the first document block and is before the first document block in typesetting order and satisfies the level adjustment condition; In response to the existence of the second document block, adjusting the level of the first document block according to the level adjustment instruction; The determining whether the second document block exists includes: Sequentially traverse document blocks at the same level as the first document block and before the first document block in typesetting order, and determine whether the document block meets the level adjustment condition; Determining a document block that meets the level adjustment condition as a second document block; The document block that does not satisfy the level adjustment condition is determined as a third document block.

2. The method according to claim 1, characterized in that In response to the existence of the third document block, adjusting the level of the first document block according to the level adjustment instruction includes: The levels of the first document block and the third document block are adjusted according to the level adjustment instruction.

3. The method according to claim 1, characterized in that The step of determining the document block that does not satisfy the level adjustment condition as the third document block includes: A document block that does not meet the level adjustment condition and whose layout order is after the second document block is determined as the third document block.

4. The method according to claim 1, characterized in that: The method further comprises: In response to the existence of the third document block, displaying a level adjustment prompt, wherein the level adjustment prompt is used to remind the user to trigger the level adjustment instruction again; In response to obtaining the level adjustment instruction again, the level of the third document block is adjusted.

5. The method according to claim 4, characterized in that The display level adjustment prompt includes: One or more of displaying a prompt text and performing special display on the first document block and the third document block, wherein the prompt text is used to instruct the user on how to trigger the level adjustment instruction and to identify the first document block and the third document block.

6. The method according to claim 1, characterized in that The step of sequentially traversing the document blocks at the same level as the first document block and before the first document block in layout order includes: Traversing the document blocks at the same level as the first document block and before the first document block in the layout order from back to front; or, The document blocks having the same level as the first document block and whose layout order is before the first document block are traversed in the order from front to back in the layout order.

7. The method according to claim 1, characterized in that The step of adjusting the level of the first document block according to the level adjustment instruction includes: The first document block is downgraded.

8. The method according to claim 7, characterized in that The step of lowering the level of the first document block includes: The first document block is indented.

9. The method according to any one of claims 1 to 8, characterized in that: The hierarchical adjustment condition is that the second document block can establish a parent-child hierarchical relationship with the first document block; or The level adjustment condition is that the content type of the second document block belongs to the target content type.

10. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: In response to the absence of the second document block satisfying the level adjustment condition, a level adjustment failure prompt is displayed.

11. A document editing device, characterized in that: The device comprises: a determining unit, configured to, in response to acquiring a level adjustment instruction, determine a first document block based on the level adjustment instruction; a determination unit, configured to determine whether there is a second document block, wherein the second document block is a document block having the same level as the first document block and having a layout order before the first document block, and meeting the level adjustment condition; A first adjustment unit, configured to adjust the level of the first document block according to the level adjustment instruction in response to the existence of the second document block; The judging unit comprises: A traversal unit, configured to sequentially traverse document blocks at the same level as the first document block and before the first document block in typesetting order, and determine whether the document blocks meet a level adjustment condition; A first determining subunit, configured to determine a document block satisfying the level adjustment condition as a second document block; The second determining subunit is configured to determine the document block that does not satisfy the level adjustment condition as a third document block.

12. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 10.

13. A computer readable medium, characterized in that A computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Document editing method and device

    CN109445657A

  • Method and device for automatically generating lecture notes based on web technology

    CN110532525A

  • Document hierarchy division method, document hierarchy division device and readable storage medium

    CN111079402A

  • Format adjustment method and device, computer storage medium and terminal

    CN112016277A

  • Document editing method, document editing system and computer storage medium

    CN112100989A